Merge lp:~akopytov/percona-xtrabackup/single-binary into lp:percona-xtrabackup/2.2

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 4905
Proposed branch: lp:~akopytov/percona-xtrabackup/single-binary
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 120666 lines (+2453/-110960) (has conflicts)
676 files modified
.bzrignore (+12/-0)
BUILD.XtraBackup.txt (+18/-33)
CMakeLists.txt (+16/-43)
XB_VERSION (+4/-1)
cmake/build_configurations/xtrabackup_release.cmake (+57/-0)
cmake/gcrypt.cmake (+41/-0)
cmake/install_layout.cmake (+12/-26)
cmake/mysql_version.cmake (+42/-10)
cmake/package_name.cmake (+3/-8)
cmake/plugin.cmake (+0/-1)
extra/CMakeLists.txt (+0/-49)
include/CMakeLists.txt (+0/-6)
libmysql/CMakeLists.txt (+3/-6)
libmysqld/CMakeLists.txt (+2/-12)
mysys/my_thr_init.c (+6/-2)
sql/CMakeLists.txt (+0/-59)
sql/share/CMakeLists.txt (+0/-18)
storage/innobase/CMakeLists.txt (+7/-2)
storage/innobase/btr/btr0btr.cc (+2/-2)
storage/innobase/buf/buf0buf.cc (+29/-1)
storage/innobase/buf/buf0checksum.cc (+24/-0)
storage/innobase/buf/buf0flu.cc (+3/-1)
storage/innobase/fil/fil0fil.cc (+233/-274)
storage/innobase/handler/ha_innodb.cc (+123/-71)
storage/innobase/handler/handler0alter.cc (+2/-0)
storage/innobase/include/btr0btr.h (+24/-0)
storage/innobase/include/buf0buf.h (+2/-0)
storage/innobase/include/buf0checksum.h (+9/-0)
storage/innobase/include/dict0dict.h (+1/-1)
storage/innobase/include/fil0fil.h (+217/-7)
storage/innobase/include/fil0fil.ic (+62/-0)
storage/innobase/include/ha_prototypes.h (+16/-0)
storage/innobase/include/log0log.h (+31/-5)
storage/innobase/include/log0log.ic (+38/-1)
storage/innobase/include/log0recv.h (+33/-7)
storage/innobase/include/os0file.h (+5/-1)
storage/innobase/include/srv0srv.h (+9/-0)
storage/innobase/include/srv0start.h (+36/-0)
storage/innobase/include/trx0sys.h (+2/-0)
storage/innobase/include/univ.i (+3/-0)
storage/innobase/include/ut0rnd.h (+8/-0)
storage/innobase/include/ut0rnd.ic (+25/-0)
storage/innobase/log/log0log.cc (+90/-31)
storage/innobase/log/log0recv.cc (+188/-63)
storage/innobase/mem/mem0dbg.cc (+4/-19)
storage/innobase/os/os0file.cc (+1/-1)
storage/innobase/page/page0cur.cc (+3/-1)
storage/innobase/srv/srv0srv.cc (+15/-1)
storage/innobase/srv/srv0start.cc (+80/-44)
storage/innobase/sync/sync0arr.cc (+8/-0)
storage/innobase/trx/trx0rseg.cc (+2/-0)
storage/innobase/trx/trx0sys.cc (+12/-1)
storage/innobase/trx/trx0trx.cc (+2/-1)
storage/innobase/xtrabackup/CMakeLists.txt (+25/-59)
storage/innobase/xtrabackup/innobackupex.pl (+20/-85)
storage/innobase/xtrabackup/src/CMakeLists.txt (+98/-0)
storage/innobase/xtrabackup/src/changed_page_bitmap.cc (+8/-9)
storage/innobase/xtrabackup/src/changed_page_bitmap.h (+2/-1)
storage/innobase/xtrabackup/src/common.h (+0/-6)
storage/innobase/xtrabackup/src/compact.cc (+24/-38)
storage/innobase/xtrabackup/src/compact.h (+1/-1)
storage/innobase/xtrabackup/src/ds_archive.c (+9/-11)
storage/innobase/xtrabackup/src/ds_buffer.c (+3/-3)
storage/innobase/xtrabackup/src/ds_compress.c (+5/-5)
storage/innobase/xtrabackup/src/ds_encrypt.c (+20/-9)
storage/innobase/xtrabackup/src/ds_local.c (+3/-3)
storage/innobase/xtrabackup/src/ds_stdout.c (+3/-3)
storage/innobase/xtrabackup/src/ds_tmpfile.c (+6/-6)
storage/innobase/xtrabackup/src/ds_xbstream.c (+10/-11)
storage/innobase/xtrabackup/src/fil_cur.cc (+24/-19)
storage/innobase/xtrabackup/src/fil_cur.h (+0/-1)
storage/innobase/xtrabackup/src/libarchive/CMakeLists.txt (+4/-24)
storage/innobase/xtrabackup/src/libarchive/libarchive/CMakeLists.txt (+0/-13)
storage/innobase/xtrabackup/src/libarchive/libarchive/archive_read_support_format_mtree.c (+1/-1)
storage/innobase/xtrabackup/src/libarchive/libarchive/archive_write_disk.c (+1/-1)
storage/innobase/xtrabackup/src/read_filt.h (+0/-1)
storage/innobase/xtrabackup/src/write_filt.cc (+3/-3)
storage/innobase/xtrabackup/src/xbcrypt.c (+7/-7)
storage/innobase/xtrabackup/src/xbcrypt_common.c (+10/-0)
storage/innobase/xtrabackup/src/xbcrypt_read.c (+2/-2)
storage/innobase/xtrabackup/src/xbcrypt_write.c (+1/-1)
storage/innobase/xtrabackup/src/xbstream.c (+4/-4)
storage/innobase/xtrabackup/src/xbstream_read.c (+2/-2)
storage/innobase/xtrabackup/src/xbstream_write.c (+3/-3)
storage/innobase/xtrabackup/src/xtrabackup.cc (+422/-502)
storage/innobase/xtrabackup/src/xtrabackup.h (+6/-1)
storage/innobase/xtrabackup/src/xtrabackup_version.h.in (+27/-0)
storage/innobase/xtrabackup/test/CMakeLists.txt (+30/-0)
storage/innobase/xtrabackup/test/inc/common.sh (+1/-0)
storage/innobase/xtrabackup/test/run.sh (+40/-70)
storage/innobase/xtrabackup/test/t/bug759225.sh (+0/-7)
storage/innobase/xtrabackup/test/t/bug884737.sh (+1/-1)
storage/innobase/xtrabackup/test/t/bug891496.sh (+0/-1)
storage/innobase/xtrabackup/test/t/server_version.sh (+0/-13)
storage/innobase/xtrabackup/test/t/xb_apply_archived_logs.sh (+0/-10)
storage/innobase/xtrabackup/utils/build-binary.sh (+28/-31)
storage/innobase/xtrabackup/utils/build-dpkg.sh (+11/-4)
storage/innobase/xtrabackup/utils/build-rpm.sh (+9/-8)
storage/innobase/xtrabackup/utils/xtrabackup.spec (+12/-17)
storage/myisam/CMakeLists.txt (+0/-15)
storage/perfschema/CMakeLists.txt (+2/-1)
xtrabackup/BUILD-WIN.txt (+0/-83)
xtrabackup/patches/innodb51.patch (+0/-1529)
xtrabackup/patches/innodb55.patch (+0/-1448)
xtrabackup/patches/innodb56.patch (+0/-2665)
xtrabackup/patches/xtradb51.patch (+0/-1600)
xtrabackup/patches/xtradb55.patch (+0/-1598)
xtrabackup/src/Makefile (+0/-250)
xtrabackup/src/innodb_int.cc (+0/-1208)
xtrabackup/src/innodb_int.h (+0/-1179)
xtrabackup/test/kewpie/.bzrignore (+0/-5)
xtrabackup/test/kewpie/docs/Makefile (+0/-130)
xtrabackup/test/kewpie/docs/conf.py (+0/-216)
xtrabackup/test/kewpie/docs/dbqp.rst (+0/-21)
xtrabackup/test/kewpie/docs/index.rst (+0/-34)
xtrabackup/test/kewpie/docs/kewpie.rst (+0/-498)
xtrabackup/test/kewpie/docs/make.bat (+0/-170)
xtrabackup/test/kewpie/docs/randgen.rst (+0/-202)
xtrabackup/test/kewpie/docs/sql-bench.rst (+0/-182)
xtrabackup/test/kewpie/docs/sysbench.rst (+0/-123)
xtrabackup/test/kewpie/docs/test-run.rst (+0/-494)
xtrabackup/test/kewpie/docs/writing_tests.rst (+0/-100)
xtrabackup/test/kewpie/kewpie.py (+0/-130)
xtrabackup/test/kewpie/lib/modes/dtr/dtr_test_execution.py (+0/-139)
xtrabackup/test/kewpie/lib/modes/dtr/dtr_test_management.py (+0/-495)
xtrabackup/test/kewpie/lib/modes/native/native_test_execution.py (+0/-100)
xtrabackup/test/kewpie/lib/modes/native/native_test_management.py (+0/-201)
xtrabackup/test/kewpie/lib/modes/sysbench/sysbench_test_execution.py (+0/-162)
xtrabackup/test/kewpie/lib/modes/sysbench/sysbench_test_management.py (+0/-159)
xtrabackup/test/kewpie/lib/modes/test_mode.py (+0/-68)
xtrabackup/test/kewpie/lib/opts/defaults.py (+0/-98)
xtrabackup/test/kewpie/lib/opts/matrix_manager.py (+0/-34)
xtrabackup/test/kewpie/lib/opts/test_run_options.py (+0/-575)
xtrabackup/test/kewpie/lib/server_mgmt/drizzled.py (+0/-236)
xtrabackup/test/kewpie/lib/server_mgmt/galera.py (+0/-360)
xtrabackup/test/kewpie/lib/server_mgmt/mysqld.py (+0/-506)
xtrabackup/test/kewpie/lib/server_mgmt/percona.py (+0/-287)
xtrabackup/test/kewpie/lib/server_mgmt/server.py (+0/-383)
xtrabackup/test/kewpie/lib/server_mgmt/server_management.py (+0/-507)
xtrabackup/test/kewpie/lib/sys_mgmt/codeTree.py (+0/-489)
xtrabackup/test/kewpie/lib/sys_mgmt/code_management.py (+0/-116)
xtrabackup/test/kewpie/lib/sys_mgmt/environment_management.py (+0/-99)
xtrabackup/test/kewpie/lib/sys_mgmt/logging_management.py (+0/-162)
xtrabackup/test/kewpie/lib/sys_mgmt/port_management.py (+0/-196)
xtrabackup/test/kewpie/lib/sys_mgmt/system_management.py (+0/-548)
xtrabackup/test/kewpie/lib/sys_mgmt/time_management.py (+0/-118)
xtrabackup/test/kewpie/lib/test_mgmt/execution_management.py (+0/-142)
xtrabackup/test/kewpie/lib/test_mgmt/test_execution.py (+0/-325)
xtrabackup/test/kewpie/lib/test_mgmt/test_management.py (+0/-300)
xtrabackup/test/kewpie/lib/util/crashme_methods.py (+0/-127)
xtrabackup/test/kewpie/lib/util/mysqlBaseTestCase.py (+0/-412)
xtrabackup/test/kewpie/lib/util/mysql_methods.py (+0/-258)
xtrabackup/test/kewpie/lib/util/randgen_methods.py (+0/-55)
xtrabackup/test/kewpie/lib/util/sqlbench_methods.py (+0/-70)
xtrabackup/test/kewpie/lib/util/xtrabackup_methods.py (+0/-109)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug514068_test.py (+0/-189)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug606981_test.py (+0/-134)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug722638_test.py (+0/-225)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug723097_test.py (+0/-124)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug729843_test.py (+0/-82)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug733663_test.py (+0/-143)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug759225_test.py (+0/-142)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug766607_test.py (+0/-194)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug810269_test.py (+0/-167)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug817132_test.py (+0/-137)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug884737_test.py (+0/-122)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/galeraInfo_test.py (+0/-108)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_basic_test.py (+0/-114)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_csm_csv_test.py (+0/-120)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_databases_test_disabled.py (+0/-122)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_incremental_test.py (+0/-204)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_nonempty_dir_test.py (+0/-101)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_parallel_test.py (+0/-119)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_rsync_test.py (+0/-126)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_slave_info_test.py (+0/-87)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_slave_test.py (+0/-173)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_specialchar_test.py (+0/-151)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_stream_test.py (+0/-127)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/tar4ibd_symlink_test.py (+0/-151)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_defaults_file_test.py (+0/-78)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_export_test.py (+0/-297)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_incremental_compressed_test.py (+0/-219)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_incremental_test.py (+0/-199)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_log_overwrap_test.py (+0/-114)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_part_range_test.py (+0/-205)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_partial_test.py (+0/-178)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_stats_sakila_test.py (+0/-130)
xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/xb_stats_test.py (+0/-122)
xtrabackup/test/kewpie/percona_tests/xtrabackup_main/ib_slave_test.py (+0/-173)
xtrabackup/test/kewpie/randgen/Contributors (+0/-22)
xtrabackup/test/kewpie/randgen/LICENSE (+0/-339)
xtrabackup/test/kewpie/randgen/Makefile (+0/-20)
xtrabackup/test/kewpie/randgen/README (+0/-28)
xtrabackup/test/kewpie/randgen/backtrace-all.gdb (+0/-19)
xtrabackup/test/kewpie/randgen/backtrace.gdb (+0/-21)
xtrabackup/test/kewpie/randgen/bench/WL5004_sql.yy (+0/-1656)
xtrabackup/test/kewpie/randgen/bench/benchmark.pl (+0/-75)
xtrabackup/test/kewpie/randgen/bench/falcon_data_types.zz (+0/-34)
xtrabackup/test/kewpie/randgen/bughunt_template.cfg (+0/-207)
xtrabackup/test/kewpie/randgen/combinations.pl (+0/-322)
xtrabackup/test/kewpie/randgen/conf/backup/backup_interop.yy (+0/-92)
xtrabackup/test/kewpie/randgen/conf/backup/backup_obj.yy (+0/-132)
xtrabackup/test/kewpie/randgen/conf/backup/backup_simple.yy (+0/-50)
xtrabackup/test/kewpie/randgen/conf/backup/invariant.yy (+0/-279)
xtrabackup/test/kewpie/randgen/conf/backup/invariant.zz (+0/-56)
xtrabackup/test/kewpie/randgen/conf/dbt3/LICENSE (+0/-110)
xtrabackup/test/kewpie/randgen/conf/dbt3/dbt3-dml.yy (+0/-824)
xtrabackup/test/kewpie/randgen/conf/dbt3/dbt3-joins.yy (+0/-465)
xtrabackup/test/kewpie/randgen/conf/dbt3/dbt3-ranges.yy (+0/-219)
xtrabackup/test/kewpie/randgen/conf/dbt3/dbt3-s0.0001.dump (+0/-42)
xtrabackup/test/kewpie/randgen/conf/dbt3/dbt3-s0.001.dump (+0/-310)
xtrabackup/test/kewpie/randgen/conf/drizzle/bug680669.yy (+0/-246)
xtrabackup/test/kewpie/randgen/conf/drizzle/collations_drizzle.yy (+0/-49)
xtrabackup/test/kewpie/randgen/conf/drizzle/combinations_drizzle.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/drizzle/data_dict_concurrent_drizzle.yy (+0/-114)
xtrabackup/test/kewpie/randgen/conf/drizzle/drizzle.yy (+0/-34)
xtrabackup/test/kewpie/randgen/conf/drizzle/drizzle.zz (+0/-44)
xtrabackup/test/kewpie/randgen/conf/drizzle/drizzledump.yy (+0/-167)
xtrabackup/test/kewpie/randgen/conf/drizzle/drizzledump_migrate.yy (+0/-204)
xtrabackup/test/kewpie/randgen/conf/drizzle/drizzledump_migrate.zz (+0/-51)
xtrabackup/test/kewpie/randgen/conf/drizzle/limit_compare_drizzle.yy (+0/-111)
xtrabackup/test/kewpie/randgen/conf/drizzle/many_indexes_drizzle.yy (+0/-55)
xtrabackup/test/kewpie/randgen/conf/drizzle/many_indexes_drizzle.zz (+0/-32)
xtrabackup/test/kewpie/randgen/conf/drizzle/optimizer_subquery_data_dictionary_drizzle.yy (+0/-867)
xtrabackup/test/kewpie/randgen/conf/drizzle/optimizer_subquery_drizzle.yy (+0/-802)
xtrabackup/test/kewpie/randgen/conf/drizzle/outer_join_data_dictionary_drizzle.yy (+0/-337)
xtrabackup/test/kewpie/randgen/conf/drizzle/outer_join_drizzle.yy (+0/-273)
xtrabackup/test/kewpie/randgen/conf/drizzle/outer_join_drizzle.zz (+0/-33)
xtrabackup/test/kewpie/randgen/conf/drizzle/outer_join_portable_drizzle.yy (+0/-335)
xtrabackup/test/kewpie/randgen/conf/drizzle/proclist_drizzle.yy (+0/-119)
xtrabackup/test/kewpie/randgen/conf/drizzle/proclist_subquery_drizzle.yy (+0/-794)
xtrabackup/test/kewpie/randgen/conf/drizzle/range_access_drizzle.yy (+0/-390)
xtrabackup/test/kewpie/randgen/conf/drizzle/range_access_drizzle.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/drizzle/subquery_drizzle.yy (+0/-220)
xtrabackup/test/kewpie/randgen/conf/drizzle/subquery_materialization_drizzle.yy (+0/-169)
xtrabackup/test/kewpie/randgen/conf/drizzle/subquery_semijoin_drizzle.yy (+0/-165)
xtrabackup/test/kewpie/randgen/conf/drizzle/subquery_semijoin_nested_drizzle.yy (+0/-208)
xtrabackup/test/kewpie/randgen/conf/drizzle/translog_concurrent1.yy (+0/-227)
xtrabackup/test/kewpie/randgen/conf/drizzle/translog_concurrent2.yy (+0/-221)
xtrabackup/test/kewpie/randgen/conf/drizzle/translog_concurrent3.yy (+0/-242)
xtrabackup/test/kewpie/randgen/conf/drizzle/translog_drizzle.zz (+0/-44)
xtrabackup/test/kewpie/randgen/conf/drizzle/translog_ordering.yy (+0/-25)
xtrabackup/test/kewpie/randgen/conf/drizzle/translog_ordering.zz (+0/-44)
xtrabackup/test/kewpie/randgen/conf/drizzle/varchar_drizzle.zz (+0/-32)
xtrabackup/test/kewpie/randgen/conf/dyncol/dyncol_dml.yy (+0/-118)
xtrabackup/test/kewpie/randgen/conf/dyncol/dyncol_dml.zz (+0/-16)
xtrabackup/test/kewpie/randgen/conf/engines/blobs.yy (+0/-35)
xtrabackup/test/kewpie/randgen/conf/engines/concurrent.yy (+0/-55)
xtrabackup/test/kewpie/randgen/conf/engines/engine_stress.yy (+0/-134)
xtrabackup/test/kewpie/randgen/conf/engines/engine_stress.zz (+0/-30)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_backlog.yy (+0/-40)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_backlog.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_blobs.yy (+0/-37)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_blobs.zz (+0/-28)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_chill_thaw.yy (+0/-48)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_chill_thaw.zz (+0/-30)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_data_types.yy (+0/-56)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_data_types.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_data_types_no_year_time.yy (+0/-60)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_data_types_no_year_time.zz (+0/-36)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_ddl.yy (+0/-114)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_limit.yy (+0/-95)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_nolimit.yy (+0/-64)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_nolimit_int.yy (+0/-63)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_online_alter.yy (+0/-57)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_pagesize.yy (+0/-60)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_pagesize2K.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_pagesize32K.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_recovery.yy (+0/-187)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_recovery.zz (+0/-31)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_replication.yy (+0/-64)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_replication.zz (+0/-37)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_select_autocommit.yy (+0/-19)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_simple.cc (+0/-74)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/falcon_varchar.cc (+0/-76)
xtrabackup/test/kewpie/randgen/conf/engines/falcon/limit_compare.yy (+0/-75)
xtrabackup/test/kewpie/randgen/conf/engines/handler.yy (+0/-85)
xtrabackup/test/kewpie/randgen/conf/engines/handler.zz (+0/-15)
xtrabackup/test/kewpie/randgen/conf/engines/heap/heap.cc (+0/-12)
xtrabackup/test/kewpie/randgen/conf/engines/heap/heap_ddl_multi.yy (+0/-207)
xtrabackup/test/kewpie/randgen/conf/engines/heap/heap_dml_single.init (+0/-37)
xtrabackup/test/kewpie/randgen/conf/engines/heap/heap_dml_single.yy (+0/-110)
xtrabackup/test/kewpie/randgen/conf/engines/innodb/innodb_simple.cc (+0/-71)
xtrabackup/test/kewpie/randgen/conf/engines/many_indexes.yy (+0/-64)
xtrabackup/test/kewpie/randgen/conf/engines/many_indexes.zz (+0/-35)
xtrabackup/test/kewpie/randgen/conf/engines/maria/maria.zz (+0/-33)
xtrabackup/test/kewpie/randgen/conf/engines/maria/maria_bulk_insert.yy (+0/-35)
xtrabackup/test/kewpie/randgen/conf/engines/maria/maria_dml_alter.yy (+0/-73)
xtrabackup/test/kewpie/randgen/conf/engines/maria/maria_mostly_selects.yy (+0/-70)
xtrabackup/test/kewpie/randgen/conf/engines/maria/maria_recovery.cc (+0/-82)
xtrabackup/test/kewpie/randgen/conf/engines/maria/maria_stress.yy (+0/-65)
xtrabackup/test/kewpie/randgen/conf/engines/tiny_inserts.yy (+0/-24)
xtrabackup/test/kewpie/randgen/conf/engines/tiny_inserts.zz (+0/-26)
xtrabackup/test/kewpie/randgen/conf/engines/varchar.yy (+0/-52)
xtrabackup/test/kewpie/randgen/conf/engines/varchar.zz (+0/-36)
xtrabackup/test/kewpie/randgen/conf/examples/example.ff (+0/-22)
xtrabackup/test/kewpie/randgen/conf/examples/example.yy (+0/-31)
xtrabackup/test/kewpie/randgen/conf/examples/example.zz (+0/-37)
xtrabackup/test/kewpie/randgen/conf/examples/flightstats.yy (+0/-270)
xtrabackup/test/kewpie/randgen/conf/gis/README (+0/-29)
xtrabackup/test/kewpie/randgen/conf/gis/gis.yy (+0/-230)
xtrabackup/test/kewpie/randgen/conf/gis/linestring.yy (+0/-59)
xtrabackup/test/kewpie/randgen/conf/gis/wkt2sql.pl (+0/-56)
xtrabackup/test/kewpie/randgen/conf/hivol/hivol_fbase_small.yy (+0/-209)
xtrabackup/test/kewpie/randgen/conf/hivol/hivol_film.yy (+0/-450)
xtrabackup/test/kewpie/randgen/conf/i18n/collations.yy (+0/-39)
xtrabackup/test/kewpie/randgen/conf/optimizer/archive/subquery_materialization.yy (+0/-171)
xtrabackup/test/kewpie/randgen/conf/optimizer/archive/subquery_semijoin.yy (+0/-167)
xtrabackup/test/kewpie/randgen/conf/optimizer/archive/subquery_semijoin_nested.yy (+0/-219)
xtrabackup/test/kewpie/randgen/conf/optimizer/blobs.zz (+0/-36)
xtrabackup/test/kewpie/randgen/conf/optimizer/dsmrr-cpk-compare.cc (+0/-52)
xtrabackup/test/kewpie/randgen/conf/optimizer/dsmrr-cpk-single.cc (+0/-66)
xtrabackup/test/kewpie/randgen/conf/optimizer/dsmrr-cpk.ff (+0/-8)
xtrabackup/test/kewpie/randgen/conf/optimizer/intersect.ff (+0/-3)
xtrabackup/test/kewpie/randgen/conf/optimizer/join_buffer.ff (+0/-3)
xtrabackup/test/kewpie/randgen/conf/optimizer/mrr-single.cc (+0/-56)
xtrabackup/test/kewpie/randgen/conf/optimizer/mrr.ff (+0/-3)
xtrabackup/test/kewpie/randgen/conf/optimizer/optimizer_access_exp.yy (+0/-411)
xtrabackup/test/kewpie/randgen/conf/optimizer/optimizer_no_subquery.yy (+0/-452)
xtrabackup/test/kewpie/randgen/conf/optimizer/optimizer_no_subquery_portable.yy (+0/-421)
xtrabackup/test/kewpie/randgen/conf/optimizer/optimizer_subquery.yy (+0/-812)
xtrabackup/test/kewpie/randgen/conf/optimizer/optimizer_subquery_no_outer_join.yy (+0/-800)
xtrabackup/test/kewpie/randgen/conf/optimizer/optimizer_subquery_portable.yy (+0/-770)
xtrabackup/test/kewpie/randgen/conf/optimizer/optimizer_subquery_semijoin.yy (+0/-852)
xtrabackup/test/kewpie/randgen/conf/optimizer/outer_join.yy (+0/-277)
xtrabackup/test/kewpie/randgen/conf/optimizer/outer_join.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/optimizer/outer_join_portable.yy (+0/-340)
xtrabackup/test/kewpie/randgen/conf/optimizer/range_access.ff (+0/-3)
xtrabackup/test/kewpie/randgen/conf/optimizer/range_access.yy (+0/-396)
xtrabackup/test/kewpie/randgen/conf/optimizer/range_access.zz (+0/-34)
xtrabackup/test/kewpie/randgen/conf/optimizer/range_access2.yy (+0/-149)
xtrabackup/test/kewpie/randgen/conf/optimizer/range_access2.zz (+0/-15)
xtrabackup/test/kewpie/randgen/conf/optimizer/semijoin.ff (+0/-3)
xtrabackup/test/kewpie/randgen/conf/optimizer/sort_union-index_merge.ff (+0/-7)
xtrabackup/test/kewpie/randgen/conf/optimizer/updateable_views.init (+0/-19)
xtrabackup/test/kewpie/randgen/conf/optimizer/updateable_views.yy (+0/-144)
xtrabackup/test/kewpie/randgen/conf/optimizer/virtual_columns.yy (+0/-394)
xtrabackup/test/kewpie/randgen/conf/optimizer/world.sql (+0/-28)
xtrabackup/test/kewpie/randgen/conf/oqgraph/oqgraph.init (+0/-2)
xtrabackup/test/kewpie/randgen/conf/oqgraph/oqgraph.yy (+0/-83)
xtrabackup/test/kewpie/randgen/conf/oqgraph/osm2oqg.pl (+0/-30)
xtrabackup/test/kewpie/randgen/conf/osm/LICENCE (+0/-63)
xtrabackup/test/kewpie/randgen/conf/osm/andorra.sql (+0/-158)
xtrabackup/test/kewpie/randgen/conf/osm/osm-schema.sql (+0/-30)
xtrabackup/test/kewpie/randgen/conf/partitioning/partition_pruning.yy (+0/-378)
xtrabackup/test/kewpie/randgen/conf/partitioning/partition_pruning.zz (+0/-210)
xtrabackup/test/kewpie/randgen/conf/partitioning/partitions-ddl.yy (+0/-219)
xtrabackup/test/kewpie/randgen/conf/partitioning/partitions-wl4571.yy (+0/-201)
xtrabackup/test/kewpie/randgen/conf/partitioning/partitions.yy (+0/-355)
xtrabackup/test/kewpie/randgen/conf/partitioning/partitions_procedures_triggers.yy (+0/-101)
xtrabackup/test/kewpie/randgen/conf/partitioning/partitions_redefine.yy (+0/-68)
xtrabackup/test/kewpie/randgen/conf/percona/bug826632.zz (+0/-41)
xtrabackup/test/kewpie/randgen/conf/percona/bug892274.yy (+0/-225)
xtrabackup/test/kewpie/randgen/conf/percona/innodb_dict_size_limit.yy (+0/-230)
xtrabackup/test/kewpie/randgen/conf/percona/innodb_dict_size_limit.zz (+0/-41)
xtrabackup/test/kewpie/randgen/conf/percona/many_indexes_percona.yy (+0/-55)
xtrabackup/test/kewpie/randgen/conf/percona/many_indexes_percona.zz (+0/-32)
xtrabackup/test/kewpie/randgen/conf/percona/mv.py (+0/-8)
xtrabackup/test/kewpie/randgen/conf/percona/optimizer_subquery_percona.yy (+0/-802)
xtrabackup/test/kewpie/randgen/conf/percona/outer_join_percona.yy (+0/-273)
xtrabackup/test/kewpie/randgen/conf/percona/outer_join_percona.zz (+0/-33)
xtrabackup/test/kewpie/randgen/conf/percona/percona.zz (+0/-44)
xtrabackup/test/kewpie/randgen/conf/percona/percona_no_blob.zz (+0/-43)
xtrabackup/test/kewpie/randgen/conf/percona/query_cache_strip_comments.yy (+0/-228)
xtrabackup/test/kewpie/randgen/conf/percona/query_cache_strip_comments.zz (+0/-41)
xtrabackup/test/kewpie/randgen/conf/percona/translog_concurrent1.yy (+0/-225)
xtrabackup/test/kewpie/randgen/conf/percona/translog_concurrent2.yy (+0/-219)
xtrabackup/test/kewpie/randgen/conf/percona/translog_concurrent3.yy (+0/-240)
xtrabackup/test/kewpie/randgen/conf/percona/translog_percona.zz (+0/-44)
xtrabackup/test/kewpie/randgen/conf/percona/trx_crash_commit_after.yy (+0/-246)
xtrabackup/test/kewpie/randgen/conf/percona/trx_crash_commit_after_log.yy (+0/-246)
xtrabackup/test/kewpie/randgen/conf/percona/trx_crash_commit_after_prepare.yy (+0/-246)
xtrabackup/test/kewpie/randgen/conf/percona/trx_crash_commit_before.yy (+0/-246)
xtrabackup/test/kewpie/randgen/conf/percona/trx_crash_commit_before_unlog.yy (+0/-246)
xtrabackup/test/kewpie/randgen/conf/percona/trx_half_binlogged_transaction.yy (+0/-246)
xtrabackup/test/kewpie/randgen/conf/percona/trx_randDebugCrash.yy (+0/-253)
xtrabackup/test/kewpie/randgen/conf/replication/WL5092_data.zz (+0/-93)
xtrabackup/test/kewpie/randgen/conf/replication/WL5092_sql_1.yy (+0/-107)
xtrabackup/test/kewpie/randgen/conf/replication/WL5092_sql_2.yy (+0/-1215)
xtrabackup/test/kewpie/randgen/conf/replication/add_flushes.rr (+0/-8)
xtrabackup/test/kewpie/randgen/conf/replication/binlog_group_commit.cc (+0/-80)
xtrabackup/test/kewpie/randgen/conf/replication/insert_errors.rr (+0/-19)
xtrabackup/test/kewpie/randgen/conf/replication/replication-5.1.zz (+0/-38)
xtrabackup/test/kewpie/randgen/conf/replication/replication-6.0.zz (+0/-38)
xtrabackup/test/kewpie/randgen/conf/replication/replication-ddl_data.zz (+0/-93)
xtrabackup/test/kewpie/randgen/conf/replication/replication-ddl_sql.yy (+0/-1117)
xtrabackup/test/kewpie/randgen/conf/replication/replication-dml_data.zz (+0/-75)
xtrabackup/test/kewpie/randgen/conf/replication/replication-dml_sql.yy (+0/-619)
xtrabackup/test/kewpie/randgen/conf/replication/replication.yy (+0/-150)
xtrabackup/test/kewpie/randgen/conf/replication/replication_innodb_myisam.zz (+0/-43)
xtrabackup/test/kewpie/randgen/conf/replication/replication_simple.yy (+0/-35)
xtrabackup/test/kewpie/randgen/conf/replication/replication_single_engine.zz (+0/-37)
xtrabackup/test/kewpie/randgen/conf/replication/replication_single_engine_pk.zz (+0/-37)
xtrabackup/test/kewpie/randgen/conf/replication/rpl_transactions.yy (+0/-136)
xtrabackup/test/kewpie/randgen/conf/replication/rpl_transactions.zz (+0/-33)
xtrabackup/test/kewpie/randgen/conf/replication/rpl_transactions_nopk.zz (+0/-33)
xtrabackup/test/kewpie/randgen/conf/runtime/WL5004_data.zz (+0/-50)
xtrabackup/test/kewpie/randgen/conf/runtime/WL5004_sql.yy (+0/-1718)
xtrabackup/test/kewpie/randgen/conf/runtime/WL5004_sql_custom.yy (+0/-1734)
xtrabackup/test/kewpie/randgen/conf/runtime/connect_kill_data.zz (+0/-49)
xtrabackup/test/kewpie/randgen/conf/runtime/connect_kill_sql.yy (+0/-1409)
xtrabackup/test/kewpie/randgen/conf/runtime/create_drop.yy (+0/-49)
xtrabackup/test/kewpie/randgen/conf/runtime/information_schema.yy (+0/-334)
xtrabackup/test/kewpie/randgen/conf/runtime/metadata_locking.cc (+0/-86)
xtrabackup/test/kewpie/randgen/conf/runtime/metadata_stability.yy (+0/-192)
xtrabackup/test/kewpie/randgen/conf/runtime/metadata_stability.zz (+0/-38)
xtrabackup/test/kewpie/randgen/conf/runtime/performance_schema.yy (+0/-358)
xtrabackup/test/kewpie/randgen/conf/runtime/signal_resignal.yy (+0/-302)
xtrabackup/test/kewpie/randgen/conf/smf/LICENSE (+0/-12)
xtrabackup/test/kewpie/randgen/conf/smf/parse.pl (+0/-130)
xtrabackup/test/kewpie/randgen/conf/smf/smf2.sql (+0/-128)
xtrabackup/test/kewpie/randgen/conf/smf/smf2.yy (+0/-4563)
xtrabackup/test/kewpie/randgen/conf/temporal/temporal_functions.yy (+0/-262)
xtrabackup/test/kewpie/randgen/conf/temporal/temporal_functions.zz (+0/-35)
xtrabackup/test/kewpie/randgen/conf/temporal/temporal_ranges.yy (+0/-123)
xtrabackup/test/kewpie/randgen/conf/temporal/temporal_ranges.zz (+0/-20)
xtrabackup/test/kewpie/randgen/conf/temporal/temporal_replication.yy (+0/-270)
xtrabackup/test/kewpie/randgen/conf/transactions/combinations.yy (+0/-67)
xtrabackup/test/kewpie/randgen/conf/transactions/combinations.zz (+0/-35)
xtrabackup/test/kewpie/randgen/conf/transactions/repeatable_read.yy (+0/-44)
xtrabackup/test/kewpie/randgen/conf/transactions/transaction_durability.yy (+0/-56)
xtrabackup/test/kewpie/randgen/conf/transactions/transactions-flat.yy (+0/-163)
xtrabackup/test/kewpie/randgen/conf/transactions/transactions.yy (+0/-141)
xtrabackup/test/kewpie/randgen/conf/transactions/transactions.zz (+0/-30)
xtrabackup/test/kewpie/randgen/dict/english.txt (+0/-100)
xtrabackup/test/kewpie/randgen/dict/states.txt (+0/-50)
xtrabackup/test/kewpie/randgen/error.log (+0/-24)
xtrabackup/test/kewpie/randgen/gendata-old.pl (+0/-70)
xtrabackup/test/kewpie/randgen/gendata.pl (+0/-95)
xtrabackup/test/kewpie/randgen/gengrammar.pl (+0/-70)
xtrabackup/test/kewpie/randgen/gensql.pl (+0/-118)
xtrabackup/test/kewpie/randgen/gentest.pl (+0/-282)
xtrabackup/test/kewpie/randgen/init/all_off.sql (+0/-20)
xtrabackup/test/kewpie/randgen/init/mrr_no_opt.sql (+0/-19)
xtrabackup/test/kewpie/randgen/init/mrr_opt.sql (+0/-19)
xtrabackup/test/kewpie/randgen/init/no_materialization.sql (+0/-18)
xtrabackup/test/kewpie/randgen/init/no_mrr.opt (+0/-19)
xtrabackup/test/kewpie/randgen/init/no_mrr_no_opt.sql (+0/-19)
xtrabackup/test/kewpie/randgen/init/no_mrr_opt.sql (+0/-20)
xtrabackup/test/kewpie/randgen/init/no_semijoin.sql (+0/-18)
xtrabackup/test/kewpie/randgen/init/no_subquery.sql (+0/-18)
xtrabackup/test/kewpie/randgen/lib/DBServer/DBServer.pm (+0/-204)
xtrabackup/test/kewpie/randgen/lib/DBServer/MySQL/MySQLd.pm (+0/-638)
xtrabackup/test/kewpie/randgen/lib/DBServer/MySQL/ReplMySQLd.pm (+0/-220)
xtrabackup/test/kewpie/randgen/lib/GenTest.pm (+0/-251)
xtrabackup/test/kewpie/randgen/lib/GenTest/App/GenTest.pm (+0/-642)
xtrabackup/test/kewpie/randgen/lib/GenTest/App/Gendata.pm (+0/-627)
xtrabackup/test/kewpie/randgen/lib/GenTest/App/GendataSimple.pm (+0/-317)
xtrabackup/test/kewpie/randgen/lib/GenTest/BzrInfo.pm (+0/-188)
xtrabackup/test/kewpie/randgen/lib/GenTest/Comparator.pm (+0/-100)
xtrabackup/test/kewpie/randgen/lib/GenTest/Constants.pm (+0/-176)
xtrabackup/test/kewpie/randgen/lib/GenTest/ErrorFilter.pm (+0/-57)
xtrabackup/test/kewpie/randgen/lib/GenTest/Executor.pm (+0/-439)
xtrabackup/test/kewpie/randgen/lib/GenTest/Executor/Drizzle.pm (+0/-588)
xtrabackup/test/kewpie/randgen/lib/GenTest/Executor/Dummy.pm (+0/-121)
xtrabackup/test/kewpie/randgen/lib/GenTest/Executor/JavaDB.pm (+0/-318)
xtrabackup/test/kewpie/randgen/lib/GenTest/Executor/MySQL.pm (+0/-948)
xtrabackup/test/kewpie/randgen/lib/GenTest/Executor/MySQLPrepared.pm (+0/-49)
xtrabackup/test/kewpie/randgen/lib/GenTest/Executor/Postgres.pm (+0/-281)
xtrabackup/test/kewpie/randgen/lib/GenTest/Explain.pm (+0/-47)
xtrabackup/test/kewpie/randgen/lib/GenTest/Filter/Regexp.pm (+0/-100)
xtrabackup/test/kewpie/randgen/lib/GenTest/Generator.pm (+0/-114)
xtrabackup/test/kewpie/randgen/lib/GenTest/Generator/FromCSV.pm (+0/-78)
xtrabackup/test/kewpie/randgen/lib/GenTest/Generator/FromDirectory.pm (+0/-58)
xtrabackup/test/kewpie/randgen/lib/GenTest/Generator/FromGrammar.pm (+0/-366)
xtrabackup/test/kewpie/randgen/lib/GenTest/Grammar.pm (+0/-391)
xtrabackup/test/kewpie/randgen/lib/GenTest/Grammar/Rule.pm (+0/-66)
xtrabackup/test/kewpie/randgen/lib/GenTest/IPC/Channel.pm (+0/-143)
xtrabackup/test/kewpie/randgen/lib/GenTest/IPC/Process.pm (+0/-133)
xtrabackup/test/kewpie/randgen/lib/GenTest/Incident.pm (+0/-122)
xtrabackup/test/kewpie/randgen/lib/GenTest/Mixer.pm (+0/-219)
xtrabackup/test/kewpie/randgen/lib/GenTest/Properties.pm (+0/-353)
xtrabackup/test/kewpie/randgen/lib/GenTest/QueryPerformance.pm (+0/-101)
xtrabackup/test/kewpie/randgen/lib/GenTest/QueryPerformanceDelta.pm (+0/-220)
xtrabackup/test/kewpie/randgen/lib/GenTest/Random.pm (+0/-509)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter.pm (+0/-205)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/AriaDoubleRecovery.pm (+0/-166)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/Backtrace.pm (+0/-115)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/BackupAndRestore.pm (+0/-73)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/BackupAndRestoreInvariant.pm (+0/-230)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/BackupInterop.pm (+0/-137)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/BinlogCommitStats.pm (+0/-36)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/CloneSlave.pm (+0/-254)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/CloneSlaveXtrabackup.pm (+0/-273)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DatabaseConsistency.pm (+0/-182)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/Deadlock.pm (+0/-250)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DrizzleInnoTrxLog.pm (+0/-175)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DrizzleInnoTrxLogCrashRecovery.pm (+0/-270)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DrizzleRecovery.pm (+0/-341)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DrizzleRecoveryConsistency.pm (+0/-145)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DrizzleSlavePlugin.pm (+0/-173)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DrizzleSlavePluginCrashRecover.pm (+0/-265)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/DrizzleTransactionLog.pm (+0/-172)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ErrorLog.pm (+0/-58)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ErrorLogAlarm.pm (+0/-94)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/LockTableKiller.pm (+0/-70)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/MemoryUsage.pm (+0/-54)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/MySQLClient.pm (+0/-41)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/QueryTimeout.pm (+0/-87)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/Recovery.pm (+0/-397)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/RecoveryConsistency.pm (+0/-121)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ReplicationAnalyzeTable.pm (+0/-56)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ReplicationConnectionKiller.pm (+0/-79)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ReplicationConsistency.pm (+0/-112)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ReplicationLogFlusher.pm (+0/-44)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ReplicationSemiSync.pm (+0/-237)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ReplicationThreadRestarter.pm (+0/-68)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/Shutdown.pm (+0/-83)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ValgrindErrors.pm (+0/-125)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/ValgrindXMLErrors.pm (+0/-63)
xtrabackup/test/kewpie/randgen/lib/GenTest/Reporter/WinPackage.pm (+0/-51)
xtrabackup/test/kewpie/randgen/lib/GenTest/ReporterManager.pm (+0/-90)
xtrabackup/test/kewpie/randgen/lib/GenTest/Result.pm (+0/-154)
xtrabackup/test/kewpie/randgen/lib/GenTest/SimPipe/DBObject.pm (+0/-218)
xtrabackup/test/kewpie/randgen/lib/GenTest/SimPipe/Oracle.pm (+0/-55)
xtrabackup/test/kewpie/randgen/lib/GenTest/SimPipe/Oracle/Crash.pm (+0/-89)
xtrabackup/test/kewpie/randgen/lib/GenTest/SimPipe/Oracle/FullScan.pm (+0/-128)
xtrabackup/test/kewpie/randgen/lib/GenTest/SimPipe/Oracle/TwiceSporadic.pm (+0/-83)
xtrabackup/test/kewpie/randgen/lib/GenTest/SimPipe/Testcase.pm (+0/-325)
xtrabackup/test/kewpie/randgen/lib/GenTest/Simplifier/Grammar.pm (+0/-165)
xtrabackup/test/kewpie/randgen/lib/GenTest/Simplifier/Mysqltest.pm (+0/-246)
xtrabackup/test/kewpie/randgen/lib/GenTest/Simplifier/SQL.pm (+0/-196)
xtrabackup/test/kewpie/randgen/lib/GenTest/Simplifier/Tables.pm (+0/-123)
xtrabackup/test/kewpie/randgen/lib/GenTest/Simplifier/Test.pm (+0/-302)
xtrabackup/test/kewpie/randgen/lib/GenTest/Stack/Stack.pm (+0/-83)
xtrabackup/test/kewpie/randgen/lib/GenTest/Stack/StackFrame.pm (+0/-42)
xtrabackup/test/kewpie/randgen/lib/GenTest/Statement.pm (+0/-20)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform.pm (+0/-389)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ChangePartialMatch.pm (+0/-71)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ConvertLiteralsToDyncols.pm (+0/-76)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ConvertLiteralsToSubqueries.pm (+0/-98)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ConvertLiteralsToVariables.pm (+0/-63)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ConvertSubqueriesToViews.pm (+0/-70)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ConvertTablesToDerived.pm (+0/-65)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ConvertTablesToViews.pm (+0/-39)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/Count.pm (+0/-65)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/DisableChosenPlan.pm (+0/-126)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/DisableIndexes.pm (+0/-47)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/DisableJoinCache.pm (+0/-92)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/Distinct.pm (+0/-47)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/DrizzleExecuteString.pm (+0/-40)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/DrizzleExecuteVariable.pm (+0/-41)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/Dummy.pm (+0/-33)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsDerived.pm (+0/-38)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsFunctionTwice.pm (+0/-57)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsInsertSelect.pm (+0/-55)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsPreparedOnce.pm (+0/-44)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsPreparedTwice.pm (+0/-45)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsSPTwice.pm (+0/-44)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsSelectItem.pm (+0/-44)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsTrigger.pm (+0/-43)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsUnion.pm (+0/-44)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsUpdateDelete.pm (+0/-83)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsView.pm (+0/-50)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/ExecuteAsWhereSubquery.pm (+0/-57)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/FromSubquery.pm (+0/-38)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/Having.pm (+0/-46)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/InlineSubqueries.pm (+0/-79)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/InlineVirtualColumns.pm (+0/-61)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/LimitDecrease.pm (+0/-49)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/LimitIncrease.pm (+0/-42)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/OrderBy.pm (+0/-71)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/RemoveIndexHints.pm (+0/-24)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/SelectOption.pm (+0/-47)
xtrabackup/test/kewpie/randgen/lib/GenTest/Transform/StraightJoin.pm (+0/-50)
xtrabackup/test/kewpie/randgen/lib/GenTest/Translator.pm (+0/-40)
xtrabackup/test/kewpie/randgen/lib/GenTest/Translator/MysqlDML2ANSI.pm (+0/-171)
xtrabackup/test/kewpie/randgen/lib/GenTest/Translator/MysqlDML2javadb.pm (+0/-41)
xtrabackup/test/kewpie/randgen/lib/GenTest/Translator/MysqlDML2pgsql.pm (+0/-40)
xtrabackup/test/kewpie/randgen/lib/GenTest/Translator/Mysqldump2ANSI.pm (+0/-162)
xtrabackup/test/kewpie/randgen/lib/GenTest/Translator/Mysqldump2javadb.pm (+0/-33)
xtrabackup/test/kewpie/randgen/lib/GenTest/Translator/Mysqldump2pgsql.pm (+0/-40)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator.pm (+0/-54)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/AbortOnSyntaxError.pm (+0/-42)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/DML.pm (+0/-83)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/DatabaseComparator.pm (+0/-67)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/DatabaseConsistency.pm (+0/-71)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/DrizzleErrorLogScan.pm (+0/-60)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/DrizzleTransformer.pm (+0/-104)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/Drizzledump.pm (+0/-149)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/DrizzledumpMigrate.pm (+0/-145)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ErrorMessageCorruption.pm (+0/-51)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ExecutionTimeComparator.pm (+0/-601)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ExplainMatch.pm (+0/-63)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ExplicitRollback.pm (+0/-56)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/Falcon.pm (+0/-81)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/FalconErrors.pm (+0/-77)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/Invariant.pm (+0/-133)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/Limit.pm (+0/-67)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/MarkErrorLog.pm (+0/-63)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/OptimizerTraceParser.pm (+0/-199)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/OrderBy.pm (+0/-66)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/Performance.pm (+0/-115)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/QueryProperties.pm (+0/-157)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/RepeatableRead.pm (+0/-82)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ReplicationSlaveStatus.pm (+0/-76)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ReplicationWaitForSlave.pm (+0/-69)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparator.pm (+0/-81)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparator3.pm (+0/-144)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparator3Simplify.pm (+0/-224)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparatorGIS.pm (+0/-117)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ResultsetComparatorSimplify.pm (+0/-179)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/ResultsetCorruption.pm (+0/-53)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/SelectStability.pm (+0/-56)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/Transformer.pm (+0/-292)
xtrabackup/test/kewpie/randgen/lib/GenTest/Validator/Transformer2.pm (+0/-179)
xtrabackup/test/kewpie/randgen/lib/GenTest/XML/BuildInfo.pm (+0/-221)
xtrabackup/test/kewpie/randgen/lib/GenTest/XML/Environment.pm (+0/-403)
xtrabackup/test/kewpie/randgen/lib/GenTest/XML/Report.pm (+0/-116)
xtrabackup/test/kewpie/randgen/lib/GenTest/XML/Test.pm (+0/-135)
xtrabackup/test/kewpie/randgen/lib/GenTest/XML/Transporter.pm (+0/-202)
xtrabackup/test/kewpie/randgen/pb2combinations.pl (+0/-272)
xtrabackup/test/kewpie/randgen/pb2gentest-new.pl (+0/-1196)
xtrabackup/test/kewpie/randgen/pb2gentest.pl (+0/-1195)
xtrabackup/test/kewpie/randgen/pb2runtest.pl (+0/-448)
xtrabackup/test/kewpie/randgen/performance/perfreport.pl (+0/-62)
xtrabackup/test/kewpie/randgen/performance/perfrun.pl (+0/-128)
xtrabackup/test/kewpie/randgen/runall-new.pl (+0/-597)
xtrabackup/test/kewpie/randgen/runall.pl (+0/-556)
xtrabackup/test/kewpie/randgen/server.pl (+0/-311)
xtrabackup/test/kewpie/randgen/simpipe-crash.pl (+0/-38)
xtrabackup/test/kewpie/randgen/simpipe-fullscan.pl (+0/-37)
xtrabackup/test/kewpie/randgen/simpipe.pl (+0/-36)
xtrabackup/test/kewpie/randgen/simplify-grammar_template.cfg (+0/-163)
xtrabackup/test/kewpie/randgen/simplify-mysqltest_template-huge.cfg (+0/-85)
xtrabackup/test/kewpie/randgen/simplify-mysqltest_template.cfg (+0/-165)
xtrabackup/test/kewpie/randgen/t/constant.t (+0/-26)
xtrabackup/test/kewpie/randgen/t/gensql.t (+0/-33)
xtrabackup/test/kewpie/randgen/t/gensql.yy (+0/-20)
xtrabackup/test/kewpie/randgen/t/gentest.t (+0/-26)
xtrabackup/test/kewpie/randgen/t/grammar-doubledefine.t.disabled (+0/-42)
xtrabackup/test/kewpie/randgen/t/grammar-doubledefine.yy (+0/-22)
xtrabackup/test/kewpie/randgen/t/grammar.t (+0/-113)
xtrabackup/test/kewpie/randgen/t/prng.t (+0/-39)
xtrabackup/test/kewpie/randgen/t/simplify-empty.t (+0/-61)
xtrabackup/test/kewpie/randgen/t/simplify-empty.yy (+0/-36)
xtrabackup/test/kewpie/randgen/t/simplify-grammar.t (+0/-72)
xtrabackup/test/kewpie/randgen/t/simplify-grammar.yy (+0/-62)
xtrabackup/test/kewpie/randgen/t/test.bat (+0/-23)
xtrabackup/test/kewpie/randgen/translateMysql.pl (+0/-80)
xtrabackup/test/kewpie/randgen/unit/DBDVersion.pm (+0/-56)
xtrabackup/test/kewpie/randgen/unit/ExecutorTest.pm (+0/-63)
xtrabackup/test/kewpie/randgen/unit/FromGrammarTest.pm (+0/-60)
xtrabackup/test/kewpie/randgen/unit/GendataTest.pm (+0/-85)
xtrabackup/test/kewpie/randgen/unit/GendataTest.zz (+0/-37)
xtrabackup/test/kewpie/randgen/unit/GrammarTest.pm (+0/-114)
xtrabackup/test/kewpie/randgen/unit/IPC.pm (+0/-97)
xtrabackup/test/kewpie/randgen/unit/IPC_P1.pm (+0/-53)
xtrabackup/test/kewpie/randgen/unit/Metadata.pm (+0/-71)
xtrabackup/test/kewpie/randgen/unit/ParseAllGrammars.pm (+0/-131)
xtrabackup/test/kewpie/randgen/unit/README (+0/-16)
xtrabackup/test/kewpie/randgen/unit/RQGRunner.pm (+0/-291)
xtrabackup/test/kewpie/randgen/unit/RandomTest.pm (+0/-58)
xtrabackup/test/kewpie/randgen/unit/Suite.pm (+0/-41)
xtrabackup/test/kewpie/randgen/unit/TestMySQLServer.pm (+0/-171)
xtrabackup/test/kewpie/randgen/unit/TestReplServer.pm (+0/-141)
xtrabackup/test/kewpie/randgen/unit/TestScripts.pm (+0/-217)
xtrabackup/test/kewpie/randgen/unit/TestSqltrace.pm (+0/-294)
xtrabackup/test/kewpie/randgen/unit/TestTT.pm (+0/-70)
xtrabackup/test/kewpie/randgen/unit/exit_status.cc (+0/-17)
xtrabackup/test/kewpie/randgen/unit/test.cc (+0/-31)
xtrabackup/test/kewpie/randgen/unit/testGrammar.yy (+0/-23)
xtrabackup/test/kewpie/randgen/unit/testSqltrace.yy (+0/-35)
xtrabackup/test/kewpie/randgen/unit/testStack.yy (+0/-38)
xtrabackup/test/kewpie/randgen/unit/unit.pl (+0/-44)
xtrabackup/test/kewpie/randgen/util/bughunt.pl (+0/-275)
xtrabackup/test/kewpie/randgen/util/dump-test.pl (+0/-65)
xtrabackup/test/kewpie/randgen/util/mask-grammar.pl (+0/-70)
xtrabackup/test/kewpie/randgen/util/simplify-crash.pl (+0/-127)
xtrabackup/test/kewpie/randgen/util/simplify-grammar.pl (+0/-253)
xtrabackup/test/kewpie/randgen/util/simplify-mysqltest.pl (+0/-277)
xtrabackup/test/kewpie/randgen/util/simplify-query-performance.pl (+0/-121)
xtrabackup/test/kewpie/randgen/util/simplify-query.pl (+0/-109)
xtrabackup/test/kewpie/randgen/util/simplify-sporadic.pl (+0/-59)
xtrabackup/test/t/bug723318.sh (+0/-26)
xtrabackup/utils/build.sh (+0/-380)
Contents conflict in storage/innobase/xtrabackup/Makefile
Text conflict in storage/innobase/xtrabackup/test/run.sh
Text conflict in storage/innobase/xtrabackup/utils/build-dpkg.sh
Text conflict in storage/innobase/xtrabackup/utils/xtrabackup.spec
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/single-binary
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Needs Fixing
Alexey Kopytov (community) Approve
Review via email: mp+196853@code.launchpad.net

Description of the change

    Implementation of
    https://blueprints.launchpad.net/percona-xtrabackup/+spec/single-binary

    The goals were to:

    1. Get rid of multiple xtrabackup binaries (xtrabackup, xtrabackup_55,
    xtrabackup_56, etc.)
    2. Make the XtraBackup source tree self-contained (without having to
    download server source tarballs).
    3. Get rid of patches.

    This obviously required a lot of small changes all over the source tree,
    here’s a description of the major ones:

    - merged patches/innodb56.patch to the server tree (currently based on
      5.6.11, will be rebased as a separate step);

    - merged relevant bits from XtraDB 5.1 and 5.5 to be able to backup
      PS 5.1 and 5.5 with a MySQL 5.6-based binary

    - cleaned up the code, removed tons of #ifdef
      XTRADB55/XTRADB_BASED/MYSQL_VERSION_ID, which are no longer necessary
      as we are building from a single tree;

    - moved the xtrabackup subdirectory to storage/innobase/xtrabackup. This
      was the only reliable way I could find to automatically inherit InnoDB
      compiler flags;

    - kewpie is gone (unmaintained, wouldn’t work with single binary anyway)

    - build.sh is gone (one can use regular cmake commands to build in
      various configurations)

    - AUTO_DOWNLOAD is gone

    - insane hand-written Makefiles to support all kinds of tricks to build
      with external tarballs + patches are gone

    - run.sh -c does not have any effect (but is still supported for Jenkins
      compatibility)

    - innobackupex-1.5.1 symlink is gone

    What needs further work:

    - packaging scripts are likely broken. Should be modified to use “make
      install” (short-term), and replaced with CPack (long-term)

    - documentation still uses its own build system (and thus is not
      installed on “make install”)

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.2-param/59/

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

xb_parallel_incremental failures are bug #1203669 / http://bugs.mysql.com/bug.php?id=69780

Will be fixed as a followup MP rebasing 2.2 on MySQL 5.6.14.

Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

    - An XtraDB-based (as opposed to InnoDB-based) single binary
      would have removed a big chunk of code from
      changed_page_bitmap.cc too.

    - Consider adding a note to BUILD.XtraBackup.txt on what CMake
      options to specify for debug builds. For example, my intuition
      was -DBUILD_CONFIG=xtrabackup_release -DWITH_DEBUG=ON (or
      -DCMAKE_BUILD_TYPE=Debug), but Jenkins uses plain
      -DWITH_DEBUG=ON without -DBUILD_CONFIG=xtrabackup_release.

    - GET_XTRABACKUP_VERSION CMake macro will fail getting bzr revno
      from a non-bzr source tree (i.e. source .tar.gz). This might be
      outside of the scope of current MP though.

    - innobackupex still appears to write $xtrabackup_binary_file
      (grep by this variable). This file is also mentioned, besides
      the docs that are to be handled later, in the innobackupex help
      (is that part of the code or of the docs?)

        =item --ibbackup=IBBACKUP-BINARY

        [...] If this option is not specified, innobackupex attempts
        to determine the binary to use automatically. By default,
        "xtrabackup" is the command used. However, when option
        --copy-back is specified, "xtrabackup_51" is the command
        used. And when option --apply-log is specified, the binary
        is used whose name is in the file "xtrabackup_binary" in the
        backup directory, if that file exists.

    - check_if_skip_table() can be simplified to remove the handling
      of the "./database/name.ibd" tablespace name format, and handle
      the "database/name" case only. (Likewise some body comments in
      xtrabackup_copy_datafile() may be simplified to refer to the
      5.6+ format only.)

    - open_or_create_log_file() has an identical declaration with a
      removed-in-5.6 InnoDB function. It does not have to be
      identical anymore, thus all the UT_NOT_USED args may go away
      (create_new_db, log_file_has_been_opened, and k).

    - xb_apply_archived_logs.sh became a no-op?

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote :
Download full text (3.3 KiB)

> - An XtraDB-based (as opposed to InnoDB-based) single binary
> would have removed a big chunk of code from
> changed_page_bitmap.cc too.
>

Sure, but basing the “single binary” binary on upstream 5.6 rather than
PS 5.6 is a deliberate decision. As you know, some folks would
appreciate an upstream-based XtraBackup patch.

So even though basing on XtraDB would avoid some code duplication to
implement Percona Server backups, having a truly single codebase
to manage is more preferable.

> - Consider adding a note to BUILD.XtraBackup.txt on what CMake
> options to specify for debug builds. For example, my intuition
> was -DBUILD_CONFIG=xtrabackup_release -DWITH_DEBUG=ON (or
> -DCMAKE_BUILD_TYPE=Debug), but Jenkins uses plain
> -DWITH_DEBUG=ON without -DBUILD_CONFIG=xtrabackup_release.
>

I don’t quite understand what -DBUILD_CONFIG=xtrabackup_release
-DWITH_DEBUG=ON is even supposed to mean. “We want a release binary,
except that we want a debug binary instead?”.

> - GET_XTRABACKUP_VERSION CMake macro will fail getting bzr revno
> from a non-bzr source tree (i.e. source .tar.gz). This might be
> outside of the scope of current MP though.
>

It is the same for the server tree. If you don’t have a Bzr tree, you
don’t get a revision number. In which case GET_XTRABACKUP_VERSION() will
just leave it undefined. But no, it will not fail the entire build.

> - innobackupex still appears to write $xtrabackup_binary_file
> (grep by this variable). This file is also mentioned, besides
> the docs that are to be handled later, in the innobackupex help
> (is that part of the code or of the docs?)
>

Oh, that appears to have lost in rebasing. Thanks for catching
this. Reported as bug #1268300.

> =item --ibbackup=IBBACKUP-BINARY
>
> [...] If this option is not specified, innobackupex attempts
> to determine the binary to use automatically. By default,
> "xtrabackup" is the command used. However, when option
> --copy-back is specified, "xtrabackup_51" is the command
> used. And when option --apply-log is specified, the binary
> is used whose name is in the file "xtrabackup_binary" in the
> backup directory, if that file exists.
>

That will be covered in the doc changes. There are many more bits in
both the manual and the built-in help text that need adjusting.

> - check_if_skip_table() can be simplified to remove the handling
> of the "./database/name.ibd" tablespace name format, and handle
> the "database/name" case only. (Likewise some body comments in
> xtrabackup_copy_datafile() may be simplified to refer to the
> 5.6+ format only.)
>
> - open_or_create_log_file() has an identical declaration with a
> removed-in-5.6 InnoDB function. It does not have to be
> identical anymore, thus all the UT_NOT_USED args may go away
> (create_new_db, log_file_has_been_opened, and k).
>

Yes, but those are non-functional changes. The goal of this MP was to
have something runnable in Jenkins. I had to resist the urge to
implement further refactoring, simplificati...

Read more...

Revision history for this message
Stewart Smith (stewart) wrote :

Alexey Kopytov <email address hidden> writes:
>> - GET_XTRABACKUP_VERSION CMake macro will fail getting bzr revno
>> from a non-bzr source tree (i.e. source .tar.gz). This might be
>> outside of the scope of current MP though.
>>
>
> It is the same for the server tree. If you don’t have a Bzr tree, you
> don’t get a revision number. In which case GET_XTRABACKUP_VERSION() will
> just leave it undefined. But no, it will not fail the entire build.

For releases, since things will be built out of a source tarball rather
than a bzr tree, we should do something like create a REVNO file and get
the revno out of it if it exists if not in a bzr branch.

--
Stewart Smith

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

>> - An XtraDB-based (as opposed to InnoDB-based) single binary
>> would have removed a big chunk of code from
>> changed_page_bitmap.cc too.
>>
>
> Sure, but basing the “single binary” binary on upstream 5.6 rather than
> PS 5.6 is a deliberate decision. As you know, some folks would
> appreciate an upstream-based XtraBackup patch.
>
> So even though basing on XtraDB would avoid some code duplication to
> implement Percona Server backups, having a truly single codebase
> to manage is more preferable.

Right. Then let's remove the TODO note from changed_page_bitmap.cc
next time someone touches it.

>> - Consider adding a note to BUILD.XtraBackup.txt on what CMake
>> options to specify for debug builds. For example, my intuition
>> was -DBUILD_CONFIG=xtrabackup_release -DWITH_DEBUG=ON (or
>> -DCMAKE_BUILD_TYPE=Debug), but Jenkins uses plain
>> -DWITH_DEBUG=ON without -DBUILD_CONFIG=xtrabackup_release.
>>
>
> I don’t quite understand what -DBUILD_CONFIG=xtrabackup_release
> -DWITH_DEBUG=ON is even supposed to mean. “We want a release binary,
> except that we want a debug binary instead?”.

Well, there was no xtrabackup_debug build config, for better or worse
our Jenkins does -DBUILD_CONFIG=mysql_release -DWITH_DEBUG=ON for
servers. So IMHO while it's not too complicated, it's not immediately
obvious neither, and a note could help.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Hi Laurynas,

On Mon, Jan 13 2014 08:51:23 +0400, Laurynas Biveinis wrote:

[...]

>>> - Consider adding a note to BUILD.XtraBackup.txt on what CMake
>>> options to specify for debug builds. For example, my intuition
>>> was -DBUILD_CONFIG=xtrabackup_release -DWITH_DEBUG=ON (or
>>> -DCMAKE_BUILD_TYPE=Debug), but Jenkins uses plain
>>> -DWITH_DEBUG=ON without -DBUILD_CONFIG=xtrabackup_release.
>>>
>>
>> I don’t quite understand what -DBUILD_CONFIG=xtrabackup_release
>> -DWITH_DEBUG=ON is even supposed to mean. “We want a release binary,
>> except that we want a debug binary instead?”.
>
> Well, there was no xtrabackup_debug build config, for better or worse
> our Jenkins does -DBUILD_CONFIG=mysql_release -DWITH_DEBUG=ON for
> servers. So IMHO while it's not too complicated, it's not immediately
> obvious neither, and a note could help.

Well, there’s no -DBUILD_CONFIG=mysql_debug either. I don’t know where
that idea of using both -DBUILD_CONFIG=mysql_release and -DWITH_DEBUG=ON
came from.

--
Best regards,
Alexey.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2013-02-05 21:49:04 +0000
3+++ .bzrignore 2013-11-27 10:34:29 +0000
4@@ -3140,3 +3140,15 @@
5 storage/perfschema/pfs_lex_token.h
6 storage/perfschema/gen_pfs_lex_token
7 sql/share/bulgarian
8+./storage/innobase/xtrabackup/src/xbcrypt
9+./storage/innobase/xtrabackup/src/xbstream
10+./storage/innobase/xtrabackup/src/xtrabackup
11+./storage/innobase/xtrabackup/src/libarchive/cmake.tmp
12+./storage/innobase/xtrabackup/test/results
13+./storage/innobase/xtrabackup/test/test_results.subunit
14+./storage/innobase/xtrabackup/test/var
15+./storage/innobase/xtrabackup/src/libarchive/DartConfiguration.tcl
16+./storage/innobase/xtrabackup/innobackupex
17+./storage/innobase/xtrabackup/src/CMakeCache.txt
18+./storage/innobase/xtrabackup/src/xtrabackup_version.h
19+./storage/innobase/xtrabackup/CMakeCache.txt
20
21=== renamed file 'xtrabackup/BUILD.txt' => 'BUILD.XtraBackup.txt'
22--- xtrabackup/BUILD.txt 2013-06-19 08:48:19 +0000
23+++ BUILD.XtraBackup.txt 2013-11-27 10:34:29 +0000
24@@ -19,38 +19,23 @@
25 $ yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf bzr \
26 bison libtool ncurses5-devel
27
28-Compiling with build.sh
29------------------------
30-
31-Once you have all dependencies met, the compilation is straight-forward with
32-the bundled build.sh script in the utils/ directory of the distribution.
33-
34-The script needs the codebase for which the building is targeted, you must
35-provide it with one of the following values or aliases:
36-
37- ================== ========= =============================================
38- Value Alias Server
39- ================== ========= =============================================
40- innodb51 plugin build against InnoDB plugin in MySQL 5.1
41- innodb55 5.5 build against InnoDB in MySQL 5.5
42- xtradb51 xtradb build against Percona Server with XtraDB 5.1
43- xtradb55 xtradb55 build against Percona Server with XtraDB 5.5
44- innodb56 5.6 build against InnoDB in MySQL 5.6
45- ================== ========= =============================================
46-
47-Note that the script must be executed from the base directory of Xtrabackup
48-sources, and that directory must contain the packages with the source code of
49-the codebase selected. This may appear cumbersome, but if the variable
50-AUTO_DOWNLOAD="yes" is set, the build.sh script will download all the source
51-code needed for the build.
52-
53-At the base directory of the downloaded source code, if you execute
54-
55- $ AUTO_DOWNLOAD="yes" ./utils/build.sh xtradb
56+Compiling with CMake
57+--------------------
58+
59+At the base directory of the source code tree, if you execute
60+
61+ $ cmake -DBUILD_CONFIG=xtrabackup_release && make -j4
62
63 and you go for a coffee, at your return XtraBackup will be ready to be used.
64-The xtrabackup binary will located in the "percona-xtrabackup/src" subdirectory.
65-
66-After this you'll need to copy innobackupex and the corresponding xtrabackup
67-binary to some directory listed in the PATH environment variable, e.g. /usr/bin.
68-
69+
70+Installation
71+------------
72+
73+The following command:
74+
75+$ make install
76+
77+will install all XtraBackup binaries, the innobackupex script and tests
78+to /usr/local/xtrabackup. You can override this either with “make
79+DESTDIR=... install” or by changing the installation layout with “cmake
80+-DINSTALL_LAYOUT=...”.
81
82=== modified file 'CMakeLists.txt'
83--- CMakeLists.txt 2013-02-26 05:45:28 +0000
84+++ CMakeLists.txt 2013-11-27 10:34:29 +0000
85@@ -204,16 +204,30 @@
86 IF(DISABLE_SHARED)
87 SET(WITHOUT_DYNAMIC_PLUGINS 1)
88 ENDIF()
89-OPTION(ENABLED_PROFILING "Enable profiling" ON)
90+OPTION(ENABLED_PROFILING "Enable profiling" OFF)
91 OPTION(CYBOZU "" OFF)
92 OPTION(BACKUP_TEST "" OFF)
93 OPTION(WITHOUT_SERVER OFF)
94 IF(UNIX)
95 OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF)
96 ENDIF()
97-OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
98+OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" OFF)
99 MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
100
101+OPTION(WITH_XTRABACKUP "Build XtraBackup" ON)
102+# Disallow WITH_XTRABACKUP=OFF builds
103+IF(NOT WITH_XTRABACKUP)
104+ MESSAGE(FATAL_ERROR "This branch does not support -DWITH_XTRABACKUP=OFF configuration.")
105+ENDIF()
106+# Disallow WITHOUT_SERVER=ON builds
107+IF(WITHOUT_SERVER)
108+ MESSAGE(FATAL_ERROR "This branch does not support -DWITHOUT_SERVER=ON configuration.")
109+ENDIF()
110+# Disallow WITH_EMBEDDED_SERVER=OFF builds
111+IF(NOT WITH_EMBEDDED_SERVER)
112+ MESSAGE(FATAL_ERROR "This branch does not support -DWITH_EMBEDDED_SERVER=OFF configuration.")
113+ENDIF()
114+
115 OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
116 IF(ENABLE_DEBUG_SYNC)
117 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
118@@ -379,29 +393,16 @@
119
120 ADD_SUBDIRECTORY(extra)
121 IF(NOT WITHOUT_SERVER)
122- ADD_SUBDIRECTORY(tests)
123- ADD_SUBDIRECTORY(client)
124 ADD_SUBDIRECTORY(sql)
125 ADD_SUBDIRECTORY(sql/share)
126- ADD_SUBDIRECTORY(libservices)
127 OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
128 IF(WITH_EMBEDDED_SERVER)
129 ADD_SUBDIRECTORY(libmysqld)
130- ADD_SUBDIRECTORY(libmysqld/examples)
131 ENDIF(WITH_EMBEDDED_SERVER)
132
133- ADD_SUBDIRECTORY(mysql-test)
134- ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
135- ADD_SUBDIRECTORY(support-files)
136- ADD_SUBDIRECTORY(scripts)
137- ADD_SUBDIRECTORY(sql-bench)
138- IF(UNIX)
139- ADD_SUBDIRECTORY(man)
140- ENDIF()
141 IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
142 ADD_SUBDIRECTORY(internal)
143 ENDIF()
144- ADD_SUBDIRECTORY(packaging/rpm-uln)
145 ENDIF()
146
147 INCLUDE(cmake/abi_check.cmake)
148@@ -438,42 +439,14 @@
149 ELSE()
150 SET(CPACK_GENERATOR "TGZ")
151 ENDIF()
152-ADD_SUBDIRECTORY(packaging/WiX)
153-ADD_SUBDIRECTORY(packaging/solaris)
154
155 # Create a single package with "make package"
156 # (see http://public.kitware.com/Bug/view.php?id=11452)
157 SET(CPACK_MONOLITHIC_INSTALL 1 CACHE INTERNAL "")
158
159 INCLUDE(CPack)
160-IF(UNIX)
161- INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info)
162-ENDIF()
163 #
164 # RPM installs documentation directly from the source tree
165 #
166 IF(NOT INSTALL_LAYOUT MATCHES "RPM")
167- INSTALL(FILES COPYING LICENSE.mysql
168- DESTINATION ${INSTALL_DOCREADMEDIR}
169- COMPONENT Readme
170- OPTIONAL
171- )
172- INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
173- INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR})
174- IF(UNIX)
175- INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
176- ENDIF()
177- # MYSQL_DOCS_LOCATON is used in "make dist", points to the documentation directory
178- SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied")
179- MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION)
180- INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR}
181- COMPONENT Documentation
182- PATTERN "INSTALL-BINARY" EXCLUDE
183- PATTERN "Makefile.*" EXCLUDE
184- PATTERN "glibc*" EXCLUDE
185- PATTERN "linuxthreads.txt" EXCLUDE
186- PATTERN "myisam.txt" EXCLUDE
187- PATTERN "mysql.info" EXCLUDE
188- PATTERN "sp-imp-spec.txt" EXCLUDE
189- )
190 ENDIF()
191
192=== renamed file 'xtrabackup/VERSION' => 'XB_VERSION'
193--- xtrabackup/VERSION 2013-11-18 10:38:24 +0000
194+++ XB_VERSION 2013-11-27 10:34:29 +0000
195@@ -1,1 +1,4 @@
196-XTRABACKUP_VERSION=2.2.0
197+XB_VERSION_MAJOR=2
198+XB_VERSION_MINOR=2
199+XB_VERSION_PATCH=0
200+XB_VERSION_EXTRA=
201
202=== added file 'cmake/build_configurations/xtrabackup_release.cmake'
203--- cmake/build_configurations/xtrabackup_release.cmake 1970-01-01 00:00:00 +0000
204+++ cmake/build_configurations/xtrabackup_release.cmake 2013-11-27 10:34:29 +0000
205@@ -0,0 +1,57 @@
206+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
207+# Copyright (c) 2013 Percona LLC and/or its affiliates
208+#
209+# This program is free software; you can redistribute it and/or modify
210+# it under the terms of the GNU General Public License as published by
211+# the Free Software Foundation; version 2 of the License.
212+#
213+# This program is distributed in the hope that it will be useful,
214+# but WITHOUT ANY WARRANTY; without even the implied warranty of
215+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
216+# GNU General Public License for more details.
217+#
218+# You should have received a copy of the GNU General Public License
219+# along with this program; if not, write to the Free Software
220+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
221+
222+INCLUDE(CheckIncludeFiles)
223+INCLUDE(CheckLibraryExists)
224+
225+SET(WITH_INNOBASE_STORAGE_ENGINE ON)
226+SET(WITH_ZLIB bundled)
227+
228+IF(WIN32)
229+ IF(NOT CMAKE_USING_VC_FREE_TOOLS)
230+ # Sign executables with authenticode certificate
231+ SET(SIGNCODE 1 CACHE BOOL "")
232+ ENDIF()
233+ENDIF()
234+
235+IF(UNIX)
236+ SET(WITH_EXTRA_CHARSETS all CACHE STRING "")
237+
238+ OPTION(WITH_PIC "" ON) # Why?
239+
240+ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
241+ IF(NOT IGNORE_AIO_CHECK)
242+ # Ensure aio is available on Linux (required by InnoDB)
243+ CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
244+ CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO)
245+ IF(NOT HAVE_LIBAIO_H OR NOT HAVE_LIBAIO)
246+ MESSAGE(FATAL_ERROR "
247+ aio is required on Linux, you need to install the required library:
248+
249+ Debian/Ubuntu: apt-get install libaio-dev
250+ RedHat/Fedora/Oracle Linux: yum install libaio-devel
251+ SuSE: zypper install libaio-devel
252+
253+ If you really do not want it, pass -DIGNORE_AIO_CHECK to cmake.
254+ ")
255+ ENDIF()
256+ ENDIF()
257+
258+ # Enable fast mutexes on Linux
259+ OPTION(WITH_FAST_MUTEXES "" ON)
260+ ENDIF()
261+
262+ENDIF()
263
264=== added file 'cmake/gcrypt.cmake'
265--- cmake/gcrypt.cmake 1970-01-01 00:00:00 +0000
266+++ cmake/gcrypt.cmake 2013-11-27 10:34:29 +0000
267@@ -0,0 +1,41 @@
268+# Copyright (c) 2013 Percona LLC and/or its affiliates
269+#
270+# This program is free software; you can redistribute it and/or modify
271+# it under the terms of the GNU General Public License as published by
272+# the Free Software Foundation; version 2 of the License.
273+#
274+# This program is distributed in the hope that it will be useful,
275+# but WITHOUT ANY WARRANTY; without even the implied warranty of
276+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
277+# GNU General Public License for more details.
278+#
279+# You should have received a copy of the GNU General Public License
280+# along with this program; if not, write to the Free Software
281+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
282+
283+MACRO (FIND_GCRYPT)
284+
285+ IF (NOT GGRYPT_INCLUDE_PATH)
286+ SET(GCRYPT_INCLUDE_PATH /usr/include /usr/local/include /opt/local/include)
287+ ENDIF()
288+
289+ FIND_PATH(GCRYPT_INCLUDE_DIR gcrypt.h PATHS ${GCRYPT_INDCLUDE_PATH})
290+
291+ IF (NOT GCRYPT_INCLUDE_DIR)
292+ MESSAGE(SEND_ERROR "Cannot find gcrypt.h in ${GCRYPT_INCLUDE_PATH}. You can use libgcrypt-config --cflags to get the necessary path and pass it to CMake with -DGCRYPT_INCLUDE_PATH=<path>")
293+ ENDIF()
294+
295+ IF (NOT GCRYPT_LIB_PATH)
296+ SET(GCRYPT_LIB_PATH /usr/lib /usr/local/lib /opt/local/lib)
297+ ENDIF()
298+
299+ FIND_LIBRARY(GCRYPT_LIB gcrypt PATHS ${GCRYPT_LIB_PATH})
300+ FIND_LIBRARY(GPG_ERROR_LIB gpg-error PATHS ${GCRYPT_LIB_PATH})
301+
302+ IF (NOT GCRYPT_LIB OR NOT GPG_ERROR_LIB)
303+ MESSAGE(SEND_ERROR "Cannot find libgcrypt shared libraries in ${GCRYPT_LIB_PATH}. You can use libgcrypt-config --libs to get the necessary path and pass it to CMake with -DGCRYPT_LIB_PATH=<path>")
304+ ENDIF()
305+
306+ SET(GCRYPT_LIBS ${GCRYPT_LIB} ${GPG_ERROR_LIB})
307+
308+ENDMACRO()
309
310=== modified file 'cmake/install_layout.cmake'
311--- cmake/install_layout.cmake 2012-12-19 16:23:13 +0000
312+++ cmake/install_layout.cmake 2013-11-27 10:34:29 +0000
313@@ -18,7 +18,7 @@
314 # The current choices of installation layout are:
315 #
316 # STANDALONE
317-# Build with prefix=/usr/local/mysql, create tarball with install prefix="."
318+# Build with prefix=/usr/local/xtrabackup, create tarball with install prefix="."
319 # and relative links. Windows zip uses the same tarball layout but without
320 # the build prefix.
321 #
322@@ -27,10 +27,10 @@
323 # Note: The layout for ULN RPMs differs, see the "RPM" section.
324 #
325 # DEB
326-# Build as per STANDALONE, prefix=/opt/mysql/server-$major.$minor
327+# Build as per STANDALONE, prefix=/opt/mysql/xtrabackup-$major.$minor
328 #
329 # SVR4
330-# Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/mysql
331+# Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/xtrabackup
332 #
333 # To force a directory layout, use -DINSTALL_LAYOUT=<layout>.
334 #
335@@ -39,30 +39,16 @@
336 # There is the possibility to further fine-tune installation directories.
337 # Several variables can be overwritten:
338 #
339-# - INSTALL_BINDIR (directory with client executables and scripts)
340-# - INSTALL_SBINDIR (directory with mysqld)
341-# - INSTALL_SCRIPTDIR (several scripts, rarely used)
342-#
343-# - INSTALL_LIBDIR (directory with client end embedded libraries)
344-# - INSTALL_PLUGINDIR (directory for plugins)
345-#
346-# - INSTALL_INCLUDEDIR (directory for MySQL headers)
347+# - INSTALL_BINDIR (directory with innobackupex and XtraBackup binaries)
348 #
349 # - INSTALL_DOCDIR (documentation)
350 # - INSTALL_DOCREADMEDIR (readme and similar)
351 # - INSTALL_MANDIR (man pages)
352 # - INSTALL_INFODIR (info pages)
353 #
354-# - INSTALL_SHAREDIR (location of aclocal/mysql.m4)
355-# - INSTALL_MYSQLSHAREDIR (MySQL character sets and localized error messages)
356-# - INSTALL_MYSQLTESTDIR (mysql-test)
357-# - INSTALL_SQLBENCHDIR (sql-bench)
358+# - INSTALL_MYSQLTESTDIR (XtraBackup test suite)
359 # - INSTALL_SUPPORTFILESDIR (various extra support files)
360 #
361-# - INSTALL_MYSQLDATADIR (data directory)
362-#
363-# When changing this page, _please_ do not forget to update public Wiki
364-# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths
365
366 IF(NOT INSTALL_LAYOUT)
367 SET(DEFAULT_INSTALL_LAYOUT "STANDALONE")
368@@ -75,13 +61,13 @@
369 IF(INSTALL_LAYOUT MATCHES "RPM")
370 SET(default_prefix "/usr")
371 ELSEIF(INSTALL_LAYOUT MATCHES "DEB")
372- SET(default_prefix "/opt/mysql/server-${MYSQL_BASE_VERSION}")
373+ SET(default_prefix "/opt/mysql/xtrabackup-${XB_MAJOR_VERSION}.${XB_MINOR_VERSION")
374 # This is required to avoid "cpack -GDEB" default of prefix=/usr
375 SET(CPACK_SET_DESTDIR ON)
376 ELSEIF(INSTALL_LAYOUT MATCHES "SVR4")
377- SET(default_prefix "/opt/mysql/mysql")
378+ SET(default_prefix "/opt/mysql/xtrabackup")
379 ELSE()
380- SET(default_prefix "/usr/local/mysql")
381+ SET(default_prefix "/usr/local/xtrabackup")
382 ENDIF()
383 IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
384 SET(CMAKE_INSTALL_PREFIX ${default_prefix}
385@@ -128,7 +114,7 @@
386 #
387 SET(INSTALL_SHAREDIR_STANDALONE "share")
388 SET(INSTALL_MYSQLSHAREDIR_STANDALONE "share")
389-SET(INSTALL_MYSQLTESTDIR_STANDALONE "mysql-test")
390+SET(INSTALL_MYSQLTESTDIR_STANDALONE "xtrabackup-test")
391 SET(INSTALL_SQLBENCHDIR_STANDALONE ".")
392 SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files")
393 #
394@@ -163,7 +149,7 @@
395 #
396 SET(INSTALL_SHAREDIR_RPM "share")
397 SET(INSTALL_MYSQLSHAREDIR_RPM "share/mysql")
398-SET(INSTALL_MYSQLTESTDIR_RPM "share/mysql-test")
399+SET(INSTALL_MYSQLTESTDIR_RPM "share/xtrabackup-test")
400 SET(INSTALL_SQLBENCHDIR_RPM "")
401 SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql")
402 #
403@@ -189,7 +175,7 @@
404 #
405 SET(INSTALL_SHAREDIR_DEB "share")
406 SET(INSTALL_MYSQLSHAREDIR_DEB "share")
407-SET(INSTALL_MYSQLTESTDIR_DEB "mysql-test")
408+SET(INSTALL_MYSQLTESTDIR_DEB "xtrabackup-test")
409 SET(INSTALL_SQLBENCHDIR_DEB ".")
410 SET(INSTALL_SUPPORTFILESDIR_DEB "support-files")
411 #
412@@ -215,7 +201,7 @@
413 #
414 SET(INSTALL_SHAREDIR_SVR4 "share")
415 SET(INSTALL_MYSQLSHAREDIR_SVR4 "share")
416-SET(INSTALL_MYSQLTESTDIR_SVR4 "mysql-test")
417+SET(INSTALL_MYSQLTESTDIR_SVR4 "xtrabackup-test")
418 SET(INSTALL_SQLBENCHDIR_SVR4 ".")
419 SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files")
420 #
421
422=== modified file 'cmake/mysql_version.cmake'
423--- cmake/mysql_version.cmake 2013-02-26 05:45:28 +0000
424+++ cmake/mysql_version.cmake 2013-11-27 10:34:29 +0000
425@@ -29,9 +29,9 @@
426
427 # Read value for a variable from VERSION.
428
429-MACRO(MYSQL_GET_CONFIG_VALUE keyword var)
430+MACRO(MYSQL_GET_CONFIG_VALUE keyword var file)
431 IF(NOT ${var})
432- FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=")
433+ FILE (STRINGS ${CMAKE_SOURCE_DIR}/${file} str REGEX "^[ ]*${keyword}=")
434 IF(str)
435 STRING(REPLACE "${keyword}=" "" str ${str})
436 STRING(REGEX REPLACE "[ ].*" "" str "${str}")
437@@ -44,17 +44,16 @@
438 # Read mysql version for configure script
439
440 MACRO(GET_MYSQL_VERSION)
441- MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MAJOR" MAJOR_VERSION)
442- MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MINOR" MINOR_VERSION)
443- MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION)
444- MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION)
445+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MAJOR" MAJOR_VERSION VERSION)
446+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MINOR" MINOR_VERSION VERSION)
447+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION VERSION)
448+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION VERSION)
449
450 IF(NOT MAJOR_VERSION OR NOT MINOR_VERSION OR NOT PATCH_VERSION)
451 MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.")
452 ENDIF()
453
454 SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}")
455- MESSAGE(STATUS "MySQL ${VERSION}")
456 SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
457 SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
458 # Use NDBVERSION irregardless of whether this is Cluster or not, if not
459@@ -63,14 +62,47 @@
460 STRING(REPLACE "-" "_" MYSQL_RPM_VERSION "${NDBVERSION}")
461 MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH_VERSION}")
462 MARK_AS_ADVANCED(VERSION MYSQL_VERSION_ID MYSQL_BASE_VERSION)
463- SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
464- SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
465- SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})
466+ENDMACRO()
467+
468+MACRO(GET_XTRABACKUP_VERSION)
469+ MYSQL_GET_CONFIG_VALUE("XB_VERSION_MAJOR" XB_MAJOR_VERSION XB_VERSION)
470+ MYSQL_GET_CONFIG_VALUE("XB_VERSION_MINOR" XB_MINOR_VERSION XB_VERSION)
471+ MYSQL_GET_CONFIG_VALUE("XB_VERSION_PATCH" XB_PATCH_VERSION XB_VERSION)
472+ MYSQL_GET_CONFIG_VALUE("XB_VERSION_EXTRA" XB_EXTRA_VERSION XB_VERSION)
473+
474+ IF(NOT XB_MAJOR_VERSION OR NOT XB_MINOR_VERSION OR "${XB_PATCH_VERSION}" STREQUAL "")
475+ MESSAGE(FATAL_ERROR "XB_VERSION file cannot be parsed.")
476+ ENDIF()
477+
478+ SET(XB_VERSION "${XB_MAJOR_VERSION}.${XB_MINOR_VERSION}.${XB_PATCH_VERSION}${XB_EXTRA_VERSION}")
479+ MESSAGE(STATUS "Percona XtraBackup ${XB_VERSION} (based on MySQL ${VERSION} codebase)")
480+ SET(XB_BASE_VERSION "${XB_MAJOR_VERSION}.${XB_MINOR_VERSION}.${XB_PATCH_VERSION}" CACHE INTERNAL "XtraBackup Base version")
481+ SET(CPACK_PACKAGE_VERSION_MAJOR ${XB_MAJOR_VERSION})
482+ SET(CPACK_PACKAGE_VERSION_MINOR ${XB_MINOR_VERSION})
483+ SET(CPACK_PACKAGE_VERSION_PATCH ${XB_PATCH_VERSION})
484+
485+ IF (EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
486+ EXECUTE_PROCESS(
487+ COMMAND ${BZR_EXECUTABLE} version-info --custom --template "{revno}" ${CMAKE_SOURCE_DIR}
488+ OUTPUT_VARIABLE XB_REVISION
489+ RESULT_VARIABLE RESULT
490+ ERROR_VARIABLE ERROR
491+ TIMEOUT 10
492+ )
493+ IF(NOT RESULT EQUAL 0)
494+ MESSAGE(STATUS "Error from ${BZR_EXECUTABLE}: ${ERROR}")
495+ SET(BZR_EXECUTABLE)
496+ ENDIF()
497+
498+ ENDIF()
499 ENDMACRO()
500
501 # Get mysql version and other interesting variables
502 GET_MYSQL_VERSION()
503
504+# Get XtraBackup version
505+GET_XTRABACKUP_VERSION()
506+
507 SET(MYSQL_TCP_PORT_DEFAULT "3306")
508
509 IF(NOT MYSQL_TCP_PORT)
510
511=== modified file 'cmake/package_name.cmake'
512--- cmake/package_name.cmake 2013-02-26 05:45:28 +0000
513+++ cmake/package_name.cmake 2013-11-27 10:34:29 +0000
514@@ -17,9 +17,9 @@
515 # The logic is rather involved with special cases for different OSes
516
517 MACRO(GET_PACKAGE_FILE_NAME Var)
518-IF(NOT VERSION)
519+IF(NOT XB_VERSION)
520 MESSAGE(FATAL_ERROR
521- "Variable VERSION needs to be set prior to calling GET_PACKAGE_FILE_NAME")
522+ "Variable XB_VERSION needs to be set prior to calling GET_PACKAGE_FILE_NAME")
523 ENDIF()
524 IF(NOT SYSTEM_NAME_AND_PROCESSOR)
525 SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 1)
526@@ -115,12 +115,7 @@
527 SET(PRODUCT_TAG)
528 ENDIF()
529
530- IF("${VERSION}" MATCHES "-ndb-")
531- STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
532- SET(package_name "mysql-cluster${PRODUCT_TAG}-${NDBVERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
533- ELSE()
534- SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
535- ENDIF()
536+ SET(package_name "percona-xtrabackup${PRODUCT_TAG}-${XB_VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
537
538 MESSAGE(STATUS "Packaging as: ${package_name}")
539
540
541=== modified file 'cmake/plugin.cmake'
542--- cmake/plugin.cmake 2013-02-26 05:45:28 +0000
543+++ cmake/plugin.cmake 2013-11-27 10:34:29 +0000
544@@ -226,7 +226,6 @@
545 # subdirectories, configure sql_builtins.cc
546 MACRO(CONFIGURE_PLUGINS)
547 FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
548- FILE(GLOB dirs_plugin ${CMAKE_SOURCE_DIR}/plugin/*)
549 FOREACH(dir ${dirs_storage} ${dirs_plugin})
550 IF (EXISTS ${dir}/CMakeLists.txt)
551 ADD_SUBDIRECTORY(${dir})
552
553=== modified file 'extra/CMakeLists.txt'
554--- extra/CMakeLists.txt 2013-02-26 05:45:28 +0000
555+++ extra/CMakeLists.txt 2013-11-27 10:34:29 +0000
556@@ -58,52 +58,3 @@
557 IF (WIN32 AND WITH_SSL_PATH AND HAVE_CRYPTO_DLL)
558 ADD_DEPENDENCIES(GenError copy_openssl_extra)
559 ENDIF()
560-
561-
562-MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
563-TARGET_LINK_LIBRARIES(my_print_defaults mysys mysys_ssl)
564-SET_TARGET_PROPERTIES(my_print_defaults PROPERTIES LINKER_LANGUAGE CXX)
565-
566-MYSQL_ADD_EXECUTABLE(perror perror.c)
567-ADD_DEPENDENCIES(perror GenError)
568-TARGET_LINK_LIBRARIES(perror mysys mysys_ssl)
569-SET_TARGET_PROPERTIES(perror PROPERTIES LINKER_LANGUAGE CXX)
570-
571-MYSQL_ADD_EXECUTABLE(resolveip resolveip.c)
572-TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl)
573-SET_TARGET_PROPERTIES(resolveip PROPERTIES LINKER_LANGUAGE CXX)
574-IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
575- INCLUDE(CheckFunctionExists)
576- INCLUDE(CheckLibraryExists)
577- MY_SEARCH_LIBS(inet_aton "nsl;socket;resolv" SOLARIS_NSL)
578- TARGET_LINK_LIBRARIES(resolveip ${SOLARIS_NSL})
579-ENDIF()
580-
581-
582-MYSQL_ADD_EXECUTABLE(replace replace.c)
583-TARGET_LINK_LIBRARIES(replace mysys)
584-
585-IF(WITH_INNOBASE_STORAGE_ENGINE)
586- # Add path to the InnoDB headers
587- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include)
588- # We use the InnoDB code directly in case the code changes.
589- ADD_DEFINITIONS("-DUNIV_INNOCHECKSUM")
590- SET(INNOBASE_SOURCES
591- ../storage/innobase/buf/buf0checksum.cc
592- ../storage/innobase/ut/ut0crc32.cc
593- ../storage/innobase/ut/ut0ut.cc
594- )
595- MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES})
596- TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl)
597-ENDIF()
598-
599-IF(UNIX)
600- MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c)
601- TARGET_LINK_LIBRARIES(resolve_stack_dump mysys mysys_ssl)
602- SET_TARGET_PROPERTIES(resolve_stack_dump PROPERTIES LINKER_LANGUAGE CXX)
603-
604- MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c)
605- TARGET_LINK_LIBRARIES(mysql_waitpid mysys mysys_ssl)
606- SET_TARGET_PROPERTIES(mysql_waitpid PROPERTIES LINKER_LANGUAGE CXX)
607-ENDIF()
608-
609
610=== modified file 'include/CMakeLists.txt'
611--- include/CMakeLists.txt 2012-05-23 09:54:40 +0000
612+++ include/CMakeLists.txt 2013-11-27 10:34:29 +0000
613@@ -65,10 +65,4 @@
614 ${HEADERS_GEN_CONFIGURE}
615 )
616
617-INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
618-INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR}/mysql COMPONENT Development
619- PATTERN "*.h"
620- PATTERN "psi_abi*" EXCLUDE
621-)
622-
623
624
625=== modified file 'libmysql/CMakeLists.txt'
626--- libmysql/CMakeLists.txt 2013-02-13 09:02:21 +0000
627+++ libmysql/CMakeLists.txt 2013-11-27 10:34:29 +0000
628@@ -173,11 +173,10 @@
629 ENDIF()
630
631 # Merge several convenience libraries into one big mysqlclient
632-MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development)
633+MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development NOINSTALL 1)
634
635 # Visual Studio users need debug static library for debug projects
636 IF(MSVC)
637- INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug)
638 ENDIF()
639
640 IF(UNIX)
641@@ -192,7 +191,6 @@
642 SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION})
643 ENDIF()
644 ENDMACRO()
645- INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development)
646 ENDIF()
647
648 IF(NOT DISABLE_SHARED)
649@@ -200,7 +198,8 @@
650 # and link them together into shared library.
651 MERGE_LIBRARIES(libmysql SHARED ${LIBS}
652 EXPORTS ${CLIENT_API_FUNCTIONS}
653- COMPONENT SharedLibraries)
654+ COMPONENT SharedLibraries
655+ NOINSTALL 1)
656 IF(UNIX)
657 # libtool compatability
658 IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE)
659@@ -239,7 +238,6 @@
660 "${CMAKE_SHARED_LIBRARY_SUFFIX}"
661 ""
662 linkname)
663- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
664 SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}")
665 LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS)
666 FOREACH(ver ${OS_SHARED_LIB_SYMLINKS})
667@@ -248,7 +246,6 @@
668 "${CMAKE_SHARED_LIBRARY_SUFFIX}"
669 "${ver}"
670 linkname)
671- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
672 ENDFOREACH()
673 ENDIF()
674 ENDIF()
675
676=== modified file 'libmysqld/CMakeLists.txt'
677--- libmysqld/CMakeLists.txt 2012-08-07 05:14:58 +0000
678+++ libmysqld/CMakeLists.txt 2013-11-27 10:34:29 +0000
679@@ -113,19 +113,9 @@
680 ENDFOREACH()
681
682 MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
683- OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded)
684-
685-# Visual Studio users need debug static library
686-IF(MSVC)
687- INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_LIBDIR}/debug)
688-ENDIF()
689-
690-IF(UNIX)
691- INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_LIBDIR} RENAME
692- ${CMAKE_STATIC_LIBRARY_PREFIX}mysqld-debug)
693-ENDIF()
694+ OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded NOINSTALL 1)
695
696 IF(MSVC AND NOT DISABLE_SHARED)
697 MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}
698- COMPONENT Embedded)
699+ COMPONENT Embedded NOINSTALL 1)
700 ENDIF()
701
702=== modified file 'mysys/my_thr_init.c'
703--- mysys/my_thr_init.c 2012-05-17 12:51:37 +0000
704+++ mysys/my_thr_init.c 2013-11-27 10:34:29 +0000
705@@ -462,8 +462,12 @@
706
707 extern void **my_thread_var_dbug()
708 {
709- struct st_my_thread_var *tmp=
710- my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
711+ /* Fix for http://bugs.mysql.com/69653 */
712+ struct st_my_thread_var *tmp;
713+
714+ if (!my_thread_global_init_done)
715+ return NULL;
716+ tmp= my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
717 return tmp && tmp->init ? &tmp->dbug : 0;
718 }
719 #endif /* DBUG_OFF */
720
721=== modified file 'sql-bench/example.bat' (properties changed: -x to +x)
722=== modified file 'sql-bench/pwd.bat' (properties changed: -x to +x)
723=== modified file 'sql-bench/uname.bat' (properties changed: -x to +x)
724=== modified file 'sql/CMakeLists.txt'
725--- sql/CMakeLists.txt 2013-02-26 13:51:43 +0000
726+++ sql/CMakeLists.txt 2013-11-27 10:34:29 +0000
727@@ -253,36 +253,28 @@
728 SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL})
729 ENDIF()
730
731-MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
732-
733 OPTION(DEBUG_EXTNAME "Build server as mysqld-debug (debug builds only)" OFF)
734 MARK_AS_ADVANCED(DEBUG_EXTNAME)
735
736 IF(DEBUG_EXTNAME)
737- SET_TARGET_PROPERTIES(mysqld PROPERTIES DEBUG_OUTPUT_NAME "mysqld-debug")
738 ENDIF()
739
740 IF(APPLE)
741 # Add CoreServices framework since some dloadable plugins may need it
742 FIND_LIBRARY(CORESERVICES NAMES CoreServices)
743 IF(CORESERVICES)
744- TARGET_LINK_LIBRARIES(mysqld ${CORESERVICES})
745 ENDIF()
746 ENDIF()
747
748 IF(NOT WITHOUT_DYNAMIC_PLUGINS)
749- SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
750- GET_TARGET_PROPERTY(mysqld_link_flags mysqld LINK_FLAGS)
751 IF(NOT mysqld_link_flags)
752 SET(mysqld_link_flags)
753 ENDIF()
754 IF (MINGW OR CYGWIN)
755- SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} -Wl,--export-all-symbols")
756 ENDIF()
757 IF(MSVC)
758 # Set module definition file. Also use non-incremental linker,
759 # incremental appears to crash from time to time,if used with /DEF option
760- SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} /DEF:mysqld.def /INCREMENTAL:NO")
761
762 FOREACH (CORELIB sql mysys mysys_ssl dbug strings)
763 GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
764@@ -293,51 +285,25 @@
765 IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
766 SET(_PLATFORM x64)
767 ENDIF()
768- ADD_CUSTOM_COMMAND(TARGET mysqld PRE_LINK
769- COMMAND echo ${_PLATFORM} && cscript ARGS //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
770- ${_PLATFORM} ${LIB_LOCATIONS} > mysqld.def
771- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
772 ADD_DEPENDENCIES(sql GenError)
773 ENDIF()
774 ENDIF()
775
776-SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
777-TARGET_LINK_LIBRARIES(mysqld sql binlog rpl master slave sql mysys mysys_ssl)
778-
779 # Provide plugins with minimal set of libraries
780 SET(INTERFACE_LIBS ${LIBRT})
781 IF(INTERFACE_LIBS)
782- SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_INTERFACE_LIBRARIES
783- "${INTERFACE_LIBS}")
784 ENDIF()
785
786 # On Solaris, some extra effort is required in order to get dtrace probes
787 # from static libraries
788-DTRACE_INSTRUMENT_STATIC_LIBS(mysqld
789- "sql;mysys;mysys_ssl;${MYSQLD_STATIC_PLUGIN_LIBS}")
790
791
792 SET(WITH_MYSQLD_LDFLAGS "" CACHE STRING "Additional linker flags for mysqld")
793 MARK_AS_ADVANCED(WITH_MYSQLD_LDFLAGS)
794 IF(WITH_MYSQLD_LDFLAGS)
795- GET_TARGET_PROPERTY(mysqld LINK_FLAGS MYSQLD_LINK_FLAGS)
796 IF(NOT MYSQLD_LINK_FLAGS)
797 SET(MYSQLD_LINK_FLAGS)
798 ENDIF()
799- SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS
800- "${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}")
801-ENDIF()
802-
803-IF(DEBUG_EXTNAME)
804- INSTALL_DEBUG_TARGET(mysqld
805- DESTINATION ${INSTALL_SBINDIR}
806- PDB_DESTINATION ${INSTALL_SBINDIR}
807- SUFFIX "-debug")
808-ELSE()
809- INSTALL_DEBUG_TARGET(mysqld
810- DESTINATION ${INSTALL_SBINDIR}
811- PDB_DESTINATION ${INSTALL_SBINDIR}/debug
812- RENAME mysqld-debug)
813 ENDIF()
814
815 # Handle out-of-source build from source package with possibly broken
816@@ -371,10 +337,6 @@
817 DEPENDS gen_lex_hash
818 )
819
820-MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc)
821-SET_TARGET_PROPERTIES(mysql_tzinfo_to_sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
822-TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql mysys mysys_ssl)
823-
824 ADD_CUSTOM_TARGET(
825 GenServerSource
826 DEPENDS ${GEN_SOURCES}
827@@ -384,18 +346,6 @@
828 SET_TARGET_PROPERTIES(GenServerSource PROPERTIES EXCLUDE_FROM_ALL TRUE)
829
830 IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
831- ADD_LIBRARY(udf_example MODULE udf_example.cc)
832- SET_TARGET_PROPERTIES(udf_example PROPERTIES PREFIX "")
833- # udf_example depends on strings
834- IF(WIN32)
835- IF(MSVC)
836- SET_TARGET_PROPERTIES(udf_example PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/udf_example.def")
837- ENDIF()
838- TARGET_LINK_LIBRARIES(udf_example strings)
839- ELSE()
840- # udf_example is using safemutex exported by mysqld
841- TARGET_LINK_LIBRARIES(udf_example mysqld)
842- ENDIF()
843 ENDIF()
844
845 FOREACH(tool glibtoolize libtoolize aclocal autoconf autoheader automake gtar
846@@ -425,7 +375,6 @@
847
848 # Copy db.opt into data/test/
849 SET(DBOPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/db.opt )
850-INSTALL(FILES ${DBOPT_FILE} DESTINATION data/test COMPONENT DataFiles)
851
852 # Install initial database on windows
853 IF(NOT CMAKE_CROSSCOMPILING)
854@@ -457,14 +406,6 @@
855 ALL
856 DEPENDS initdb.dep
857 )
858- INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data
859- DESTINATION .
860- COMPONENT DataFiles
861- PATTERN "initdb.dep" EXCLUDE
862- PATTERN "bootstrap.sql" EXCLUDE)
863-ELSE()
864- # Not windows or cross compiling, just install an empty directory
865- INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
866 ENDIF()
867 ENDIF()
868
869
870=== modified file 'sql/share/CMakeLists.txt'
871--- sql/share/CMakeLists.txt 2012-09-05 08:12:17 +0000
872+++ sql/share/CMakeLists.txt 2013-11-27 10:34:29 +0000
873@@ -45,25 +45,7 @@
874 dictionary.txt
875 )
876
877-FOREACH (dir ${dirs})
878- INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}
879- DESTINATION ${INSTALL_MYSQLSHAREDIR}
880- COMPONENT Server
881- )
882-ENDFOREACH()
883-
884-INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets
885- DESTINATION ${INSTALL_MYSQLSHAREDIR}
886- COMPONENT Server
887- PATTERN "languages.html" EXCLUDE
888-)
889-
890 # Don't copy if we're building in-source.
891 IF (NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
892 CONFIGURE_FILE(dictionary.txt ${CMAKE_BINARY_DIR}/sql/share/dictionary.txt)
893 ENDIF()
894-
895-INSTALL(FILES ${files}
896- DESTINATION ${INSTALL_MYSQLSHAREDIR}
897- COMPONENT Server
898-)
899
900=== modified file 'storage/innobase/CMakeLists.txt'
901--- storage/innobase/CMakeLists.txt 2012-08-02 10:57:57 +0000
902+++ storage/innobase/CMakeLists.txt 2013-11-27 10:34:29 +0000
903@@ -44,8 +44,9 @@
904 # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
905 ENDIF()
906
907-# Enable InnoDB's UNIV_DEBUG and UNIV_SYNC_DEBUG in debug builds
908-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEBUG")
909+# In XtraBackup do not enable UNIV_SYNC_DEBUG when UNIV_DEBUG is enabled
910+# due to extreme overhead on compact backup testcases
911+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG")
912
913 # Add -Wconversion if compiling with GCC
914 ## As of Mar 15 2011 this flag causes 3573+ warnings. If you are reading this
915@@ -379,3 +380,7 @@
916 DEFAULT
917 MODULE_OUTPUT_NAME ha_innodb
918 LINK_LIBRARIES ${ZLIB_LIBRARY})
919+
920+# Must be after all ADD_DEFINITIONS() to be inherited by the
921+# 'xtrabackup' subdirectory
922+ADD_SUBDIRECTORY(xtrabackup)
923
924=== modified file 'storage/innobase/btr/btr0btr.cc'
925--- storage/innobase/btr/btr0btr.cc 2013-02-06 20:31:39 +0000
926+++ storage/innobase/btr/btr0btr.cc 2013-11-27 10:34:29 +0000
927@@ -700,7 +700,7 @@
928 /**************************************************************//**
929 Gets the root node of a tree and x- or s-latches it.
930 @return root page, x- or s-latched */
931-static
932+UNIV_INTERN
933 buf_block_t*
934 btr_root_block_get(
935 /*===============*/
936@@ -1346,7 +1346,7 @@
937 /************************************************************//**
938 Returns the child page of a node pointer and x-latches it.
939 @return child page, x-latched */
940-static
941+UNIV_INTERN
942 buf_block_t*
943 btr_node_ptr_get_child(
944 /*===================*/
945
946=== modified file 'storage/innobase/buf/buf0buf.cc'
947--- storage/innobase/buf/buf0buf.cc 2013-02-27 17:23:10 +0000
948+++ storage/innobase/buf/buf0buf.cc 2013-11-27 10:34:29 +0000
949@@ -53,6 +53,7 @@
950 #include "page0zip.h"
951 #include "srv0mon.h"
952 #include "buf0checksum.h"
953+#include "xb0xb.h"
954
955 /*
956 IMPLEMENTATION OF THE BUFFER POOL
957@@ -549,9 +550,15 @@
958 if (checksum_field1 == 0 && checksum_field2 == 0
959 && mach_read_from_4(read_buf + FIL_PAGE_LSN) == 0) {
960 /* make sure that the page is really empty */
961+#if 0
962+ /* Do not make sure that the page is really empty as this check
963+ is incompatible with 1st newly-created tablespace pages, which
964+ have FIL_PAGE_FIL_FLUSH_LSN != 0, FIL_PAGE_OR_CHKSUM == 0,
965+ FIL_PAGE_END_LSN_OLD_CHKSUM == 0 */
966 ut_d(for (ulint i = 0; i < UNIV_PAGE_SIZE; i++) {
967 ut_a(read_buf[i] == 0); });
968
969+#endif
970 return(FALSE);
971 }
972
973@@ -660,6 +667,18 @@
974 ut_ad(srv_checksum_algorithm
975 == SRV_CHECKSUM_ALGORITHM_INNODB);
976
977+ /* Check if innodb_fast_checksum is enabled when
978+ backing up XtraDB 5.5- tablespaces. If
979+ checksum_field1 doesn't match the "fast
980+ checksum" algorithm, fall back to verify against
981+ the SRV_CHECKSUM_ALGORITHM_INNODB algorithm */
982+ if (srv_fast_checksum &&
983+ checksum_field1 ==
984+ buf_calc_page_new_checksum_32(read_buf)) {
985+
986+ return(FALSE);
987+ }
988+
989 if (checksum_field1
990 != buf_calc_page_new_checksum(read_buf)) {
991
992@@ -976,6 +995,7 @@
993 block->page.in_flush_list = FALSE;
994 block->page.in_free_list = FALSE;
995 block->page.in_LRU_list = FALSE;
996+ block->page.is_compacted = FALSE;
997 block->in_unzip_LRU_list = FALSE;
998 #endif /* UNIV_DEBUG */
999 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
1000@@ -3963,6 +3983,13 @@
1001 frame = ((buf_block_t*) bpage)->frame;
1002 }
1003
1004+ /* Do not validate, recover and apply change buffer entries to
1005+ bogus pages which replace skipped pages in compact backups. */
1006+ if (srv_compact_backup && buf_page_is_compacted(frame)) {
1007+
1008+ bpage->is_compacted = TRUE;
1009+ }
1010+
1011 /* If this page is not uninitialized and not in the
1012 doublewrite buffer, then the page number and space id
1013 should be the same as in block. */
1014@@ -4080,7 +4107,8 @@
1015 recv_recover_page(TRUE, (buf_block_t*) bpage);
1016 }
1017
1018- if (uncompressed && !recv_no_ibuf_operations) {
1019+ if (uncompressed && !recv_no_ibuf_operations &&
1020+ !bpage->is_compacted) {
1021 ibuf_merge_or_delete_for_page(
1022 (buf_block_t*) bpage, bpage->space,
1023 bpage->offset, buf_page_get_zip_size(bpage),
1024
1025=== modified file 'storage/innobase/buf/buf0checksum.cc'
1026--- storage/innobase/buf/buf0checksum.cc 2011-12-13 11:26:37 +0000
1027+++ storage/innobase/buf/buf0checksum.cc 2013-11-27 10:34:29 +0000
1028@@ -125,6 +125,30 @@
1029 return(checksum);
1030 }
1031
1032+/********************************************************************//**
1033+Calculates a page checksum using the "fast checksum" algorithm in XtraDB <= 5.5
1034+@return checksum */
1035+UNIV_INTERN
1036+ulint
1037+buf_calc_page_new_checksum_32(
1038+/*==========================*/
1039+ const byte* page) /*!< in: buffer page */
1040+{
1041+ ulint checksum;
1042+
1043+ checksum = ut_fold_binary(page + FIL_PAGE_OFFSET,
1044+ FIL_PAGE_FILE_FLUSH_LSN - FIL_PAGE_OFFSET)
1045+ + ut_fold_binary(page + FIL_PAGE_DATA,
1046+ FIL_PAGE_DATA_ALIGN_32 - FIL_PAGE_DATA)
1047+ + ut_fold_binary_32(page + FIL_PAGE_DATA_ALIGN_32,
1048+ UNIV_PAGE_SIZE - FIL_PAGE_DATA_ALIGN_32
1049+ - FIL_PAGE_END_LSN_OLD_CHKSUM);
1050+
1051+ checksum = checksum & 0xFFFFFFFFUL;
1052+
1053+ return(checksum);
1054+}
1055+
1056 #ifndef UNIV_INNOCHECKSUM
1057
1058 /********************************************************************//**
1059
1060=== modified file 'storage/innobase/buf/buf0flu.cc'
1061--- storage/innobase/buf/buf0flu.cc 2013-02-27 17:23:10 +0000
1062+++ storage/innobase/buf/buf0flu.cc 2013-11-27 10:34:29 +0000
1063@@ -790,7 +790,9 @@
1064 break;
1065 case SRV_CHECKSUM_ALGORITHM_INNODB:
1066 case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
1067- checksum = (ib_uint32_t) buf_calc_page_new_checksum(page);
1068+ checksum = (srv_fast_checksum) ?
1069+ (ib_uint32_t) buf_calc_page_new_checksum_32(page) :
1070+ (ib_uint32_t) buf_calc_page_new_checksum(page);
1071 break;
1072 case SRV_CHECKSUM_ALGORITHM_NONE:
1073 case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
1074
1075=== modified file 'storage/innobase/fil/fil0fil.cc'
1076--- storage/innobase/fil/fil0fil.cc 2012-12-21 11:00:05 +0000
1077+++ storage/innobase/fil/fil0fil.cc 2013-11-27 10:34:29 +0000
1078@@ -43,6 +43,8 @@
1079 #include "dict0dict.h"
1080 #include "page0page.h"
1081 #include "page0zip.h"
1082+#include "pars0pars.h"
1083+#include "que0que.h"
1084 #include "trx0sys.h"
1085 #include "row0mysql.h"
1086 #ifndef UNIV_HOTBACKUP
1087@@ -140,181 +142,9 @@
1088 UNIV_INTERN mysql_pfs_key_t fil_space_latch_key;
1089 #endif /* UNIV_PFS_RWLOCK */
1090
1091-/** File node of a tablespace or the log data space */
1092-struct fil_node_t {
1093- fil_space_t* space; /*!< backpointer to the space where this node
1094- belongs */
1095- char* name; /*!< path to the file */
1096- ibool open; /*!< TRUE if file open */
1097- os_file_t handle; /*!< OS handle to the file, if file open */
1098- ibool is_raw_disk;/*!< TRUE if the 'file' is actually a raw
1099- device or a raw disk partition */
1100- ulint size; /*!< size of the file in database pages, 0 if
1101- not known yet; the possible last incomplete
1102- megabyte may be ignored if space == 0 */
1103- ulint n_pending;
1104- /*!< count of pending i/o's on this file;
1105- closing of the file is not allowed if
1106- this is > 0 */
1107- ulint n_pending_flushes;
1108- /*!< count of pending flushes on this file;
1109- closing of the file is not allowed if
1110- this is > 0 */
1111- ibool being_extended;
1112- /*!< TRUE if the node is currently
1113- being extended. */
1114- ib_int64_t modification_counter;/*!< when we write to the file we
1115- increment this by one */
1116- ib_int64_t flush_counter;/*!< up to what
1117- modification_counter value we have
1118- flushed the modifications to disk */
1119- UT_LIST_NODE_T(fil_node_t) chain;
1120- /*!< link field for the file chain */
1121- UT_LIST_NODE_T(fil_node_t) LRU;
1122- /*!< link field for the LRU list */
1123- ulint magic_n;/*!< FIL_NODE_MAGIC_N */
1124-};
1125-
1126-/** Value of fil_node_t::magic_n */
1127-#define FIL_NODE_MAGIC_N 89389
1128-
1129-/** Tablespace or log data space: let us call them by a common name space */
1130-struct fil_space_t {
1131- char* name; /*!< space name = the path to the first file in
1132- it */
1133- ulint id; /*!< space id */
1134- ib_int64_t tablespace_version;
1135- /*!< in DISCARD/IMPORT this timestamp
1136- is used to check if we should ignore
1137- an insert buffer merge request for a
1138- page because it actually was for the
1139- previous incarnation of the space */
1140- ibool mark; /*!< this is set to TRUE at database startup if
1141- the space corresponds to a table in the InnoDB
1142- data dictionary; so we can print a warning of
1143- orphaned tablespaces */
1144- ibool stop_ios;/*!< TRUE if we want to rename the
1145- .ibd file of tablespace and want to
1146- stop temporarily posting of new i/o
1147- requests on the file */
1148- ibool stop_new_ops;
1149- /*!< we set this TRUE when we start
1150- deleting a single-table tablespace.
1151- When this is set following new ops
1152- are not allowed:
1153- * read IO request
1154- * ibuf merge
1155- * file flush
1156- Note that we can still possibly have
1157- new write operations because we don't
1158- check this flag when doing flush
1159- batches. */
1160- ulint purpose;/*!< FIL_TABLESPACE, FIL_LOG, or
1161- FIL_ARCH_LOG */
1162- UT_LIST_BASE_NODE_T(fil_node_t) chain;
1163- /*!< base node for the file chain */
1164- ulint size; /*!< space size in pages; 0 if a single-table
1165- tablespace whose size we do not know yet;
1166- last incomplete megabytes in data files may be
1167- ignored if space == 0 */
1168- ulint flags; /*!< tablespace flags; see
1169- fsp_flags_is_valid(),
1170- fsp_flags_get_zip_size() */
1171- ulint n_reserved_extents;
1172- /*!< number of reserved free extents for
1173- ongoing operations like B-tree page split */
1174- ulint n_pending_flushes; /*!< this is positive when flushing
1175- the tablespace to disk; dropping of the
1176- tablespace is forbidden if this is positive */
1177- ulint n_pending_ops;/*!< this is positive when we
1178- have pending operations against this
1179- tablespace. The pending operations can
1180- be ibuf merges or lock validation code
1181- trying to read a block.
1182- Dropping of the tablespace is forbidden
1183- if this is positive */
1184- hash_node_t hash; /*!< hash chain node */
1185- hash_node_t name_hash;/*!< hash chain the name_hash table */
1186-#ifndef UNIV_HOTBACKUP
1187- rw_lock_t latch; /*!< latch protecting the file space storage
1188- allocation */
1189-#endif /* !UNIV_HOTBACKUP */
1190- UT_LIST_NODE_T(fil_space_t) unflushed_spaces;
1191- /*!< list of spaces with at least one unflushed
1192- file we have written to */
1193- bool is_in_unflushed_spaces;
1194- /*!< true if this space is currently in
1195- unflushed_spaces */
1196- UT_LIST_NODE_T(fil_space_t) space_list;
1197- /*!< list of all spaces */
1198- ulint magic_n;/*!< FIL_SPACE_MAGIC_N */
1199-};
1200-
1201-/** Value of fil_space_t::magic_n */
1202-#define FIL_SPACE_MAGIC_N 89472
1203-
1204-/** The tablespace memory cache; also the totality of logs (the log
1205-data space) is stored here; below we talk about tablespaces, but also
1206-the ib_logfiles form a 'space' and it is handled here */
1207-struct fil_system_t {
1208-#ifndef UNIV_HOTBACKUP
1209- ib_mutex_t mutex; /*!< The mutex protecting the cache */
1210-#endif /* !UNIV_HOTBACKUP */
1211- hash_table_t* spaces; /*!< The hash table of spaces in the
1212- system; they are hashed on the space
1213- id */
1214- hash_table_t* name_hash; /*!< hash table based on the space
1215- name */
1216- UT_LIST_BASE_NODE_T(fil_node_t) LRU;
1217- /*!< base node for the LRU list of the
1218- most recently used open files with no
1219- pending i/o's; if we start an i/o on
1220- the file, we first remove it from this
1221- list, and return it to the start of
1222- the list when the i/o ends;
1223- log files and the system tablespace are
1224- not put to this list: they are opened
1225- after the startup, and kept open until
1226- shutdown */
1227- UT_LIST_BASE_NODE_T(fil_space_t) unflushed_spaces;
1228- /*!< base node for the list of those
1229- tablespaces whose files contain
1230- unflushed writes; those spaces have
1231- at least one file node where
1232- modification_counter > flush_counter */
1233- ulint n_open; /*!< number of files currently open */
1234- ulint max_n_open; /*!< n_open is not allowed to exceed
1235- this */
1236- ib_int64_t modification_counter;/*!< when we write to a file we
1237- increment this by one */
1238- ulint max_assigned_id;/*!< maximum space id in the existing
1239- tables, or assigned during the time
1240- mysqld has been up; at an InnoDB
1241- startup we scan the data dictionary
1242- and set here the maximum of the
1243- space id's of the tables there */
1244- ib_int64_t tablespace_version;
1245- /*!< a counter which is incremented for
1246- every space object memory creation;
1247- every space mem object gets a
1248- 'timestamp' from this; in DISCARD/
1249- IMPORT this is used to check if we
1250- should ignore an insert buffer merge
1251- request */
1252- UT_LIST_BASE_NODE_T(fil_space_t) space_list;
1253- /*!< list of all file spaces */
1254- ibool space_id_reuse_warned;
1255- /* !< TRUE if fil_space_create()
1256- has issued a warning about
1257- potential space_id reuse */
1258-};
1259-
1260 /** The tablespace memory cache. This variable is NULL before the module is
1261 initialized. */
1262-static fil_system_t* fil_system = NULL;
1263-
1264-/** Determine if (i) is a user tablespace id or not. */
1265-# define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open)
1266+fil_system_t* fil_system = NULL;
1267
1268 /** Determine if user has explicitly disabled fsync(). */
1269 #ifndef __WIN__
1270@@ -466,49 +296,6 @@
1271 byte_offset, len, buf, message));
1272 }
1273
1274-/*******************************************************************//**
1275-Returns the table space by a given id, NULL if not found. */
1276-UNIV_INLINE
1277-fil_space_t*
1278-fil_space_get_by_id(
1279-/*================*/
1280- ulint id) /*!< in: space id */
1281-{
1282- fil_space_t* space;
1283-
1284- ut_ad(mutex_own(&fil_system->mutex));
1285-
1286- HASH_SEARCH(hash, fil_system->spaces, id,
1287- fil_space_t*, space,
1288- ut_ad(space->magic_n == FIL_SPACE_MAGIC_N),
1289- space->id == id);
1290-
1291- return(space);
1292-}
1293-
1294-/*******************************************************************//**
1295-Returns the table space by a given name, NULL if not found. */
1296-UNIV_INLINE
1297-fil_space_t*
1298-fil_space_get_by_name(
1299-/*==================*/
1300- const char* name) /*!< in: space name */
1301-{
1302- fil_space_t* space;
1303- ulint fold;
1304-
1305- ut_ad(mutex_own(&fil_system->mutex));
1306-
1307- fold = ut_fold_string(name);
1308-
1309- HASH_SEARCH(name_hash, fil_system->name_hash, fold,
1310- fil_space_t*, space,
1311- ut_ad(space->magic_n == FIL_SPACE_MAGIC_N),
1312- !strcmp(name, space->name));
1313-
1314- return(space);
1315-}
1316-
1317 #ifndef UNIV_HOTBACKUP
1318 /*******************************************************************//**
1319 Returns the version number of a tablespace, -1 if not found.
1320@@ -705,7 +492,6 @@
1321 byte* page;
1322 ulint space_id;
1323 ulint flags;
1324- ulint page_size;
1325
1326 ut_ad(mutex_own(&(system->mutex)));
1327 ut_a(node->n_pending == 0);
1328@@ -773,7 +559,6 @@
1329 success = os_file_read(node->handle, page, 0, UNIV_PAGE_SIZE);
1330 space_id = fsp_header_get_space_id(page);
1331 flags = fsp_header_get_flags(page);
1332- page_size = fsp_flags_get_page_size(flags);
1333
1334 ut_free(buf2);
1335
1336@@ -786,6 +571,7 @@
1337 "InnoDB: Error: tablespace id is %lu"
1338 " in the data dictionary\n"
1339 "InnoDB: but in file %s it is %lu!\n",
1340+
1341 space->id, node->name, space_id);
1342
1343 ut_error;
1344@@ -801,6 +587,10 @@
1345 ut_error;
1346 }
1347
1348+ /* XtraBackup does not validate the page size, because
1349+ innodb_page_size in PS 5.5- is not stored in FSP headers
1350+ and the data dictionary. */
1351+#if 0
1352 if (UNIV_UNLIKELY(fsp_flags_get_page_size(space->flags)
1353 != page_size)) {
1354 fprintf(stderr,
1355@@ -813,8 +603,10 @@
1356
1357 ut_error;
1358 }
1359+#endif
1360
1361- if (UNIV_UNLIKELY(space->flags != flags)) {
1362+ if (UNIV_UNLIKELY((space->flags & ~FSP_FLAGS_MASK_PAGE_SSIZE) !=
1363+ (flags & ~FSP_FLAGS_MASK_PAGE_SSIZE))) {
1364 fprintf(stderr,
1365 "InnoDB: Error: table flags are 0x%lx"
1366 " in the data dictionary\n"
1367@@ -825,8 +617,9 @@
1368 }
1369
1370 if (size_bytes >= 1024 * 1024) {
1371- /* Truncate the size to whole megabytes. */
1372- size_bytes = ut_2pow_round(size_bytes, 1024 * 1024);
1373+ /* The size should be exact for after applying
1374+ .delta */
1375+ //size_bytes = ut_2pow_round(size_bytes, 1024 * 1024);
1376 }
1377
1378 if (!fsp_flags_is_compressed(flags)) {
1379@@ -1956,12 +1749,6 @@
1380 contain sensible data */
1381 ulint* flags, /*!< out: tablespace flags */
1382 ulint* space_id, /*!< out: tablespace ID */
1383-#ifdef UNIV_LOG_ARCHIVE
1384- ulint* min_arch_log_no, /*!< out: min of archived
1385- log numbers in data files */
1386- ulint* max_arch_log_no, /*!< out: max of archived
1387- log numbers in data files */
1388-#endif /* UNIV_LOG_ARCHIVE */
1389 lsn_t* min_flushed_lsn, /*!< out: min of flushed
1390 lsn values in data files */
1391 lsn_t* max_flushed_lsn) /*!< out: max of flushed
1392@@ -1990,10 +1777,6 @@
1393 if (!one_read_already) {
1394 *min_flushed_lsn = flushed_lsn;
1395 *max_flushed_lsn = flushed_lsn;
1396-#ifdef UNIV_LOG_ARCHIVE
1397- *min_arch_log_no = arch_log_no;
1398- *max_arch_log_no = arch_log_no;
1399-#endif /* UNIV_LOG_ARCHIVE */
1400 return;
1401 }
1402
1403@@ -2003,14 +1786,6 @@
1404 if (*max_flushed_lsn < flushed_lsn) {
1405 *max_flushed_lsn = flushed_lsn;
1406 }
1407-#ifdef UNIV_LOG_ARCHIVE
1408- if (*min_arch_log_no > arch_log_no) {
1409- *min_arch_log_no = arch_log_no;
1410- }
1411- if (*max_arch_log_no < arch_log_no) {
1412- *max_arch_log_no = arch_log_no;
1413- }
1414-#endif /* UNIV_LOG_ARCHIVE */
1415 }
1416
1417 /*================ SINGLE-TABLE TABLESPACES ==========================*/
1418@@ -2109,7 +1884,7 @@
1419 mem_free(path);
1420 }
1421
1422-#ifndef UNIV_HOTBACKUP
1423+#if 0
1424 /********************************************************//**
1425 Writes a log record about an .ibd file create/rename/delete. */
1426 static
1427@@ -2343,7 +2118,7 @@
1428 space_id, name, path, flags,
1429 DICT_TF2_USE_TABLESPACE,
1430 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
1431- ut_error;
1432+ //ut_error;
1433 }
1434 }
1435
1436@@ -2702,7 +2477,7 @@
1437 }
1438
1439 if (err == DB_SUCCESS) {
1440-#ifndef UNIV_HOTBACKUP
1441+#if 0
1442 /* Write a log record about the deletion of the .ibd
1443 file, so that ibbackup can replay it in the
1444 --apply-log phase. We use a dummy mtr and the familiar
1445@@ -3057,7 +2832,7 @@
1446
1447 mutex_exit(&fil_system->mutex);
1448
1449-#ifndef UNIV_HOTBACKUP
1450+#if 0
1451 if (success && !recv_recovery_on) {
1452 mtr_t mtr;
1453
1454@@ -3441,7 +3216,7 @@
1455 goto error_exit_1;
1456 }
1457
1458-#ifndef UNIV_HOTBACKUP
1459+#if 0
1460 {
1461 mtr_t mtr;
1462 ulint mlog_file_flag = 0;
1463@@ -3514,11 +3289,99 @@
1464 lsn_t lsn; /*!< Flushed LSN from header page */
1465 ulint id; /*!< Space ID */
1466 ulint flags; /*!< Tablespace flags */
1467-#ifdef UNIV_LOG_ARCHIVE
1468- ulint arch_log_no; /*!< latest archived log file number */
1469-#endif /* UNIV_LOG_ARCHIVE */
1470 };
1471
1472+static
1473+void
1474+fil_remove_invalid_table_from_data_dict(const char *name)
1475+{
1476+ trx_t* trx;
1477+ pars_info_t* info = NULL;
1478+
1479+ trx = trx_allocate_for_mysql();
1480+ trx_start_for_ddl(trx, TRX_DICT_OP_TABLE);
1481+
1482+ ut_ad(mutex_own(&dict_sys->mutex));
1483+
1484+ trx->op_info = "removing invalid table from data dictionary";
1485+
1486+ info = pars_info_create();
1487+
1488+ pars_info_add_str_literal(info, "table_name", name);
1489+
1490+ que_eval_sql(info,
1491+ "PROCEDURE DROP_TABLE_PROC () IS\n"
1492+ "sys_foreign_id CHAR;\n"
1493+ "table_id CHAR;\n"
1494+ "index_id CHAR;\n"
1495+ "foreign_id CHAR;\n"
1496+ "found INT;\n"
1497+ "BEGIN\n"
1498+ "SELECT ID INTO table_id\n"
1499+ "FROM SYS_TABLES\n"
1500+ "WHERE NAME = :table_name\n"
1501+ "LOCK IN SHARE MODE;\n"
1502+ "IF (SQL % NOTFOUND) THEN\n"
1503+ " RETURN;\n"
1504+ "END IF;\n"
1505+ "found := 1;\n"
1506+ "SELECT ID INTO sys_foreign_id\n"
1507+ "FROM SYS_TABLES\n"
1508+ "WHERE NAME = 'SYS_FOREIGN'\n"
1509+ "LOCK IN SHARE MODE;\n"
1510+ "IF (SQL % NOTFOUND) THEN\n"
1511+ " found := 0;\n"
1512+ "END IF;\n"
1513+ "IF (:table_name = 'SYS_FOREIGN') THEN\n"
1514+ " found := 0;\n"
1515+ "END IF;\n"
1516+ "IF (:table_name = 'SYS_FOREIGN_COLS') THEN\n"
1517+ " found := 0;\n"
1518+ "END IF;\n"
1519+ "WHILE found = 1 LOOP\n"
1520+ " SELECT ID INTO foreign_id\n"
1521+ " FROM SYS_FOREIGN\n"
1522+ " WHERE FOR_NAME = :table_name\n"
1523+ " AND TO_BINARY(FOR_NAME)\n"
1524+ " = TO_BINARY(:table_name)\n"
1525+ " LOCK IN SHARE MODE;\n"
1526+ " IF (SQL % NOTFOUND) THEN\n"
1527+ " found := 0;\n"
1528+ " ELSE\n"
1529+ " DELETE FROM SYS_FOREIGN_COLS\n"
1530+ " WHERE ID = foreign_id;\n"
1531+ " DELETE FROM SYS_FOREIGN\n"
1532+ " WHERE ID = foreign_id;\n"
1533+ " END IF;\n"
1534+ "END LOOP;\n"
1535+ "found := 1;\n"
1536+ "WHILE found = 1 LOOP\n"
1537+ " SELECT ID INTO index_id\n"
1538+ " FROM SYS_INDEXES\n"
1539+ " WHERE TABLE_ID = table_id\n"
1540+ " LOCK IN SHARE MODE;\n"
1541+ " IF (SQL % NOTFOUND) THEN\n"
1542+ " found := 0;\n"
1543+ " ELSE\n"
1544+ " DELETE FROM SYS_FIELDS\n"
1545+ " WHERE INDEX_ID = index_id;\n"
1546+ " DELETE FROM SYS_INDEXES\n"
1547+ " WHERE ID = index_id\n"
1548+ " AND TABLE_ID = table_id;\n"
1549+ " END IF;\n"
1550+ "END LOOP;\n"
1551+ "DELETE FROM SYS_COLUMNS\n"
1552+ "WHERE TABLE_ID = table_id;\n"
1553+ "DELETE FROM SYS_TABLES\n"
1554+ "WHERE ID = table_id;\n"
1555+ "END;\n"
1556+ , FALSE, trx);
1557+
1558+ trx_commit_for_mysql(trx);
1559+
1560+ trx_free_for_mysql(trx);
1561+}
1562+
1563 /********************************************************************//**
1564 Tries to open a single-table tablespace and optionally checks that the
1565 space id in it is correct. If this does not succeed, print an error message
1566@@ -3584,6 +3447,9 @@
1567 in the default location. If it is remote, it should not be here. */
1568 def.filepath = fil_make_ibd_name(tablename, false);
1569
1570+ /* We skip SYS_DATAFILES validation and remote tablespaces discovery for
1571+ XtraBackup, as all tablespaces are local for XtraBackup recovery. */
1572+#if 0
1573 /* The path_in was read from SYS_DATAFILES. */
1574 if (path_in) {
1575 if (strcmp(def.filepath, path_in)) {
1576@@ -3631,6 +3497,7 @@
1577 tablespaces_found++;
1578 }
1579 }
1580+#endif
1581
1582 /* Always look for a file at the default location. */
1583 ut_a(def.filepath);
1584@@ -3652,9 +3519,6 @@
1585 if (def.success) {
1586 fil_read_first_page(
1587 def.file, FALSE, &def.flags, &def.id,
1588-#ifdef UNIV_LOG_ARCHIVE
1589- &space_arch_log_no, &space_arch_log_no,
1590-#endif /* UNIV_LOG_ARCHIVE */
1591 &def.lsn, &def.lsn);
1592
1593 /* Validate this single-table-tablespace with SYS_TABLES,
1594@@ -3676,9 +3540,6 @@
1595 if (remote.success) {
1596 fil_read_first_page(
1597 remote.file, FALSE, &remote.flags, &remote.id,
1598-#ifdef UNIV_LOG_ARCHIVE
1599- &remote.arch_log_no, &remote.arch_log_no,
1600-#endif /* UNIV_LOG_ARCHIVE */
1601 &remote.lsn, &remote.lsn);
1602
1603 /* Validate this single-table-tablespace with SYS_TABLES,
1604@@ -3701,9 +3562,6 @@
1605 if (dict.success) {
1606 fil_read_first_page(
1607 dict.file, FALSE, &dict.flags, &dict.id,
1608-#ifdef UNIV_LOG_ARCHIVE
1609- &dict.arch_log_no, &dict.arch_log_no,
1610-#endif /* UNIV_LOG_ARCHIVE */
1611 &dict.lsn, &dict.lsn);
1612
1613 /* Validate this single-table-tablespace with SYS_TABLES,
1614@@ -3727,11 +3585,15 @@
1615 /* The following call prints an error message */
1616 os_file_get_last_error(true);
1617
1618- ib_logf(IB_LOG_LEVEL_ERROR,
1619+ ib_logf(IB_LOG_LEVEL_WARN,
1620 "Could not find a valid tablespace file for '%s'. "
1621 "See " REFMAN "innodb-troubleshooting-datadict.html "
1622 "for how to resolve the issue.",
1623 tablename);
1624+ ib_logf(IB_LOG_LEVEL_WARN,
1625+ "It will be removed from the data dictionary.");
1626+
1627+ fil_remove_invalid_table_from_data_dict(tablename);
1628
1629 err = DB_CORRUPTION;
1630
1631@@ -3931,9 +3793,6 @@
1632 {
1633 fil_read_first_page(
1634 fsp->file, FALSE, &fsp->flags, &fsp->id,
1635-#ifdef UNIV_LOG_ARCHIVE
1636- &fsp->arch_log_no, &fsp->arch_log_no,
1637-#endif /* UNIV_LOG_ARCHIVE */
1638 &fsp->lsn, &fsp->lsn);
1639
1640 if (fsp->id == ULINT_UNDEFINED || fsp->id == 0) {
1641@@ -3989,6 +3848,9 @@
1642 #ifdef UNIV_HOTBACKUP
1643 fil_space_t* space;
1644 #endif
1645+ fsp_open_info* fsp;
1646+ ulong minimum_size;
1647+ ibool file_space_create_success;
1648
1649 memset(&def, 0, sizeof(def));
1650 memset(&remote, 0, sizeof(remote));
1651@@ -4033,6 +3895,9 @@
1652 # endif /* !UNIV_HOTBACKUP */
1653 #endif
1654
1655+ /* Ignore .isl files on XtraBackup recovery. All tablespaces must be
1656+ local. */
1657+ if (srv_backup_mode) {
1658 /* Check for a link file which locates a remote tablespace. */
1659 remote.success = fil_open_linked_file(
1660 tablename, &remote.filepath, &remote.file);
1661@@ -4043,8 +3908,20 @@
1662 if (!remote.success) {
1663 os_file_close(remote.file);
1664 mem_free(remote.filepath);
1665+
1666+ if (srv_backup_mode) {
1667+
1668+ /* Ignore files that have uninitialized space
1669+ IDs on the backup stage. This means that a
1670+ tablespace has just been created and we will
1671+ replay the corresponding log records on
1672+ prepare. */
1673+
1674+ goto func_exit_after_close;
1675+ }
1676 }
1677 }
1678+ }
1679
1680
1681 /* Try to open the tablespace in the datadir. */
1682@@ -4057,6 +3934,17 @@
1683 fil_validate_single_table_tablespace(tablename, &def);
1684 if (!def.success) {
1685 os_file_close(def.file);
1686+
1687+ if (srv_backup_mode) {
1688+
1689+ /* Ignore files that have uninitialized space
1690+ IDs on the backup stage. This means that a
1691+ tablespace has just been created and we will
1692+ replay the corresponding log records on
1693+ prepare. */
1694+
1695+ goto func_exit_after_close;
1696+ }
1697 }
1698 }
1699
1700@@ -4129,7 +4017,7 @@
1701 /* At this point, only one tablespace is open */
1702 ut_a(def.success == !remote.success);
1703
1704- fsp_open_info* fsp = def.success ? &def : &remote;
1705+ fsp = def.success ? &def : &remote;
1706
1707 /* Get and test the file size. */
1708 size = os_file_get_size(fsp->file);
1709@@ -4148,9 +4036,9 @@
1710
1711 /* Every .ibd file is created >= 4 pages in size. Smaller files
1712 cannot be ok. */
1713- ulong minimum_size = FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE;
1714+ minimum_size = FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE;
1715 if (size < minimum_size) {
1716-#ifndef UNIV_HOTBACKUP
1717+#if 0
1718 ib_logf(IB_LOG_LEVEL_ERROR,
1719 "The size of single-table tablespace file %s "
1720 "is only " UINT64PF ", should be at least %lu!",
1721@@ -4231,7 +4119,7 @@
1722 }
1723 mutex_exit(&fil_system->mutex);
1724 #endif /* UNIV_HOTBACKUP */
1725- ibool file_space_create_success = fil_space_create(
1726+ file_space_create_success = fil_space_create(
1727 tablename, fsp->id, fsp->flags, FIL_TABLESPACE);
1728
1729 if (!file_space_create_success) {
1730@@ -4258,13 +4146,55 @@
1731 }
1732
1733 func_exit:
1734- os_file_close(fsp->file);
1735-
1736-#ifdef UNIV_HOTBACKUP
1737+ /* We reuse file handles on the backup stage in XtraBackup to avoid
1738+ inconsistencies between the file name and the actual tablespace contents
1739+ if a DDL occurs between a fil_load_single_table_tablespaces() call and
1740+ the actual copy operation. */
1741+ if (srv_backup_mode) {
1742+
1743+ fil_node_t* node;
1744+ fil_space_t* space;
1745+
1746+ mutex_enter(&fil_system->mutex);
1747+
1748+ space = fil_space_get_by_id(fsp->id);
1749+
1750+ if (space) {
1751+ node = UT_LIST_GET_LAST(space->chain);
1752+
1753+ /* The handle will be closed by xtrabackup in
1754+ xtrabackup_copy_datafile(). We set node->open to TRUE to
1755+ make sure no one calls fil_node_open_file()
1756+ (i.e. attempts to reopen the tablespace by name) during
1757+ the backup stage. */
1758+
1759+ node->open = TRUE;
1760+ node->handle = fsp->file;
1761+
1762+ /* The following is copied from fil_node_open_file() to
1763+ pass fil_system validaty checks. We cannot use
1764+ fil_node_open_file() directly, as that would re-open the
1765+ file by name and create another file handle. */
1766+
1767+ fil_system->n_open++;
1768+ fil_n_file_opened++;
1769+
1770+ if (fil_space_belongs_in_lru(space)) {
1771+
1772+ /* Put the node to the LRU list */
1773+ UT_LIST_ADD_FIRST(LRU, fil_system->LRU, node);
1774+ }
1775+ }
1776+
1777+ mutex_exit(&fil_system->mutex);
1778+ } else {
1779+
1780+ os_file_close(fsp->file);
1781+ }
1782+
1783 func_exit_after_close:
1784-#else
1785 ut_ad(!mutex_own(&fil_system->mutex));
1786-#endif
1787+
1788 mem_free(tablename);
1789 if (remote.success) {
1790 mem_free(remote.filepath);
1791@@ -4278,7 +4208,7 @@
1792 idea is to read as much good data as we can and jump over bad data.
1793 @return 0 if ok, -1 if error even after the retries, 1 if at the end
1794 of the directory */
1795-static
1796+UNIV_INTERN
1797 int
1798 fil_file_readdir_next_file(
1799 /*=======================*/
1800@@ -4318,7 +4248,7 @@
1801 @return DB_SUCCESS or error number */
1802 UNIV_INTERN
1803 dberr_t
1804-fil_load_single_table_tablespaces(void)
1805+fil_load_single_table_tablespaces(ibool (*pred)(const char*, const char*))
1806 /*===================================*/
1807 {
1808 int ret;
1809@@ -4374,7 +4304,9 @@
1810 "%s/%s", fil_path_to_mysql_datadir, dbinfo.name);
1811 srv_normalize_path_for_win(dbpath);
1812
1813- dbdir = os_file_opendir(dbpath, FALSE);
1814+ /* We want wrong directory permissions to be a fatal error for
1815+ XtraBackup. */
1816+ dbdir = os_file_opendir(dbpath, TRUE);
1817
1818 if (dbdir != NULL) {
1819
1820@@ -4395,9 +4327,15 @@
1821 && (0 == strcmp(fileinfo.name
1822 + strlen(fileinfo.name) - 4,
1823 ".ibd")
1824- || 0 == strcmp(fileinfo.name
1825+ /* Ignore .isl files on XtraBackup
1826+ recovery, all tablespaces must be
1827+ local. */
1828+ || (srv_backup_mode &&
1829+ 0 == strcmp(fileinfo.name
1830 + strlen(fileinfo.name) - 4,
1831- ".isl"))) {
1832+ ".isl")))
1833+ && (!pred ||
1834+ pred(dbinfo.name, fileinfo.name))) {
1835 /* The name ends in .ibd or .isl;
1836 try opening the file */
1837 fil_load_single_table_tablespace(
1838@@ -4553,6 +4491,7 @@
1839 {
1840 fil_space_t* fnamespace;
1841 fil_space_t* space;
1842+ ibool remove_from_data_dict = FALSE;
1843
1844 ut_ad(fil_system);
1845
1846@@ -4630,6 +4569,10 @@
1847 if (fnamespace == NULL) {
1848 if (print_error_if_does_not_exist) {
1849 fil_report_missing_tablespace(name, id);
1850+ ib_logf(IB_LOG_LEVEL_WARN,
1851+ "It will be removed from "
1852+ "the data dictionary.");
1853+ remove_from_data_dict = TRUE;
1854 }
1855 } else {
1856 ut_print_timestamp(stderr);
1857@@ -4653,6 +4596,10 @@
1858
1859 mutex_exit(&fil_system->mutex);
1860
1861+ if (remove_from_data_dict) {
1862+ fil_remove_invalid_table_from_data_dict(name);
1863+ }
1864+
1865 return(FALSE);
1866 }
1867
1868@@ -5274,6 +5221,16 @@
1869
1870 ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE);
1871
1872+ if (space->size > 0 && space->size <= block_offset) {
1873+ ulint actual_size;
1874+
1875+ mutex_exit(&fil_system->mutex);
1876+ fil_extend_space_to_desired_size(&actual_size, space->id,
1877+ block_offset + 1);
1878+ mutex_enter(&fil_system->mutex);
1879+ /* should retry? but it may safe for xtrabackup for now. */
1880+ }
1881+
1882 node = UT_LIST_GET_FIRST(space->chain);
1883
1884 for (;;) {
1885@@ -6179,6 +6136,7 @@
1886 return(err);
1887 }
1888
1889+#if 0
1890 /****************************************************************//**
1891 Generate redo logs for swapping two .ibd files */
1892 UNIV_INTERN
1893@@ -6205,3 +6163,4 @@
1894 0, 0, new_name, old_name, mtr);
1895 }
1896 }
1897+#endif
1898
1899=== modified file 'storage/innobase/handler/ha_innodb.cc'
1900--- storage/innobase/handler/ha_innodb.cc 2013-04-05 06:02:38 +0000
1901+++ storage/innobase/handler/ha_innodb.cc 2013-11-27 10:34:29 +0000
1902@@ -176,6 +176,7 @@
1903 #endif /* UNIV_LOG_ARCHIVE */
1904 static my_bool innobase_use_doublewrite = TRUE;
1905 static my_bool innobase_use_checksums = TRUE;
1906+static my_bool innobase_fast_checksum = FALSE;
1907 static my_bool innobase_locks_unsafe_for_binlog = FALSE;
1908 static my_bool innobase_rollback_on_timeout = FALSE;
1909 static my_bool innobase_create_status_file = FALSE;
1910@@ -208,8 +209,9 @@
1911 NULL
1912 };
1913
1914-/** Possible values for system variable "innodb_checksum_algorithm". */
1915-static const char* innodb_checksum_algorithm_names[] = {
1916+/** Possible values for system variables "innodb_checksum_algorithm" and
1917+"innodb_log_checksum_algorithm". */
1918+const char* innodb_checksum_algorithm_names[] = {
1919 "crc32",
1920 "strict_crc32",
1921 "innodb",
1922@@ -219,9 +221,9 @@
1923 NullS
1924 };
1925
1926-/** Used to define an enumerate type of the system variable
1927-innodb_checksum_algorithm. */
1928-static TYPELIB innodb_checksum_algorithm_typelib = {
1929+/** Used to define an enumerate type of the system variables
1930+innodb_checksum_algorithm and innodb_log_checksum_algorithm. */
1931+TYPELIB innodb_checksum_algorithm_typelib = {
1932 array_elements(innodb_checksum_algorithm_names) - 1,
1933 "innodb_checksum_algorithm_typelib",
1934 innodb_checksum_algorithm_names,
1935@@ -1548,7 +1550,7 @@
1936 ut_ad(*mbminlen < DATA_MBMAX);
1937 ut_ad(*mbmaxlen < DATA_MBMAX);
1938 } else {
1939- THD* thd = current_thd;
1940+ THD* thd = NULL;
1941
1942 if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) {
1943
1944@@ -2099,6 +2101,62 @@
1945 return(trx->state != TRX_STATE_NOT_STARTED);
1946 }
1947
1948+/****************************************************************//**
1949+Update log_checksum_algorithm_ptr with a pointer to the function corresponding
1950+to a given checksum algorithm. */
1951+UNIV_INTERN
1952+void
1953+innodb_log_checksum_func_update(
1954+/*============================*/
1955+ ulint algorithm) /*!< in: algorithm */
1956+{
1957+ switch (algorithm) {
1958+ case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
1959+ case SRV_CHECKSUM_ALGORITHM_INNODB:
1960+ log_checksum_algorithm_ptr=log_block_calc_checksum_innodb;
1961+ break;
1962+ case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
1963+ case SRV_CHECKSUM_ALGORITHM_CRC32:
1964+ log_checksum_algorithm_ptr=log_block_calc_checksum_crc32;
1965+ break;
1966+ case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
1967+ case SRV_CHECKSUM_ALGORITHM_NONE:
1968+ log_checksum_algorithm_ptr=log_block_calc_checksum_none;
1969+ break;
1970+ default:
1971+ ut_a(0);
1972+ }
1973+}
1974+
1975+/****************************************************************//**
1976+On update hook for the innodb_log_checksum_algorithm variable. */
1977+static
1978+void
1979+innodb_log_checksum_algorithm_update(
1980+/*=================================*/
1981+ THD* thd, /*!< in: thread handle */
1982+ struct st_mysql_sys_var* var, /*!< in: pointer to
1983+ system variable */
1984+ void* var_ptr,/*!< out: where the
1985+ formal string goes */
1986+ const void* save) /*!< in: immediate result
1987+ from check function */
1988+{
1989+ srv_checksum_algorithm_t algorithm;
1990+
1991+ algorithm = (srv_checksum_algorithm_t)
1992+ (*static_cast<const ulong*>(save));
1993+
1994+ /* Make sure we are the only log user */
1995+ mutex_enter(&log_sys->mutex);
1996+
1997+ innodb_log_checksum_func_update(algorithm);
1998+
1999+ srv_log_checksum_algorithm = algorithm;
2000+
2001+ mutex_exit(&log_sys->mutex);
2002+}
2003+
2004 /*********************************************************************//**
2005 Copy table flags from MySQL's HA_CREATE_INFO into an InnoDB table object.
2006 Those flags are stored in .frm file and end up in the MySQL table object,
2007@@ -2459,43 +2517,19 @@
2008 ulint buflen, /*!< in: length of buf, in bytes */
2009 const char* id, /*!< in: identifier to convert */
2010 ulint idlen, /*!< in: length of id, in bytes */
2011- THD* thd, /*!< in: MySQL connection thread, or NULL */
2012- ibool file_id)/*!< in: TRUE=id is a table or database name;
2013+ THD* thd __attribute__((unused)),
2014+ /*!< in: MySQL connection thread, or NULL */
2015+ ibool file_id __attribute__((unused)))
2016+ /*!< in: TRUE=id is a table or database name;
2017 FALSE=id is an UTF-8 string */
2018 {
2019- char nz[NAME_LEN + 1];
2020- char nz2[NAME_LEN + 1 + EXPLAIN_FILENAME_MAX_EXTRA_LENGTH];
2021-
2022 const char* s = id;
2023 int q;
2024
2025- if (file_id) {
2026- /* Decode the table name. The MySQL function expects
2027- a NUL-terminated string. The input and output strings
2028- buffers must not be shared. */
2029-
2030- if (UNIV_UNLIKELY(idlen > (sizeof nz) - 1)) {
2031- idlen = (sizeof nz) - 1;
2032- }
2033-
2034- memcpy(nz, id, idlen);
2035- nz[idlen] = 0;
2036-
2037- s = nz2;
2038- idlen = explain_filename(thd, nz, nz2, sizeof nz2,
2039- EXPLAIN_PARTITIONS_AS_COMMENT);
2040- goto no_quote;
2041- }
2042-
2043 /* See if the identifier needs to be quoted. */
2044- if (UNIV_UNLIKELY(!thd)) {
2045- q = '"';
2046- } else {
2047- q = get_quote_char_for_identifier(thd, s, (int) idlen);
2048- }
2049+ q = '"';
2050
2051 if (q == EOF) {
2052-no_quote:
2053 if (UNIV_UNLIKELY(idlen > buflen)) {
2054 idlen = buflen;
2055 }
2056@@ -2883,12 +2917,9 @@
2057 }
2058
2059 #ifdef UNIV_LOG_ARCHIVE
2060- /* Since innodb_log_arch_dir has no relevance under MySQL,
2061- starting from 4.0.6 we always set it the same as
2062- innodb_log_group_home_dir: */
2063-
2064- innobase_log_arch_dir = innobase_log_group_home_dir;
2065-
2066+ if (!innobase_log_arch_dir) {
2067+ innobase_log_arch_dir = srv_log_group_home_dir;
2068+ }
2069 srv_arch_dir = innobase_log_arch_dir;
2070 #endif /* UNIG_LOG_ARCHIVE */
2071
2072@@ -3136,6 +3167,10 @@
2073 srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_NONE;
2074 }
2075
2076+ srv_fast_checksum = innobase_fast_checksum;
2077+
2078+ innodb_log_checksum_func_update(srv_log_checksum_algorithm);
2079+
2080 #ifdef HAVE_LARGE_PAGES
2081 if ((os_use_large_pages = (ibool) my_use_large_pages)) {
2082 os_large_page_size = (ulint) opt_large_page_size;
2083@@ -15432,6 +15467,33 @@
2084 NULL, NULL, SRV_CHECKSUM_ALGORITHM_INNODB,
2085 &innodb_checksum_algorithm_typelib);
2086
2087+
2088+static MYSQL_SYSVAR_ENUM(log_checksum_algorithm, srv_log_checksum_algorithm,
2089+ PLUGIN_VAR_RQCMDARG,
2090+ "The algorithm InnoDB uses for log block checksums. Possible values are "
2091+ "CRC32 (hardware accelerated if the CPU supports it) "
2092+ "write crc32, allow any of the other checksums to match when reading; "
2093+ "STRICT_CRC32 "
2094+ "write crc32, do not allow other algorithms to match when reading; "
2095+ "INNODB "
2096+ "write a software calculated checksum, allow any other checksums "
2097+ "to match when reading; "
2098+ "STRICT_INNODB "
2099+ "write a software calculated checksum, do not allow other algorithms "
2100+ "to match when reading; "
2101+ "NONE "
2102+ "write a constant magic number, do not do any checksum verification "
2103+ "when reading (same as innodb_checksums=OFF); "
2104+ "STRICT_NONE "
2105+ "write a constant magic number, do not allow values other than that "
2106+ "magic number when reading; "
2107+ "Logs created when this option is set to crc32/strict_crc32/none/strict_none "
2108+ "will not be readable by any MySQL version or Percona Server versions that do"
2109+ "not support this feature",
2110+ NULL, innodb_log_checksum_algorithm_update, SRV_CHECKSUM_ALGORITHM_INNODB,
2111+ &innodb_checksum_algorithm_typelib);
2112+
2113+
2114 static MYSQL_SYSVAR_BOOL(checksums, innobase_use_checksums,
2115 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
2116 "DEPRECATED. Use innodb_checksum_algorithm=NONE instead of setting "
2117@@ -15440,6 +15502,15 @@
2118 "Disable with --skip-innodb-checksums.",
2119 NULL, NULL, TRUE);
2120
2121+static MYSQL_SYSVAR_BOOL(fast_checksum, innobase_fast_checksum,
2122+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
2123+ "Change the algorithm of checksum for the whole of datapage to 4-bytes word based. "
2124+ "The original checksum is checked after the new one. It may be slow for reading page"
2125+ " which has orginal checksum. Overwrite the page or recreate the InnoDB database, "
2126+ "if you want the entire benefit for performance at once. "
2127+ "#### Attention: The checksum is not compatible for normal or disabled version! ####",
2128+ NULL, NULL, FALSE);
2129+
2130 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
2131 PLUGIN_VAR_READONLY,
2132 "The common part for InnoDB table spaces.",
2133@@ -16199,7 +16270,9 @@
2134 MYSQL_SYSVAR(lru_scan_depth),
2135 MYSQL_SYSVAR(flush_neighbors),
2136 MYSQL_SYSVAR(checksum_algorithm),
2137+ MYSQL_SYSVAR(log_checksum_algorithm),
2138 MYSQL_SYSVAR(checksums),
2139+ MYSQL_SYSVAR(fast_checksum),
2140 MYSQL_SYSVAR(commit_concurrency),
2141 MYSQL_SYSVAR(concurrency_tickets),
2142 MYSQL_SYSVAR(compression_level),
2143@@ -16774,45 +16847,24 @@
2144 void
2145 ib_logf(
2146 /*====*/
2147- ib_log_level_t level, /*!< in: warning level */
2148+ ib_log_level_t level __attribute__((unused)),
2149+ /*!< in: warning level */
2150 const char* format, /*!< printf format */
2151 ...) /*!< Args */
2152 {
2153- char* str;
2154 va_list args;
2155
2156 va_start(args, format);
2157
2158-#ifdef __WIN__
2159- int size = _vscprintf(format, args) + 1;
2160- str = static_cast<char*>(malloc(size));
2161- str[size - 1] = 0x0;
2162- vsnprintf(str, size, format, args);
2163-#elif HAVE_VASPRINTF
2164- (void) vasprintf(&str, format, args);
2165-#else
2166- /* Use a fixed length string. */
2167- str = static_cast<char*>(malloc(BUFSIZ));
2168- my_vsnprintf(str, BUFSIZ, format, args);
2169-#endif /* __WIN__ */
2170-
2171- switch(level) {
2172- case IB_LOG_LEVEL_INFO:
2173- sql_print_information("InnoDB: %s", str);
2174- break;
2175- case IB_LOG_LEVEL_WARN:
2176- sql_print_warning("InnoDB: %s", str);
2177- break;
2178- case IB_LOG_LEVEL_ERROR:
2179- sql_print_error("InnoDB: %s", str);
2180- break;
2181- case IB_LOG_LEVEL_FATAL:
2182- sql_print_error("InnoDB: %s", str);
2183- break;
2184- }
2185+ /* Don't use server logger for XtraBackup, just print to stderr. */
2186+
2187+ fprintf(stderr, "InnoDB: ");
2188+
2189+ vfprintf(stderr, format, args);
2190
2191 va_end(args);
2192- free(str);
2193+
2194+ fputc('\n', stderr);
2195
2196 if (level == IB_LOG_LEVEL_FATAL) {
2197 ut_error;
2198
2199=== modified file 'storage/innobase/handler/handler0alter.cc'
2200--- storage/innobase/handler/handler0alter.cc 2013-02-25 08:47:44 +0000
2201+++ storage/innobase/handler/handler0alter.cc 2013-11-27 10:34:29 +0000
2202@@ -5434,6 +5434,7 @@
2203 = static_cast<ha_innobase_inplace_ctx*>(*pctx);
2204
2205 DBUG_ASSERT(ctx->need_rebuild());
2206+#if 0
2207 /* Generate the redo log for the file
2208 operations that will be performed in
2209 commit_cache_rebuild(). */
2210@@ -5442,6 +5443,7 @@
2211 ctx->new_table->space,
2212 ctx->new_table->name,
2213 ctx->tmp_name, &mtr);
2214+#endif
2215 DBUG_INJECT_CRASH("ib_commit_inplace_crash",
2216 crash_inject_count++);
2217 }
2218
2219=== modified file 'storage/innobase/include/btr0btr.h'
2220--- storage/innobase/include/btr0btr.h 2013-02-06 20:31:39 +0000
2221+++ storage/innobase/include/btr0btr.h 2013-11-27 10:34:29 +0000
2222@@ -762,6 +762,30 @@
2223 const trx_t* trx) /*!< in: transaction or 0 */
2224 __attribute__((nonnull(1), warn_unused_result));
2225
2226+/**************************************************************//**
2227+Gets the root node of a tree and x- or s-latches it.
2228+@return root page, x- or s-latched */
2229+UNIV_INTERN
2230+buf_block_t*
2231+btr_root_block_get(
2232+/*===============*/
2233+ const dict_index_t* index, /*!< in: index tree */
2234+ ulint mode, /*!< in: either RW_S_LATCH
2235+ or RW_X_LATCH */
2236+ mtr_t* mtr); /*!< in: mtr */
2237+
2238+/************************************************************//**
2239+Returns the child page of a node pointer and x-latches it.
2240+@return child page, x-latched */
2241+UNIV_INTERN
2242+buf_block_t*
2243+btr_node_ptr_get_child(
2244+/*===================*/
2245+ const rec_t* node_ptr,/*!< in: node pointer */
2246+ dict_index_t* index, /*!< in: index */
2247+ const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
2248+ mtr_t* mtr); /*!< in: mtr */
2249+
2250 #define BTR_N_LEAF_PAGES 1
2251 #define BTR_TOTAL_SIZE 2
2252 #endif /* !UNIV_HOTBACKUP */
2253
2254=== modified file 'storage/innobase/include/buf0buf.h'
2255--- storage/innobase/include/buf0buf.h 2013-02-27 17:23:10 +0000
2256+++ storage/innobase/include/buf0buf.h 2013-11-27 10:34:29 +0000
2257@@ -1580,6 +1580,8 @@
2258 or buf_block_t::mutex. */
2259 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
2260 #endif /* !UNIV_HOTBACKUP */
2261+ ibool is_compacted; /*!< TRUE if page was skipped in
2262+ compact backups */
2263 };
2264
2265 /** The buffer control block structure */
2266
2267=== modified file 'storage/innobase/include/buf0checksum.h'
2268--- storage/innobase/include/buf0checksum.h 2011-11-21 04:58:23 +0000
2269+++ storage/innobase/include/buf0checksum.h 2013-11-27 10:34:29 +0000
2270@@ -70,6 +70,15 @@
2271 /*=======================*/
2272 const byte* page); /*!< in: buffer page */
2273
2274+/********************************************************************//**
2275+Calculates a page checksum using the "fast checksum" algorithm in XtraDB <= 5.5
2276+@return checksum */
2277+UNIV_INTERN
2278+ulint
2279+buf_calc_page_new_checksum_32(
2280+/*==========================*/
2281+ const byte* page); /*!< in: buffer page */
2282+
2283 #ifndef UNIV_INNOCHECKSUM
2284
2285 /********************************************************************//**
2286
2287=== modified file 'storage/innobase/include/dict0dict.h'
2288--- storage/innobase/include/dict0dict.h 2012-12-18 11:43:03 +0000
2289+++ storage/innobase/include/dict0dict.h 2013-11-27 10:34:29 +0000
2290@@ -448,7 +448,7 @@
2291 /*!< in: column names, or NULL
2292 to use table->col_names */
2293 const dict_index_t* index) /*!< in: index to be replaced */
2294- __attribute__((nonnull(1,3), warn_unused_result));
2295+ __attribute__((nonnull(1,3)));
2296 /**********************************************************************//**
2297 Determines whether a string starts with the specified keyword.
2298 @return TRUE if str starts with keyword */
2299
2300=== modified file 'storage/innobase/include/fil0fil.h'
2301--- storage/innobase/include/fil0fil.h 2012-12-18 11:43:03 +0000
2302+++ storage/innobase/include/fil0fil.h 2013-11-27 10:34:29 +0000
2303@@ -32,6 +32,7 @@
2304
2305 #include "dict0types.h"
2306 #include "ut0byte.h"
2307+#include "hash0hash.h"
2308 #include "os0file.h"
2309 #ifndef UNIV_HOTBACKUP
2310 #include "sync0rw.h"
2311@@ -128,6 +129,7 @@
2312 #define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this
2313 contains the space id of the page */
2314 #define FIL_PAGE_DATA 38 /*!< start of the data on the page */
2315+#define FIL_PAGE_DATA_ALIGN_32 40
2316 /* @} */
2317 /** File page trailer @{ */
2318 #define FIL_PAGE_END_LSN_OLD_CHKSUM 8 /*!< the low 4 bytes of this are used
2319@@ -163,6 +165,183 @@
2320 #define FIL_LOG 502 /*!< redo log */
2321 /* @} */
2322
2323+/** Determine if (i) is a user tablespace id or not. */
2324+#define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open && \
2325+ (i) != TRX_DOUBLEWRITE_SPACE)
2326+
2327+/** Value of fil_space_t::magic_n */
2328+#define FIL_SPACE_MAGIC_N 89472
2329+
2330+/** File node of a tablespace or the log data space */
2331+struct fil_node_t {
2332+ fil_space_t* space; /*!< backpointer to the space where this node
2333+ belongs */
2334+ char* name; /*!< path to the file */
2335+ ibool open; /*!< TRUE if file open */
2336+ os_file_t handle; /*!< OS handle to the file, if file open */
2337+ ibool is_raw_disk;/*!< TRUE if the 'file' is actually a raw
2338+ device or a raw disk partition */
2339+ ulint size; /*!< size of the file in database pages, 0 if
2340+ not known yet; the possible last incomplete
2341+ megabyte may be ignored if space == 0 */
2342+ ulint n_pending;
2343+ /*!< count of pending i/o's on this file;
2344+ closing of the file is not allowed if
2345+ this is > 0 */
2346+ ulint n_pending_flushes;
2347+ /*!< count of pending flushes on this file;
2348+ closing of the file is not allowed if
2349+ this is > 0 */
2350+ ibool being_extended;
2351+ /*!< TRUE if the node is currently
2352+ being extended. */
2353+ ib_int64_t modification_counter;/*!< when we write to the file we
2354+ increment this by one */
2355+ ib_int64_t flush_counter;/*!< up to what
2356+ modification_counter value we have
2357+ flushed the modifications to disk */
2358+ UT_LIST_NODE_T(fil_node_t) chain;
2359+ /*!< link field for the file chain */
2360+ UT_LIST_NODE_T(fil_node_t) LRU;
2361+ /*!< link field for the LRU list */
2362+ ulint magic_n;/*!< FIL_NODE_MAGIC_N */
2363+};
2364+
2365+/** Value of fil_node_t::magic_n */
2366+#define FIL_NODE_MAGIC_N 89389
2367+
2368+/** Tablespace or log data space: let us call them by a common name space */
2369+struct fil_space_t {
2370+ char* name; /*!< space name = the path to the first file in
2371+ it */
2372+ ulint id; /*!< space id */
2373+ ib_int64_t tablespace_version;
2374+ /*!< in DISCARD/IMPORT this timestamp
2375+ is used to check if we should ignore
2376+ an insert buffer merge request for a
2377+ page because it actually was for the
2378+ previous incarnation of the space */
2379+ ibool mark; /*!< this is set to TRUE at database startup if
2380+ the space corresponds to a table in the InnoDB
2381+ data dictionary; so we can print a warning of
2382+ orphaned tablespaces */
2383+ ibool stop_ios;/*!< TRUE if we want to rename the
2384+ .ibd file of tablespace and want to
2385+ stop temporarily posting of new i/o
2386+ requests on the file */
2387+ ibool stop_new_ops;
2388+ /*!< we set this TRUE when we start
2389+ deleting a single-table tablespace.
2390+ When this is set following new ops
2391+ are not allowed:
2392+ * read IO request
2393+ * ibuf merge
2394+ * file flush
2395+ Note that we can still possibly have
2396+ new write operations because we don't
2397+ check this flag when doing flush
2398+ batches. */
2399+ ulint purpose;/*!< FIL_TABLESPACE, FIL_LOG, or
2400+ FIL_ARCH_LOG */
2401+ UT_LIST_BASE_NODE_T(fil_node_t) chain;
2402+ /*!< base node for the file chain */
2403+ ulint size; /*!< space size in pages; 0 if a single-table
2404+ tablespace whose size we do not know yet;
2405+ last incomplete megabytes in data files may be
2406+ ignored if space == 0 */
2407+ ulint flags; /*!< tablespace flags; see
2408+ fsp_flags_is_valid(),
2409+ fsp_flags_get_zip_size() */
2410+ ulint n_reserved_extents;
2411+ /*!< number of reserved free extents for
2412+ ongoing operations like B-tree page split */
2413+ ulint n_pending_flushes; /*!< this is positive when flushing
2414+ the tablespace to disk; dropping of the
2415+ tablespace is forbidden if this is positive */
2416+ ulint n_pending_ops;/*!< this is positive when we
2417+ have pending operations against this
2418+ tablespace. The pending operations can
2419+ be ibuf merges or lock validation code
2420+ trying to read a block.
2421+ Dropping of the tablespace is forbidden
2422+ if this is positive */
2423+ hash_node_t hash; /*!< hash chain node */
2424+ hash_node_t name_hash;/*!< hash chain the name_hash table */
2425+#ifndef UNIV_HOTBACKUP
2426+ rw_lock_t latch; /*!< latch protecting the file space storage
2427+ allocation */
2428+#endif /* !UNIV_HOTBACKUP */
2429+ UT_LIST_NODE_T(fil_space_t) unflushed_spaces;
2430+ /*!< list of spaces with at least one unflushed
2431+ file we have written to */
2432+ bool is_in_unflushed_spaces;
2433+ /*!< true if this space is currently in
2434+ unflushed_spaces */
2435+ UT_LIST_NODE_T(fil_space_t) space_list;
2436+ /*!< list of all spaces */
2437+ ulint magic_n;/*!< FIL_SPACE_MAGIC_N */
2438+};
2439+
2440+/** The tablespace memory cache; also the totality of logs (the log
2441+data space) is stored here; below we talk about tablespaces, but also
2442+the ib_logfiles form a 'space' and it is handled here */
2443+struct fil_system_t {
2444+#ifndef UNIV_HOTBACKUP
2445+ ib_mutex_t mutex; /*!< The mutex protecting the cache */
2446+#endif /* !UNIV_HOTBACKUP */
2447+ hash_table_t* spaces; /*!< The hash table of spaces in the
2448+ system; they are hashed on the space
2449+ id */
2450+ hash_table_t* name_hash; /*!< hash table based on the space
2451+ name */
2452+ UT_LIST_BASE_NODE_T(fil_node_t) LRU;
2453+ /*!< base node for the LRU list of the
2454+ most recently used open files with no
2455+ pending i/o's; if we start an i/o on
2456+ the file, we first remove it from this
2457+ list, and return it to the start of
2458+ the list when the i/o ends;
2459+ log files and the system tablespace are
2460+ not put to this list: they are opened
2461+ after the startup, and kept open until
2462+ shutdown */
2463+ UT_LIST_BASE_NODE_T(fil_space_t) unflushed_spaces;
2464+ /*!< base node for the list of those
2465+ tablespaces whose files contain
2466+ unflushed writes; those spaces have
2467+ at least one file node where
2468+ modification_counter > flush_counter */
2469+ ulint n_open; /*!< number of files currently open */
2470+ ulint max_n_open; /*!< n_open is not allowed to exceed
2471+ this */
2472+ ib_int64_t modification_counter;/*!< when we write to a file we
2473+ increment this by one */
2474+ ulint max_assigned_id;/*!< maximum space id in the existing
2475+ tables, or assigned during the time
2476+ mysqld has been up; at an InnoDB
2477+ startup we scan the data dictionary
2478+ and set here the maximum of the
2479+ space id's of the tables there */
2480+ ib_int64_t tablespace_version;
2481+ /*!< a counter which is incremented for
2482+ every space object memory creation;
2483+ every space mem object gets a
2484+ 'timestamp' from this; in DISCARD/
2485+ IMPORT this is used to check if we
2486+ should ignore an insert buffer merge
2487+ request */
2488+ UT_LIST_BASE_NODE_T(fil_space_t) space_list;
2489+ /*!< list of all file spaces */
2490+ ibool space_id_reuse_warned;
2491+ /* !< TRUE if fil_space_create()
2492+ has issued a warning about
2493+ potential space_id reuse */
2494+};
2495+
2496+/** The tablespace memory cache. This variable is NULL before the module is
2497+initialized. */
2498+extern fil_system_t* fil_system;
2499+
2500 /** The number of fsyncs done to the log */
2501 extern ulint fil_n_log_flushes;
2502
2503@@ -371,12 +550,6 @@
2504 contain sensible data */
2505 ulint* flags, /*!< out: tablespace flags */
2506 ulint* space_id, /*!< out: tablespace ID */
2507-#ifdef UNIV_LOG_ARCHIVE
2508- ulint* min_arch_log_no, /*!< out: min of archived
2509- log numbers in data files */
2510- ulint* max_arch_log_no, /*!< out: max of archived
2511- log numbers in data files */
2512-#endif /* UNIV_LOG_ARCHIVE */
2513 lsn_t* min_flushed_lsn, /*!< out: min of flushed
2514 lsn values in data files */
2515 lsn_t* max_flushed_lsn); /*!< out: max of flushed
2516@@ -608,7 +781,7 @@
2517 @return DB_SUCCESS or error number */
2518 UNIV_INTERN
2519 dberr_t
2520-fil_load_single_table_tablespaces(void);
2521+fil_load_single_table_tablespaces(ibool (*pred)(const char*, const char*));
2522 /*===================================*/
2523 /*******************************************************************//**
2524 Returns TRUE if a single-table tablespace does not exist in the memory cache,
2525@@ -982,5 +1155,42 @@
2526 mtr_t* mtr) /*!< in/out: mini-transaction */
2527 __attribute__((nonnull));
2528
2529+/***********************************************************************//**
2530+A fault-tolerant function that tries to read the next file name in the
2531+directory. We retry 100 times if os_file_readdir_next_file() returns -1. The
2532+idea is to read as much good data as we can and jump over bad data.
2533+@return 0 if ok, -1 if error even after the retries, 1 if at the end
2534+of the directory */
2535+UNIV_INTERN
2536+int
2537+fil_file_readdir_next_file(
2538+/*=======================*/
2539+ dberr_t* err, /*!< out: this is set to DB_ERROR if an error
2540+ was encountered, otherwise not changed */
2541+ const char* dirname,/*!< in: directory name or path */
2542+ os_file_dir_t dir, /*!< in: directory stream */
2543+ os_file_stat_t* info); /*!< in/out: buffer where the
2544+ info is returned */
2545+
2546+/*******************************************************************//**
2547+Returns the table space by a given id, NULL if not found. */
2548+UNIV_INLINE
2549+fil_space_t*
2550+fil_space_get_by_id(
2551+/*================*/
2552+ ulint id); /*!< in: space id */
2553+
2554+/*******************************************************************//**
2555+Returns the table space by a given name, NULL if not found. */
2556+UNIV_INLINE
2557+fil_space_t*
2558+fil_space_get_by_name(
2559+/*==================*/
2560+ const char* name); /*!< in: space name */
2561+
2562+#ifndef UNIV_NONINL
2563+#include "fil0fil.ic"
2564+#endif
2565+
2566 #endif /* !UNIV_INNOCHECKSUM */
2567 #endif /* fil0fil_h */
2568
2569=== added file 'storage/innobase/include/fil0fil.ic'
2570--- storage/innobase/include/fil0fil.ic 1970-01-01 00:00:00 +0000
2571+++ storage/innobase/include/fil0fil.ic 2013-11-27 10:34:29 +0000
2572@@ -0,0 +1,62 @@
2573+/*****************************************************************************
2574+
2575+Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
2576+
2577+This program is free software; you can redistribute it and/or modify it under
2578+the terms of the GNU General Public License as published by the Free Software
2579+Foundation; version 2 of the License.
2580+
2581+This program is distributed in the hope that it will be useful, but WITHOUT
2582+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
2583+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
2584+
2585+You should have received a copy of the GNU General Public License along with
2586+this program; if not, write to the Free Software Foundation, Inc.,
2587+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
2588+
2589+*****************************************************************************/
2590+
2591+#include "univ.i"
2592+
2593+/*******************************************************************//**
2594+Returns the table space by a given id, NULL if not found. */
2595+UNIV_INLINE
2596+fil_space_t*
2597+fil_space_get_by_id(
2598+/*================*/
2599+ ulint id) /*!< in: space id */
2600+{
2601+ fil_space_t* space;
2602+
2603+ ut_ad(mutex_own(&fil_system->mutex));
2604+
2605+ HASH_SEARCH(hash, fil_system->spaces, id,
2606+ fil_space_t*, space,
2607+ ut_ad(space->magic_n == FIL_SPACE_MAGIC_N),
2608+ space->id == id);
2609+
2610+ return(space);
2611+}
2612+
2613+/*******************************************************************//**
2614+Returns the table space by a given name, NULL if not found. */
2615+UNIV_INLINE
2616+fil_space_t*
2617+fil_space_get_by_name(
2618+/*==================*/
2619+ const char* name) /*!< in: space name */
2620+{
2621+ fil_space_t* space;
2622+ ulint fold;
2623+
2624+ ut_ad(mutex_own(&fil_system->mutex));
2625+
2626+ fold = ut_fold_string(name);
2627+
2628+ HASH_SEARCH(name_hash, fil_system->name_hash, fold,
2629+ fil_space_t*, space,
2630+ ut_ad(space->magic_n == FIL_SPACE_MAGIC_N),
2631+ !strcmp(name, space->name));
2632+
2633+ return(space);
2634+}
2635
2636=== modified file 'storage/innobase/include/ha_prototypes.h'
2637--- storage/innobase/include/ha_prototypes.h 2013-03-01 12:25:26 +0000
2638+++ storage/innobase/include/ha_prototypes.h 2013-11-27 10:34:29 +0000
2639@@ -41,6 +41,22 @@
2640 class Field;
2641 struct fts_string_t;
2642
2643+/** Possible values for system variable "innodb_checksum_algorithm". */
2644+extern const char* innodb_checksum_algorithm_names[];
2645+
2646+/** Used to define an enumerate type of the system variable
2647+innodb_checksum_algorithm. */
2648+extern TYPELIB innodb_checksum_algorithm_typelib;
2649+
2650+/****************************************************************//**
2651+Update log_checksum_algorithm_ptr with a pointer to the function corresponding
2652+to a given checksum algorithm. */
2653+UNIV_INTERN
2654+void
2655+innodb_log_checksum_func_update(
2656+/*============================*/
2657+ ulint algorithm); /*!< in: algorithm */
2658+
2659 /*********************************************************************//**
2660 Wrapper around MySQL's copy_and_convert function.
2661 @return number of bytes copied to 'to' */
2662
2663=== modified file 'storage/innobase/include/log0log.h'
2664--- storage/innobase/include/log0log.h 2012-09-20 10:07:57 +0000
2665+++ storage/innobase/include/log0log.h 2013-11-27 10:34:29 +0000
2666@@ -62,6 +62,15 @@
2667 # define log_do_write TRUE
2668 #endif /* UNIV_DEBUG */
2669
2670+/** Magic value to use instead of log checksums when they are disabled */
2671+#define LOG_NO_CHECKSUM_MAGIC 0xDEADBEEFUL
2672+
2673+typedef ulint (*log_checksum_func_t)(const byte* log_block);
2674+
2675+/** Pointer to the log checksum calculation function. Protected with
2676+log_sys->mutex. */
2677+extern log_checksum_func_t log_checksum_algorithm_ptr;
2678+
2679 /** Wait modes for log_write_up_to @{ */
2680 #define LOG_NO_WAIT 91
2681 #define LOG_WAIT_ONE_GROUP 92
2682@@ -70,6 +79,10 @@
2683 /** Maximum number of log groups in log_group_t::checkpoint_buf */
2684 #define LOG_MAX_N_GROUPS 32
2685
2686+#define IB_ARCHIVED_LOGS_PREFIX "ib_log_archive_"
2687+#define IB_ARCHIVED_LOGS_PREFIX_LEN (sizeof(IB_ARCHIVED_LOGS_PREFIX) - 1)
2688+#define IB_ARCHIVED_LOGS_SERIAL_LEN 20
2689+
2690 /*******************************************************************//**
2691 Calculates where in log files we find a specified lsn.
2692 @return log file number */
2693@@ -340,8 +353,18 @@
2694 log_archived_file_name_gen(
2695 /*=======================*/
2696 char* buf, /*!< in: buffer where to write */
2697+ ulint buf_len,/*!< in: buffer length */
2698 ulint id, /*!< in: group id */
2699- ulint file_no);/*!< in: file number */
2700+ lsn_t file_no);/*!< in: file number */
2701+
2702+UNIV_INTERN
2703+void
2704+log_archived_get_offset(
2705+/*====================*/
2706+ log_group_t* group, /*!< in: log group */
2707+ lsn_t file_no, /*!< in: archive log file number */
2708+ lsn_t archived_lsn, /*!< in: last archived LSN */
2709+ lsn_t* offset); /*!< out: offset within archived file */
2710 #else /* !UNIV_HOTBACKUP */
2711 /******************************************************//**
2712 Writes info to a buffer of a log group when log files are created in
2713@@ -681,6 +704,9 @@
2714 when mysqld is first time started
2715 on the restored database, it can
2716 print helpful info for the user */
2717+#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
2718+ /* extend to record log_block_size
2719+ of XtraDB. 0 means default 512 */
2720 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
2721 /* this 4-byte field is TRUE when
2722 the writing of an archived log file
2723@@ -736,19 +762,19 @@
2724 ulint archive_space_id;/*!< file space which
2725 implements the log group
2726 archive */
2727- ulint archived_file_no;/*!< file number corresponding to
2728+ lsn_t archived_file_no;/*!< file number corresponding to
2729 log_sys->archived_lsn */
2730- ulint archived_offset;/*!< file offset corresponding to
2731+ lsn_t archived_offset;/*!< file offset corresponding to
2732 log_sys->archived_lsn, 0 if we have
2733 not yet written to the archive file
2734 number archived_file_no */
2735- ulint next_archived_file_no;/*!< during an archive write,
2736+ lsn_t next_archived_file_no;/*!< during an archive write,
2737 until the write is completed, we
2738 store the next value for
2739 archived_file_no here: the write
2740 completion function then sets the new
2741 value to ..._file_no */
2742- ulint next_archived_offset; /*!< like the preceding field */
2743+ lsn_t next_archived_offset; /*!< like the preceding field */
2744 #endif /* UNIV_LOG_ARCHIVE */
2745 /*-----------------------------*/
2746 lsn_t scanned_lsn; /*!< used only in recovery: recovery scan
2747
2748=== modified file 'storage/innobase/include/log0log.ic'
2749--- storage/innobase/include/log0log.ic 2012-05-29 21:49:04 +0000
2750+++ storage/innobase/include/log0log.ic 2013-11-27 10:34:29 +0000
2751@@ -27,6 +27,8 @@
2752 #include "mach0data.h"
2753 #include "mtr0mtr.h"
2754 #include "srv0mon.h"
2755+#include "srv0srv.h"
2756+#include "ut0crc32.h"
2757
2758 #ifdef UNIV_LOG_DEBUG
2759 /******************************************************//**
2760@@ -199,7 +201,7 @@
2761 }
2762
2763 /************************************************************//**
2764-Calculates the checksum for a log block.
2765+Calculates the checksum for a log block using the current algorithm.
2766 @return checksum */
2767 UNIV_INLINE
2768 ulint
2769@@ -207,6 +209,17 @@
2770 /*====================*/
2771 const byte* block) /*!< in: log block */
2772 {
2773+ return(log_checksum_algorithm_ptr(block));
2774+}
2775+/************************************************************//**
2776+Calculates the checksum for a log block using the default InnoDB algorithm.
2777+@return checksum */
2778+UNIV_INLINE
2779+ulint
2780+log_block_calc_checksum_innodb(
2781+/*===========================*/
2782+ const byte* block) /*!< in: log block */
2783+{
2784 ulint sum;
2785 ulint sh;
2786 ulint i;
2787@@ -229,6 +242,30 @@
2788 }
2789
2790 /************************************************************//**
2791+Calculates the checksum for a log block using the CRC32 algorithm.
2792+@return checksum */
2793+UNIV_INLINE
2794+ulint
2795+log_block_calc_checksum_crc32(
2796+/*==========================*/
2797+ const byte* block) /*!< in: log block */
2798+{
2799+ return(ut_crc32(block, OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE));
2800+}
2801+
2802+/************************************************************//**
2803+Calculates the checksum for a log block using the "no-op" algorithm.
2804+@return checksum */
2805+UNIV_INLINE
2806+ulint
2807+log_block_calc_checksum_none(
2808+/*=========================*/
2809+ const byte* block) /*!< in: log block */
2810+{
2811+ return(LOG_NO_CHECKSUM_MAGIC);
2812+}
2813+
2814+/************************************************************//**
2815 Gets a log block checksum field value.
2816 @return checksum */
2817 UNIV_INLINE
2818
2819=== modified file 'storage/innobase/include/log0recv.h'
2820--- storage/innobase/include/log0recv.h 2012-11-12 15:03:42 +0000
2821+++ storage/innobase/include/log0recv.h 2013-11-27 10:34:29 +0000
2822@@ -297,18 +297,13 @@
2823 Recovers from archived log files, and also from log files, if they exist.
2824 @return error code or DB_SUCCESS */
2825 UNIV_INTERN
2826-ulint
2827+dberr_t
2828 recv_recovery_from_archive_start(
2829 /*=============================*/
2830 lsn_t min_flushed_lsn,/*!< in: min flushed lsn field from the
2831 data files */
2832- lsn_t limit_lsn, /*!< in: recover up to this lsn if
2833+ lsn_t limit_lsn); /*!< in: recover up to this lsn if
2834 possible */
2835- ulint first_log_no); /*!< in: number of the first archived
2836- log file to use in the recovery; the
2837- file will be searched from
2838- INNOBASE_LOG_ARCH_DIR specified in
2839- server config file */
2840 /********************************************************//**
2841 Completes recovery from archive. */
2842 UNIV_INTERN
2843@@ -483,6 +478,37 @@
2844 log records to the database. */
2845 extern ulint recv_n_pool_free_frames;
2846
2847+/***********************************************************************//**
2848+Checks the consistency of the checkpoint info
2849+@return TRUE if ok */
2850+UNIV_INTERN
2851+ibool
2852+recv_check_cp_is_consistent(
2853+/*========================*/
2854+ const byte* buf); /*!< in: buffer containing checkpoint info */
2855+
2856+/******************************************************//**
2857+Checks the 4-byte checksum to the trailer checksum field of a log
2858+block. We also accept a log block in the old format before
2859+InnoDB-3.23.52 where the checksum field contains the log block number.
2860+@return TRUE if ok, or if the log block may be in the format of InnoDB
2861+version predating 3.23.52 */
2862+UNIV_INTERN
2863+ibool
2864+log_block_checksum_is_ok_or_old_format(
2865+/*===================================*/
2866+ const byte* block); /*!< in: pointer to a log block */
2867+
2868+/********************************************************//**
2869+Looks for the maximum consistent checkpoint from the log groups.
2870+@return error code or DB_SUCCESS */
2871+UNIV_INTERN __attribute__((nonnull, warn_unused_result))
2872+dberr_t
2873+recv_find_max_checkpoint(
2874+/*=====================*/
2875+ log_group_t** max_group, /*!< out: max group */
2876+ ulint* max_field); /*!< out: LOG_CHECKPOINT_1 or
2877+ LOG_CHECKPOINT_2 */
2878 #ifndef UNIV_NONINL
2879 #include "log0recv.ic"
2880 #endif
2881
2882=== modified file 'storage/innobase/include/os0file.h'
2883--- storage/innobase/include/os0file.h 2012-12-21 11:00:05 +0000
2884+++ storage/innobase/include/os0file.h 2013-11-27 10:34:29 +0000
2885@@ -99,7 +99,7 @@
2886 if this fails for a log block, then it is equivalent to a media failure in the
2887 log. */
2888
2889-#define OS_FILE_LOG_BLOCK_SIZE 512
2890+#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
2891
2892 /** Options for os_file_create_func @{ */
2893 enum os_file_create_t {
2894@@ -202,6 +202,10 @@
2895 extern ulint os_n_file_writes;
2896 extern ulint os_n_fsyncs;
2897
2898+#define OS_MIN_LOG_BLOCK_SIZE 512
2899+
2900+extern ulint srv_log_block_size;
2901+
2902 #ifdef UNIV_PFS_IO
2903 /* Keys to register InnoDB I/O with performance schema */
2904 extern mysql_pfs_key_t innodb_file_data_key;
2905
2906=== modified file 'storage/innobase/include/srv0srv.h'
2907--- storage/innobase/include/srv0srv.h 2012-12-17 15:16:10 +0000
2908+++ storage/innobase/include/srv0srv.h 2013-11-27 10:34:29 +0000
2909@@ -348,11 +348,20 @@
2910 extern ulong srv_doublewrite_batch_size;
2911 extern ulong srv_checksum_algorithm;
2912
2913+extern ibool srv_fast_checksum;
2914+
2915 extern ulong srv_max_buf_pool_modified_pct;
2916 extern ulong srv_max_purge_lag;
2917 extern ulong srv_max_purge_lag_delay;
2918
2919 extern ulong srv_replication_delay;
2920+
2921+extern ulint srv_log_checksum_algorithm;
2922+
2923+extern ibool srv_apply_log_only;
2924+
2925+extern ibool srv_backup_mode;
2926+
2927 /*-------------------------------------------*/
2928
2929 extern ibool srv_print_innodb_monitor;
2930
2931=== modified file 'storage/innobase/include/srv0start.h'
2932--- storage/innobase/include/srv0start.h 2013-01-28 11:23:26 +0000
2933+++ storage/innobase/include/srv0start.h 2013-11-27 10:34:29 +0000
2934@@ -36,6 +36,9 @@
2935 #define SRV_PATH_SEPARATOR '/'
2936 #endif
2937
2938+/** Files comprising the system tablespace */
2939+extern os_file_t files[1000];
2940+
2941 /*********************************************************************//**
2942 Normalizes a directory path for Windows: converts slashes to backslashes. */
2943 UNIV_INTERN
2944@@ -68,6 +71,23 @@
2945 srv_add_path_separator_if_needed(
2946 /*=============================*/
2947 char* str); /*!< in: null-terminated character string */
2948+/********************************************************************
2949+Opens the configured number of undo tablespaces.
2950+@return DB_SUCCESS or error code */
2951+UNIV_INTERN
2952+dberr_t
2953+srv_undo_tablespaces_init(
2954+/*======================*/
2955+ ibool create_new_db, /*!< in: TRUE if new db being
2956+ created */
2957+ ibool backup_mode, /*!< in: TRUE disables reading
2958+ the system tablespace (used in
2959+ XtraBackup), FALSE is passed on
2960+ recovery. */
2961+ const ulint n_conf_tablespaces, /*!< in: configured undo
2962+ tablespaces */
2963+ ulint* n_opened); /*!< out: number of UNDO
2964+ tablespaces successfully */
2965 #ifndef UNIV_HOTBACKUP
2966 /****************************************************************//**
2967 Starts Innobase and creates a new database if database files
2968@@ -118,6 +138,22 @@
2969 ulint max_len) /*!< in: filename max length */
2970 __attribute__((nonnull));
2971
2972+/*********************************************************************//**
2973+Creates or opens database data files and closes them.
2974+@return DB_SUCCESS or error code */
2975+UNIV_INTERN __attribute__((nonnull, warn_unused_result))
2976+dberr_t
2977+open_or_create_data_files(
2978+/*======================*/
2979+ ibool* create_new_db, /*!< out: TRUE if new database should be
2980+ created */
2981+ lsn_t* min_flushed_lsn,/*!< out: min of flushed lsn
2982+ values in data files */
2983+ lsn_t* max_flushed_lsn,/*!< out: max of flushed lsn
2984+ values in data files */
2985+ ulint* sum_of_new_sizes);/*!< out: sum of sizes of the
2986+ new files added */
2987+
2988 /** Log sequence number at shutdown */
2989 extern lsn_t srv_shutdown_lsn;
2990 /** Log sequence number immediately after startup */
2991
2992=== modified file 'storage/innobase/include/trx0sys.h'
2993--- storage/innobase/include/trx0sys.h 2012-11-12 13:35:10 +0000
2994+++ storage/innobase/include/trx0sys.h 2013-11-27 10:34:29 +0000
2995@@ -463,6 +463,8 @@
2996
2997 /* Space id and page no where the trx system file copy resides */
2998 #define TRX_SYS_SPACE 0 /* the SYSTEM tablespace */
2999+#define TRX_DOUBLEWRITE_SPACE 0xFFFFFFE0UL /* the doublewrite buffer
3000+ tablespace if used */
3001 #include "fsp0fsp.h"
3002 #define TRX_SYS_PAGE_NO FSP_TRX_SYS_PAGE_NO
3003
3004
3005=== modified file 'storage/innobase/include/univ.i'
3006--- storage/innobase/include/univ.i 2013-02-27 17:23:10 +0000
3007+++ storage/innobase/include/univ.i 2013-11-27 10:34:29 +0000
3008@@ -46,6 +46,9 @@
3009 #define INNODB_VERSION_MINOR MYSQL_VERSION_MINOR
3010 #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH
3011
3012+/* Enable UNIV_LOG_ARCHIVE in XtraDB */
3013+#define UNIV_LOG_ARCHIVE 1
3014+
3015 /* The following is the InnoDB version as shown in
3016 SELECT plugin_version FROM information_schema.plugins;
3017 calculated in make_version_string() in sql/sql_show.cc like this:
3018
3019=== modified file 'storage/innobase/include/ut0rnd.h'
3020--- storage/innobase/include/ut0rnd.h 2011-11-21 04:58:23 +0000
3021+++ storage/innobase/include/ut0rnd.h 2013-11-27 10:34:29 +0000
3022@@ -106,6 +106,14 @@
3023 /*===========*/
3024 const char* str) /*!< in: null-terminated string */
3025 __attribute__((pure));
3026+
3027+UNIV_INLINE
3028+ulint
3029+ut_fold_binary_32(
3030+/*==============*/
3031+ const byte* str, /*!< in: string of bytes */
3032+ ulint len) /*!< in: length */
3033+ __attribute__((pure));
3034 /***********************************************************//**
3035 Looks for a prime number slightly greater than the given argument.
3036 The prime is chosen so that it is not near any power of 2.
3037
3038=== modified file 'storage/innobase/include/ut0rnd.ic'
3039--- storage/innobase/include/ut0rnd.ic 2011-12-22 02:47:18 +0000
3040+++ storage/innobase/include/ut0rnd.ic 2013-11-27 10:34:29 +0000
3041@@ -253,3 +253,28 @@
3042
3043 return(fold);
3044 }
3045+
3046+UNIV_INLINE
3047+ulint
3048+ut_fold_binary_32(
3049+/*==============*/
3050+ const byte* str, /*!< in: string of bytes */
3051+ ulint len) /*!< in: length */
3052+{
3053+ const ib_uint32_t* str_end = (const ib_uint32_t*) (str + len);
3054+ const ib_uint32_t* str_32 = (const ib_uint32_t*) str;
3055+ ulint fold = 0;
3056+
3057+ ut_ad(str);
3058+ /* This function is only for word-aligned data */
3059+ ut_ad(len % 4 == 0);
3060+ ut_ad((ulint)str % 4 == 0);
3061+
3062+ while (str_32 < str_end) {
3063+ fold = ut_fold_ulint_pair(fold, (ulint)(*str_32));
3064+
3065+ str_32++;
3066+ }
3067+
3068+ return(fold);
3069+}
3070
3071=== renamed file 'xtrabackup/src/xb0xb.h' => 'storage/innobase/include/xb0xb.h'
3072=== modified file 'storage/innobase/log/log0log.cc'
3073--- storage/innobase/log/log0log.cc 2012-11-16 20:48:21 +0000
3074+++ storage/innobase/log/log0log.cc 2013-11-27 10:34:29 +0000
3075@@ -79,6 +79,10 @@
3076 /* Global log system variable */
3077 UNIV_INTERN log_t* log_sys = NULL;
3078
3079+/** Pointer to the log checksum calculation function */
3080+UNIV_INTERN log_checksum_func_t log_checksum_algorithm_ptr =
3081+ log_block_calc_checksum_innodb;
3082+
3083 #ifdef UNIV_PFS_RWLOCK
3084 UNIV_INTERN mysql_pfs_key_t checkpoint_lock_key;
3085 # ifdef UNIV_LOG_ARCHIVE
3086@@ -896,10 +900,10 @@
3087 mem_zalloc(sizeof(byte**) * n_files));
3088
3089 #ifdef UNIV_LOG_ARCHIVE
3090- group->archive_file_header_bufs_ptr = static_cast<byte*>(
3091+ group->archive_file_header_bufs_ptr = static_cast<byte**>(
3092 mem_zalloc( sizeof(byte*) * n_files));
3093
3094- group->archive_file_header_bufs = static_cast<byte*>(
3095+ group->archive_file_header_bufs = static_cast<byte**>(
3096 mem_zalloc(sizeof(byte*) * n_files));
3097 #endif /* UNIV_LOG_ARCHIVE */
3098
3099@@ -924,7 +928,7 @@
3100 #ifdef UNIV_LOG_ARCHIVE
3101 group->archive_space_id = archive_space_id;
3102
3103- group->archived_file_no = 0;
3104+ group->archived_file_no = LOG_START_LSN;
3105 group->archived_offset = 0;
3106 #endif /* UNIV_LOG_ARCHIVE */
3107
3108@@ -1144,6 +1148,11 @@
3109 /* Wipe over possible label of ibbackup --restore */
3110 memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
3111
3112+ if (srv_log_block_size > 512) {
3113+ mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
3114+ srv_log_block_size);
3115+ }
3116+
3117 dest_offset = nth_file * group->file_size;
3118
3119 #ifdef UNIV_DEBUG
3120@@ -1749,7 +1758,6 @@
3121 log_group_t* group2;
3122 #ifdef UNIV_LOG_ARCHIVE
3123 ib_uint64_t archived_lsn;
3124- ib_uint64_t next_archived_lsn;
3125 #endif /* UNIV_LOG_ARCHIVE */
3126 lsn_t lsn_offset;
3127 ulint write_offset;
3128@@ -1759,9 +1767,7 @@
3129
3130 ut_ad(!srv_read_only_mode);
3131 ut_ad(mutex_own(&(log_sys->mutex)));
3132-#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE
3133-# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE"
3134-#endif
3135+ ut_ad(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
3136
3137 buf = group->checkpoint_buf;
3138
3139@@ -1782,11 +1788,6 @@
3140 archived_lsn = IB_ULONGLONG_MAX;
3141 } else {
3142 archived_lsn = log_sys->archived_lsn;
3143-
3144- if (archived_lsn != log_sys->next_archived_lsn) {
3145- next_archived_lsn = log_sys->next_archived_lsn;
3146- /* For debugging only */
3147- }
3148 }
3149
3150 mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
3151@@ -2225,7 +2226,7 @@
3152 fil_io(OS_FILE_READ | OS_FILE_LOG, sync, group->space_id, 0,
3153 (ulint) (source_offset / UNIV_PAGE_SIZE),
3154 (ulint) (source_offset % UNIV_PAGE_SIZE),
3155- len, buf, NULL);
3156+ len, buf, (type == LOG_ARCHIVE) ? &log_archive_io : NULL);
3157
3158 start_lsn += len;
3159 buf += len;
3160@@ -2244,12 +2245,68 @@
3161 log_archived_file_name_gen(
3162 /*=======================*/
3163 char* buf, /*!< in: buffer where to write */
3164+ ulint buf_len,/*!< in: buffer length */
3165 ulint id __attribute__((unused)),
3166 /*!< in: group id;
3167 currently we only archive the first group */
3168- ulint file_no)/*!< in: file number */
3169-{
3170- sprintf(buf, "%sib_arch_log_%010lu", srv_arch_dir, (ulong) file_no);
3171+ lsn_t file_no)/*!< in: file number */
3172+{
3173+ ulint dirnamelen;
3174+
3175+ dirnamelen = strlen(srv_arch_dir);
3176+
3177+ ut_a(buf_len > dirnamelen +
3178+ IB_ARCHIVED_LOGS_SERIAL_LEN +
3179+ IB_ARCHIVED_LOGS_PREFIX_LEN + 2);
3180+
3181+ strcpy(buf, srv_arch_dir);
3182+
3183+ if (buf[dirnamelen-1] != SRV_PATH_SEPARATOR) {
3184+ buf[dirnamelen++] = SRV_PATH_SEPARATOR;
3185+ }
3186+ sprintf(buf + dirnamelen, IB_ARCHIVED_LOGS_PREFIX
3187+ "%0" IB_TO_STR(IB_ARCHIVED_LOGS_SERIAL_LEN) "llu",
3188+ (unsigned long long) file_no);
3189+}
3190+
3191+/******************************************************//**
3192+Get offset within archived log file to continue to write
3193+with. */
3194+UNIV_INTERN
3195+void
3196+log_archived_get_offset(
3197+/*=====================*/
3198+ log_group_t* group, /*!< in: log group */
3199+ lsn_t file_no, /*!< in: archive log file number */
3200+ lsn_t archived_lsn, /*!< in: last archived LSN */
3201+ lsn_t* offset) /*!< out: offset within archived file */
3202+{
3203+ char file_name[OS_FILE_MAX_PATH];
3204+ ibool exists;
3205+ os_file_type_t type;
3206+
3207+ log_archived_file_name_gen(file_name,
3208+ sizeof(file_name), group->id, file_no);
3209+
3210+ ut_a(os_file_status(file_name, &exists, &type));
3211+
3212+ if (!exists) {
3213+ *offset = 0;
3214+ return;
3215+ }
3216+
3217+ *offset = archived_lsn - file_no + LOG_FILE_HDR_SIZE;
3218+
3219+ if (archived_lsn != IB_ULONGLONG_MAX) {
3220+ *offset = archived_lsn - file_no + LOG_FILE_HDR_SIZE;
3221+ } else {
3222+ /* Archiving was OFF prior startup */
3223+ *offset = 0;
3224+ }
3225+
3226+ ut_a(group->file_size >= *offset + LOG_FILE_HDR_SIZE);
3227+
3228+ return;
3229 }
3230
3231 /******************************************************//**
3232@@ -2287,6 +2344,7 @@
3233 MONITOR_INC(MONITOR_LOG_IO);
3234
3235 fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE, group->archive_space_id,
3236+ 0,
3237 dest_offset / UNIV_PAGE_SIZE,
3238 dest_offset % UNIV_PAGE_SIZE,
3239 2 * OS_FILE_LOG_BLOCK_SIZE,
3240@@ -2322,6 +2380,7 @@
3241 MONITOR_INC(MONITOR_LOG_IO);
3242
3243 fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE, group->archive_space_id,
3244+ 0,
3245 dest_offset / UNIV_PAGE_SIZE,
3246 dest_offset % UNIV_PAGE_SIZE,
3247 OS_FILE_LOG_BLOCK_SIZE,
3248@@ -2376,7 +2435,7 @@
3249 open_mode = OS_FILE_OPEN;
3250 }
3251
3252- log_archived_file_name_gen(name, group->id,
3253+ log_archived_file_name_gen(name, sizeof(name), group->id,
3254 group->archived_file_no + n_files);
3255
3256 file_handle = os_file_create(innodb_file_log_key,
3257@@ -2414,8 +2473,8 @@
3258
3259 /* Add the archive file as a node to the space */
3260
3261- fil_node_create(name, group->file_size / UNIV_PAGE_SIZE,
3262- group->archive_space_id, FALSE);
3263+ ut_a(fil_node_create(name, group->file_size / UNIV_PAGE_SIZE,
3264+ group->archive_space_id, FALSE));
3265
3266 if (next_offset % group->file_size == 0) {
3267 log_group_archive_file_header_write(
3268@@ -2451,6 +2510,7 @@
3269 MONITOR_INC(MONITOR_LOG_IO);
3270
3271 fil_io(OS_FILE_WRITE | OS_FILE_LOG, FALSE, group->archive_space_id,
3272+ 0,
3273 (ulint) (next_offset / UNIV_PAGE_SIZE),
3274 (ulint) (next_offset % UNIV_PAGE_SIZE),
3275 ut_calc_align(len, OS_FILE_LOG_BLOCK_SIZE), buf,
3276@@ -2822,7 +2882,6 @@
3277 trunc_len);
3278 if (increment_file_count) {
3279 group->archived_offset = 0;
3280- group->archived_file_no += 2;
3281 }
3282
3283 #ifdef UNIV_DEBUG
3284@@ -3087,7 +3146,6 @@
3285 /*=======================================*/
3286 {
3287 lsn_t lsn;
3288- ulint arch_log_no;
3289 ulint count = 0;
3290 ulint total_trx;
3291 ulint pending_io;
3292@@ -3304,15 +3362,7 @@
3293 goto loop;
3294 }
3295
3296- arch_log_no = 0;
3297-
3298 #ifdef UNIV_LOG_ARCHIVE
3299- UT_LIST_GET_FIRST(log_sys->log_groups)->archived_file_no;
3300-
3301- if (0 == UT_LIST_GET_FIRST(log_sys->log_groups)->archived_offset) {
3302-
3303- arch_log_no--;
3304- }
3305
3306 log_archive_close_groups(TRUE);
3307 #endif /* UNIV_LOG_ARCHIVE */
3308@@ -3371,7 +3421,16 @@
3309 srv_shutdown_lsn = lsn;
3310
3311 if (!srv_read_only_mode) {
3312- fil_write_flushed_lsn_to_data_files(lsn, arch_log_no);
3313+ /*
3314+ log_sys->lsn is aligned up to the log block size
3315+ in recv_reset_logs(), but if archived logs are applied
3316+ data files must contain exactly the same flushed_lsn
3317+ on which applying was finished
3318+ */
3319+ fil_write_flushed_lsn_to_data_files(
3320+ srv_archive_recovery ? recv_sys->recovered_lsn :
3321+ lsn,
3322+ 0);
3323
3324 fil_flush_file_spaces(FIL_TABLESPACE);
3325 }
3326@@ -3594,7 +3653,7 @@
3327
3328 #ifdef UNIV_LOG_ARCHIVE
3329 rw_lock_free(&log_sys->archive_lock);
3330- os_event_create();
3331+ os_event_free(log_sys->archiving_on);
3332 #endif /* UNIV_LOG_ARCHIVE */
3333
3334 #ifdef UNIV_LOG_DEBUG
3335
3336=== modified file 'storage/innobase/log/log0recv.cc'
3337--- storage/innobase/log/log0recv.cc 2012-11-12 15:03:42 +0000
3338+++ storage/innobase/log/log0recv.cc 2013-11-27 10:34:29 +0000
3339@@ -43,20 +43,25 @@
3340 #include "trx0undo.h"
3341 #include "trx0rec.h"
3342 #include "fil0fil.h"
3343-#ifndef UNIV_HOTBACKUP
3344-# include "buf0rea.h"
3345-# include "srv0srv.h"
3346-# include "srv0start.h"
3347-# include "trx0roll.h"
3348-# include "row0merge.h"
3349-# include "sync0sync.h"
3350-#else /* !UNIV_HOTBACKUP */
3351+#include "buf0rea.h"
3352+#include "srv0srv.h"
3353+#include "srv0start.h"
3354+#include "trx0roll.h"
3355+#include "row0merge.h"
3356+#include "sync0sync.h"
3357+#include "xb0xb.h"
3358+
3359+/** The size of archived log file */
3360+extern ib_uint64_t xtrabackup_arch_file_size;
3361+/** The minimal LSN of found archived log files */
3362+extern ib_uint64_t xtrabackup_arch_first_file_lsn;
3363+/** The maximum LSN of found archived log files */
3364+extern ib_uint64_t xtrabackup_arch_last_file_lsn;
3365
3366 /** This is set to FALSE if the backup was originally taken with the
3367 ibbackup --include regexp option: then we do not want to create tables in
3368 directories which were not included */
3369 UNIV_INTERN ibool recv_replay_file_ops = TRUE;
3370-#endif /* !UNIV_HOTBACKUP */
3371
3372 /** Log records are stored in the hash table in chunks at most of this size;
3373 this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */
3374@@ -399,7 +404,7 @@
3375 /* Set appropriate value of recv_n_pool_free_frames. */
3376 if (buf_pool_get_curr_size() >= (10 * 1024 * 1024)) {
3377 /* Buffer pool of size greater than 10 MB. */
3378- recv_n_pool_free_frames = 512;
3379+ recv_n_pool_free_frames = 1024;
3380 }
3381
3382 recv_sys->buf = static_cast<byte*>(ut_malloc(RECV_PARSING_BUF_SIZE));
3383@@ -703,7 +708,7 @@
3384 /***********************************************************************//**
3385 Checks the consistency of the checkpoint info
3386 @return TRUE if ok */
3387-static
3388+UNIV_INTERN
3389 ibool
3390 recv_check_cp_is_consistent(
3391 /*========================*/
3392@@ -733,7 +738,7 @@
3393 /********************************************************//**
3394 Looks for the maximum consistent checkpoint from the log groups.
3395 @return error code or DB_SUCCESS */
3396-static __attribute__((nonnull, warn_unused_result))
3397+UNIV_INTERN __attribute__((nonnull, warn_unused_result))
3398 dberr_t
3399 recv_find_max_checkpoint(
3400 /*=====================*/
3401@@ -893,7 +898,7 @@
3402 InnoDB-3.23.52 where the checksum field contains the log block number.
3403 @return TRUE if ok, or if the log block may be in the format of InnoDB
3404 version predating 3.23.52 */
3405-static
3406+UNIV_INTERN
3407 ibool
3408 log_block_checksum_is_ok_or_old_format(
3409 /*===================================*/
3410@@ -902,12 +907,72 @@
3411 #ifdef UNIV_LOG_DEBUG
3412 return(TRUE);
3413 #endif /* UNIV_LOG_DEBUG */
3414- if (log_block_calc_checksum(block) == log_block_get_checksum(block)) {
3415-
3416- return(TRUE);
3417- }
3418-
3419- if (log_block_get_hdr_no(block) == log_block_get_checksum(block)) {
3420+
3421+ ulint block_checksum = log_block_get_checksum(block);
3422+
3423+ if (UNIV_LIKELY(srv_log_checksum_algorithm ==
3424+ SRV_CHECKSUM_ALGORITHM_NONE ||
3425+ log_block_calc_checksum(block) == block_checksum)) {
3426+
3427+ return(TRUE);
3428+ }
3429+
3430+ if (srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32 ||
3431+ srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB ||
3432+ srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_NONE) {
3433+
3434+ const char* algo = NULL;
3435+
3436+ ib_logf(IB_LOG_LEVEL_ERROR,
3437+ "log block checksum mismatch: expected " ULINTPF ", "
3438+ "calculated checksum " ULINTPF,
3439+ block_checksum,
3440+ log_block_calc_checksum(block));
3441+
3442+ if (block_checksum == LOG_NO_CHECKSUM_MAGIC) {
3443+
3444+ algo = "none";
3445+ } else if (block_checksum ==
3446+ log_block_calc_checksum_crc32(block)) {
3447+
3448+ algo = "crc32";
3449+ } else if (block_checksum ==
3450+ log_block_calc_checksum_innodb(block)) {
3451+
3452+ algo = "innodb";
3453+ }
3454+
3455+ if (algo) {
3456+
3457+ const char* current_algo;
3458+
3459+ current_algo = buf_checksum_algorithm_name(
3460+ (srv_checksum_algorithm_t)
3461+ srv_log_checksum_algorithm);
3462+
3463+ ib_logf(IB_LOG_LEVEL_ERROR,
3464+ "current InnoDB log checksum type: %s, "
3465+ "detected log checksum type: %s",
3466+ current_algo,
3467+ algo);
3468+ }
3469+
3470+ ib_logf(IB_LOG_LEVEL_FATAL,
3471+ "STRICT method was specified for innodb_log_checksum, "
3472+ "so we intentionally assert here.");
3473+ }
3474+
3475+ ut_ad(srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_CRC32 ||
3476+ srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB);
3477+
3478+ if (block_checksum == LOG_NO_CHECKSUM_MAGIC ||
3479+ block_checksum == log_block_calc_checksum_crc32(block) ||
3480+ block_checksum == log_block_calc_checksum_innodb(block)) {
3481+
3482+ return(TRUE);
3483+ }
3484+
3485+ if (log_block_get_hdr_no(block) == block_checksum) {
3486
3487 /* We assume the log block is in the format of
3488 InnoDB version < 3.23.52 and the block is ok */
3489@@ -1588,6 +1653,8 @@
3490 buf_block_get_page_no(block));
3491
3492 if ((recv_addr == NULL)
3493+ /* Fix for http://bugs.mysql.com/bug.php?id=44140 */
3494+ || (recv_addr->state == RECV_BEING_READ && !just_read_in)
3495 || (recv_addr->state == RECV_BEING_PROCESSED)
3496 || (recv_addr->state == RECV_PROCESSED)) {
3497
3498@@ -1677,9 +1744,17 @@
3499 if (page_zip) {
3500 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);
3501 }
3502+
3503+ if (!block->page.is_compacted
3504+ && block->page.is_compacted) {
3505+
3506+ ut_ad(srv_compact_backup);
3507+
3508+ block->page.is_compacted = FALSE;
3509+ }
3510 }
3511
3512- if (recv->start_lsn >= page_lsn) {
3513+ if (!block->page.is_compacted && recv->start_lsn >= page_lsn) {
3514
3515 lsn_t end_lsn;
3516
3517@@ -1868,6 +1943,19 @@
3518 ulint zip_size = fil_space_get_zip_size(space);
3519 ulint page_no = recv_addr->page_no;
3520
3521+ /* By now we have replayed all DDL log records from the
3522+ current batch. Check if the space ID is still valid in
3523+ the entry being processed, and ignore it if it is not.*/
3524+ if (fil_tablespace_deleted_or_being_deleted_in_mem(
3525+ space, -1)) {
3526+
3527+ ut_a(recv_sys->n_addrs);
3528+
3529+ recv_addr->state = RECV_PROCESSED;
3530+ recv_sys->n_addrs--;
3531+
3532+ continue;
3533+ }
3534 if (recv_addr->state == RECV_NOT_PROCESSED) {
3535 if (!has_printed) {
3536 ib_logf(IB_LOG_LEVEL_INFO,
3537@@ -2413,7 +2501,7 @@
3538 || type == MLOG_FILE_RENAME
3539 || type == MLOG_FILE_DELETE) {
3540 ut_a(space);
3541-#ifdef UNIV_HOTBACKUP
3542+
3543 if (recv_replay_file_ops) {
3544
3545 /* In ibbackup --apply-log, replay an .ibd file
3546@@ -2436,7 +2524,6 @@
3547 ut_error;
3548 }
3549 }
3550-#endif
3551 /* In normal mysqld crash recovery we do not try to
3552 replay file operations */
3553 #ifdef UNIV_LOG_LSN_DEBUG
3554@@ -2843,7 +2930,10 @@
3555 = log_block_get_checkpoint_no(log_block);
3556 }
3557
3558- if (data_len < OS_FILE_LOG_BLOCK_SIZE) {
3559+ /* Stop scanning if scanned lsn reaches lsn limit */
3560+ if (data_len < OS_FILE_LOG_BLOCK_SIZE ||
3561+ (recv_sys->limit_lsn &&
3562+ recv_sys->scanned_lsn >= recv_sys->limit_lsn)) {
3563 /* Log data for this group ends here */
3564
3565 finished = TRUE;
3566@@ -2863,8 +2953,14 @@
3567
3568 fprintf(stderr,
3569 "InnoDB: Doing recovery: scanned up to"
3570- " log sequence number " LSN_PF "\n",
3571- *group_scanned_lsn);
3572+ " log sequence number " LSN_PF " (%lu%%)\n",
3573+ *group_scanned_lsn,
3574+ (ulong) ((*group_scanned_lsn
3575+ - recv_sys->parse_start_lsn)
3576+ / (8 * log_group_get_capacity(
3577+ UT_LIST_GET_FIRST(
3578+ log_sys->log_groups))
3579+ / 900)));
3580 }
3581 }
3582
3583@@ -2964,7 +3060,7 @@
3584 ib_logf(IB_LOG_LEVEL_INFO,
3585 "Reading tablespace information from the .ibd files...");
3586
3587- fil_load_single_table_tablespaces();
3588+ fil_load_single_table_tablespaces(NULL);
3589
3590 /* If we are using the doublewrite method, we will
3591 check if there are half-written pages in data files,
3592@@ -3003,6 +3099,7 @@
3593 log_group_t* group;
3594 log_group_t* max_cp_group;
3595 ulint max_cp_field;
3596+ ulint log_hdr_log_block_size;
3597 lsn_t checkpoint_lsn;
3598 ib_uint64_t checkpoint_no;
3599 lsn_t group_scanned_lsn = 0;
3600@@ -3108,14 +3205,33 @@
3601 log_hdr_buf, max_cp_group);
3602 }
3603
3604+ log_hdr_log_block_size
3605+ = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
3606+ if (log_hdr_log_block_size == 0) {
3607+ /* 0 means default value */
3608+ log_hdr_log_block_size = 512;
3609+ }
3610+ if (UNIV_UNLIKELY(log_hdr_log_block_size != srv_log_block_size)) {
3611+ fprintf(stderr,
3612+ "InnoDB: Error: The block size of ib_logfile (" ULINTPF
3613+ ") is not equal to innodb_log_block_size.\n"
3614+ "InnoDB: Error: Suggestion - Recreate log files.\n",
3615+ log_hdr_log_block_size);
3616+ return(DB_ERROR);
3617+ }
3618+
3619 #ifdef UNIV_LOG_ARCHIVE
3620 group = UT_LIST_GET_FIRST(log_sys->log_groups);
3621
3622 while (group) {
3623+ /* There is no need to read archived_file_no and
3624+ archived_offset because they are calculated another
3625+ way */
3626+ /*
3627 log_checkpoint_get_nth_group_info(buf, group->id,
3628 &(group->archived_file_no),
3629 &(group->archived_offset));
3630-
3631+ */
3632 group = UT_LIST_GET_NEXT(log_groups, group);
3633 }
3634 #endif /* UNIV_LOG_ARCHIVE */
3635@@ -3456,7 +3572,8 @@
3636 that the data dictionary tables will be free of any locks.
3637 The data dictionary latch should guarantee that there is at
3638 most one data dictionary transaction active at a time. */
3639- if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) {
3640+ if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO
3641+ && !srv_apply_log_only) {
3642 trx_rollback_or_clean_recovered(FALSE);
3643 }
3644 }
3645@@ -3685,23 +3802,23 @@
3646 ulint len;
3647 ibool ret;
3648 byte* buf;
3649- os_offset_t read_offset;
3650+ os_offset_t read_offset = 0;
3651 os_offset_t file_size;
3652 int input_char;
3653- char name[10000];
3654+ char name[OS_FILE_MAX_PATH];
3655
3656- ut_a(0);
3657
3658 try_open_again:
3659 buf = log_sys->buf;
3660
3661 /* Add the file to the archive file space; open the file */
3662
3663- log_archived_file_name_gen(name, group->id, group->archived_file_no);
3664+ log_archived_file_name_gen(name, sizeof(name),
3665+ group->id, group->archived_file_no);
3666
3667 file_handle = os_file_create(innodb_file_log_key,
3668 name, OS_FILE_OPEN,
3669- OS_FILE_LOG, OS_FILE_AIO, &ret);
3670+ OS_FILE_AIO, OS_LOG_FILE, &ret);
3671
3672 if (ret == FALSE) {
3673 ask_again:
3674@@ -3746,20 +3863,19 @@
3675
3676 /* Add the archive file as a node to the space */
3677
3678- fil_node_create(name, 1 + file_size / UNIV_PAGE_SIZE,
3679- group->archive_space_id, FALSE);
3680-#if RECV_SCAN_SIZE < LOG_FILE_HDR_SIZE
3681-# error "RECV_SCAN_SIZE < LOG_FILE_HDR_SIZE"
3682-#endif
3683+ ut_a(fil_node_create(name, 1 + file_size / UNIV_PAGE_SIZE,
3684+ group->archive_space_id, FALSE));
3685+ ut_a(RECV_SCAN_SIZE >= LOG_FILE_HDR_SIZE);
3686
3687 /* Read the archive file header */
3688- fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE, group->archive_space_id, 0, 0,
3689+ fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE, group->archive_space_id, 0,
3690+ 0, 0,
3691 LOG_FILE_HDR_SIZE, buf, NULL);
3692
3693 /* Check if the archive file header is consistent */
3694
3695 if (mach_read_from_4(buf + LOG_GROUP_ID) != group->id
3696- || mach_read_from_4(buf + LOG_FILE_NO)
3697+ || mach_read_from_8(buf + LOG_FILE_START_LSN)
3698 != group->archived_file_no) {
3699 fprintf(stderr,
3700 "InnoDB: Archive file header inconsistent %s\n", name);
3701@@ -3788,6 +3904,20 @@
3702 return(TRUE);
3703 }
3704
3705+ /*
3706+ if this is the first file of scanning set
3707+ calculate offset of the first log record
3708+ */
3709+ if (recv_sys->parse_start_lsn >= start_lsn &&
3710+ recv_sys->parse_start_lsn < file_end_lsn) {
3711+ read_offset = ut_calc_align_down(
3712+ recv_sys->parse_start_lsn - start_lsn,
3713+ OS_FILE_LOG_BLOCK_SIZE);
3714+ start_lsn = ut_calc_align_down(
3715+ recv_sys->parse_start_lsn,
3716+ OS_FILE_LOG_BLOCK_SIZE);
3717+ }
3718+
3719 recv_sys->scanned_lsn = start_lsn;
3720 }
3721
3722@@ -3800,7 +3930,7 @@
3723 return(TRUE);
3724 }
3725
3726- read_offset = LOG_FILE_HDR_SIZE;
3727+ read_offset += LOG_FILE_HDR_SIZE;
3728
3729 for (;;) {
3730 len = RECV_SCAN_SIZE;
3731@@ -3820,13 +3950,13 @@
3732 fprintf(stderr,
3733 "InnoDB: Archive read starting at"
3734 " lsn %llu, len %lu from file %s\n",
3735- start_lsn,
3736+ (unsigned long long) start_lsn,
3737 (ulong) len, name);
3738 }
3739 #endif /* UNIV_DEBUG */
3740
3741 fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE,
3742- group->archive_space_id, read_offset / UNIV_PAGE_SIZE,
3743+ group->archive_space_id, 0, read_offset / UNIV_PAGE_SIZE,
3744 read_offset % UNIV_PAGE_SIZE, len, buf, NULL);
3745
3746 ret = recv_scan_log_recs(
3747@@ -3841,10 +3971,12 @@
3748 }
3749
3750 if (ret) {
3751- fprintf(stderr,
3752- "InnoDB: Archive log file %s"
3753- " does not scan right\n",
3754- name);
3755+ if (recv_sys->scanned_lsn < recv_sys->limit_lsn) {
3756+ fprintf(stderr,
3757+ "InnoDB: Archive log file %s"
3758+ " does not scan right\n",
3759+ name);
3760+ }
3761 return(TRUE);
3762 }
3763
3764@@ -3861,26 +3993,18 @@
3765 Recovers from archived log files, and also from log files, if they exist.
3766 @return error code or DB_SUCCESS */
3767 UNIV_INTERN
3768-ulint
3769+dberr_t
3770 recv_recovery_from_archive_start(
3771 /*=============================*/
3772 ib_uint64_t min_flushed_lsn,/*!< in: min flushed lsn field from the
3773 data files */
3774- ib_uint64_t limit_lsn, /*!< in: recover up to this lsn if
3775+ ib_uint64_t limit_lsn) /*!< in: recover up to this lsn if
3776 possible */
3777- ulint first_log_no) /*!< in: number of the first archived
3778- log file to use in the recovery; the
3779- file will be searched from
3780- INNOBASE_LOG_ARCH_DIR specified in
3781- server config file */
3782 {
3783 log_group_t* group;
3784 ulint group_id;
3785 ulint trunc_len;
3786 ibool ret;
3787- ulint err;
3788-
3789- ut_a(0);
3790
3791 recv_sys_create();
3792 recv_sys_init(buf_pool_get_curr_size());
3793@@ -3910,7 +4034,7 @@
3794 return(DB_ERROR);
3795 }
3796
3797- group->archived_file_no = first_log_no;
3798+ group->archived_file_no = xtrabackup_arch_first_file_lsn;
3799
3800 recv_sys->parse_start_lsn = min_flushed_lsn;
3801
3802@@ -3924,7 +4048,8 @@
3803
3804 mutex_enter(&(log_sys->mutex));
3805
3806- while (!ret) {
3807+ while (!ret &&
3808+ group->archived_file_no <= xtrabackup_arch_last_file_lsn) {
3809 ret = log_group_recover_from_archive_file(group);
3810
3811 /* Close and truncate a possible processed archive file
3812@@ -3937,9 +4062,9 @@
3813 trunc_len);
3814 }
3815
3816- group->archived_file_no++;
3817+ group->archived_file_no += group->file_size - LOG_FILE_HDR_SIZE;
3818 }
3819-
3820+/*
3821 if (recv_sys->recovered_lsn < limit_lsn) {
3822
3823 if (!recv_sys->scanned_lsn) {
3824@@ -3960,12 +4085,12 @@
3825
3826 mutex_enter(&(log_sys->mutex));
3827 }
3828-
3829+*/
3830 if (limit_lsn != IB_ULONGLONG_MAX) {
3831
3832 recv_apply_hashed_log_recs(FALSE);
3833
3834- recv_reset_logs(0, FALSE, recv_sys->recovered_lsn);
3835+ // recv_reset_logs(0, FALSE, recv_sys->recovered_lsn);
3836 }
3837
3838 mutex_exit(&(log_sys->mutex));
3839
3840=== modified file 'storage/innobase/mem/mem0dbg.cc'
3841--- storage/innobase/mem/mem0dbg.cc 2012-08-30 07:46:21 +0000
3842+++ storage/innobase/mem/mem0dbg.cc 2013-11-27 10:34:29 +0000
3843@@ -278,18 +278,10 @@
3844 byte* buf, /*!< in: pointer to buffer */
3845 ulint n) /*!< in: length of buffer */
3846 {
3847- byte* ptr;
3848-
3849 UNIV_MEM_ASSERT_W(buf, n);
3850
3851- for (ptr = buf; ptr < buf + n; ptr++) {
3852-
3853- if (ut_rnd_gen_ibool()) {
3854- *ptr = 0xBA;
3855- } else {
3856- *ptr = 0xBE;
3857- }
3858- }
3859+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
3860+ memset(buf, 0xBA, n);
3861
3862 UNIV_MEM_INVALID(buf, n);
3863 }
3864@@ -304,17 +296,10 @@
3865 byte* buf, /*!< in: pointer to buffer */
3866 ulint n) /*!< in: length of buffer */
3867 {
3868- byte* ptr;
3869-
3870 UNIV_MEM_ASSERT_W(buf, n);
3871
3872- for (ptr = buf; ptr < buf + n; ptr++) {
3873- if (ut_rnd_gen_ibool()) {
3874- *ptr = 0xDE;
3875- } else {
3876- *ptr = 0xAD;
3877- }
3878- }
3879+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
3880+ memset(buf, 0xDE, n);
3881
3882 UNIV_MEM_FREE(buf, n);
3883 }
3884
3885=== modified file 'storage/innobase/os/os0file.cc'
3886--- storage/innobase/os/os0file.cc 2012-12-28 20:27:29 +0000
3887+++ storage/innobase/os/os0file.cc 2013-11-27 10:34:29 +0000
3888@@ -699,7 +699,7 @@
3889 }
3890
3891 #undef USE_FILE_LOCK
3892-#define USE_FILE_LOCK
3893+//#define USE_FILE_LOCK
3894 #if defined(UNIV_HOTBACKUP) || defined(__WIN__)
3895 /* InnoDB Hot Backup does not lock the data files.
3896 * On Windows, mandatory locking is used.
3897
3898=== modified file 'storage/innobase/page/page0cur.cc'
3899--- storage/innobase/page/page0cur.cc 2013-02-27 08:14:03 +0000
3900+++ storage/innobase/page/page0cur.cc 2013-11-27 10:34:29 +0000
3901@@ -1207,7 +1207,9 @@
3902 == index->id || mtr->inside_ibuf || recv_recovery_is_on());
3903
3904 ut_ad(!page_cur_is_after_last(cursor));
3905-#ifdef UNIV_ZIP_DEBUG
3906+#if 0
3907+ /* Disabled to speedup compact_compressed test for debug XtraBackup
3908+ builds, see LP bug #1213036. */
3909 ut_a(page_zip_validate(page_zip, page, index));
3910 #endif /* UNIV_ZIP_DEBUG */
3911
3912
3913=== modified file 'storage/innobase/srv/srv0srv.cc'
3914--- storage/innobase/srv/srv0srv.cc 2013-02-27 19:05:36 +0000
3915+++ storage/innobase/srv/srv0srv.cc 2013-11-27 10:34:29 +0000
3916@@ -239,6 +239,10 @@
3917
3918 /* Switch to enable random read ahead. */
3919 UNIV_INTERN my_bool srv_random_read_ahead = FALSE;
3920+
3921+/* The log block size */
3922+UNIV_INTERN ulint srv_log_block_size = 0;
3923+
3924 /* User settable value of the number of pages that must be present
3925 in the buffer cache and accessed sequentially for InnoDB to trigger a
3926 readahead request. */
3927@@ -341,6 +345,8 @@
3928
3929 UNIV_INTERN ibool srv_use_doublewrite_buf = TRUE;
3930
3931+UNIV_INTERN ibool srv_fast_checksum = FALSE;
3932+
3933 /** doublewrite buffer is 1MB is size i.e.: it can hold 128 16K pages.
3934 The following parameter is the size of the buffer that is used for
3935 batch flushing i.e.: LRU flushing and flush_list flushing. The rest
3936@@ -349,6 +355,13 @@
3937
3938 UNIV_INTERN ulong srv_replication_delay = 0;
3939
3940+UNIV_INTERN ibool srv_apply_log_only = FALSE;
3941+
3942+UNIV_INTERN ibool srv_backup_mode = FALSE;
3943+
3944+UNIV_INTERN ulint srv_log_checksum_algorithm =
3945+ SRV_CHECKSUM_ALGORITHM_INNODB;
3946+
3947 /*-------------------------------------------*/
3948 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
3949 UNIV_INTERN ulong srv_spin_wait_delay = 6;
3950@@ -1814,7 +1827,8 @@
3951 if (ret == SRV_NONE
3952 && srv_shutdown_state != SRV_SHUTDOWN_NONE
3953 && trx_purge_state() != PURGE_STATE_DISABLED
3954- && trx_purge_state() != PURGE_STATE_EXIT) {
3955+ && trx_purge_state() != PURGE_STATE_EXIT
3956+ && trx_purge_state() != PURGE_STATE_INIT) {
3957
3958 ret = SRV_PURGE;
3959 }
3960
3961=== modified file 'storage/innobase/srv/srv0start.cc'
3962--- storage/innobase/srv/srv0start.cc 2013-02-27 19:05:36 +0000
3963+++ storage/innobase/srv/srv0start.cc 2013-11-27 10:34:29 +0000
3964@@ -63,6 +63,7 @@
3965 #include "ibuf0ibuf.h"
3966 #include "srv0start.h"
3967 #include "srv0srv.h"
3968+#include "xb0xb.h"
3969 #ifndef UNIV_HOTBACKUP
3970 # include "trx0rseg.h"
3971 # include "os0proc.h"
3972@@ -121,7 +122,7 @@
3973 UNIV_INTERN enum srv_shutdown_state srv_shutdown_state = SRV_SHUTDOWN_NONE;
3974
3975 /** Files comprising the system tablespace */
3976-static os_file_t files[1000];
3977+os_file_t files[1000];
3978
3979 /** io_handler_thread parameters for thread identification */
3980 static ulint n[SRV_MAX_N_IO_THREADS + 6];
3981@@ -640,6 +641,12 @@
3982 }
3983 }
3984
3985+#ifdef UNIV_LOG_ARCHIVE
3986+ /* Create the file space object for archived logs. */
3987+ fil_space_create("arch_log_space", SRV_LOG_SPACE_FIRST_ID + 1,
3988+ 0, FIL_LOG);
3989+#endif
3990+
3991 log_group_init(0, srv_n_log_files,
3992 srv_log_file_size * UNIV_PAGE_SIZE,
3993 SRV_LOG_SPACE_FIRST_ID,
3994@@ -650,7 +657,12 @@
3995 /* Create a log checkpoint. */
3996 mutex_enter(&log_sys->mutex);
3997 ut_d(recv_no_log_write = FALSE);
3998- recv_reset_logs(lsn);
3999+ recv_reset_logs(
4000+#ifdef UNIV_LOG_ARCHIVE
4001+ UT_LIST_GET_FIRST(log_sys->log_groups)->archived_file_no,
4002+ TRUE,
4003+#endif
4004+ lsn);
4005 mutex_exit(&log_sys->mutex);
4006
4007 return(DB_SUCCESS);
4008@@ -731,18 +743,12 @@
4009 /*********************************************************************//**
4010 Creates or opens database data files and closes them.
4011 @return DB_SUCCESS or error code */
4012-static __attribute__((nonnull, warn_unused_result))
4013+UNIV_INTERN __attribute__((nonnull, warn_unused_result))
4014 dberr_t
4015 open_or_create_data_files(
4016 /*======================*/
4017 ibool* create_new_db, /*!< out: TRUE if new database should be
4018 created */
4019-#ifdef UNIV_LOG_ARCHIVE
4020- ulint* min_arch_log_no,/*!< out: min of archived log
4021- numbers in data files */
4022- ulint* max_arch_log_no,/*!< out: max of archived log
4023- numbers in data files */
4024-#endif /* UNIV_LOG_ARCHIVE */
4025 lsn_t* min_flushed_lsn,/*!< out: min of flushed lsn
4026 values in data files */
4027 lsn_t* max_flushed_lsn,/*!< out: max of flushed lsn
4028@@ -963,9 +969,6 @@
4029 skip_size_check:
4030 fil_read_first_page(
4031 files[i], one_opened, &flags, &space,
4032-#ifdef UNIV_LOG_ARCHIVE
4033- min_arch_log_no, max_arch_log_no,
4034-#endif /* UNIV_LOG_ARCHIVE */
4035 min_flushed_lsn, max_flushed_lsn);
4036
4037 /* The first file of the system tablespace must
4038@@ -973,6 +976,10 @@
4039 field in files greater than ibdata1 are unreliable. */
4040 ut_a(one_opened || space == TRX_SYS_SPACE);
4041
4042+ /* XtraBackup does not validate the page size, because
4043+ innodb_page_size in PS 5.5- is not stored in FSP headers
4044+ and the data dictionary. */
4045+#if 0
4046 /* Check the flags for the first system tablespace
4047 file only. */
4048 if (!one_opened
4049@@ -989,6 +996,7 @@
4050
4051 return(DB_ERROR);
4052 }
4053+#endif
4054
4055 one_opened = TRUE;
4056 } else if (!srv_read_only_mode) {
4057@@ -1204,12 +1212,16 @@
4058 /********************************************************************
4059 Opens the configured number of undo tablespaces.
4060 @return DB_SUCCESS or error code */
4061-static
4062+UNIV_INTERN
4063 dberr_t
4064 srv_undo_tablespaces_init(
4065 /*======================*/
4066 ibool create_new_db, /*!< in: TRUE if new db being
4067 created */
4068+ ibool backup_mode, /*!< in: TRUE disables reading
4069+ the system tablespace (used in
4070+ XtraBackup), FALSE is passed on
4071+ recovery. */
4072 const ulint n_conf_tablespaces, /*!< in: configured undo
4073 tablespaces */
4074 ulint* n_opened) /*!< out: number of UNDO
4075@@ -1225,6 +1237,7 @@
4076 *n_opened = 0;
4077
4078 ut_a(n_conf_tablespaces <= TRX_SYS_N_RSEGS);
4079+ ut_a(!create_new_db || !backup_mode);
4080
4081 memset(undo_tablespace_ids, 0x0, sizeof(undo_tablespace_ids));
4082
4083@@ -1258,12 +1271,13 @@
4084 }
4085 }
4086
4087- /* Get the tablespace ids of all the undo segments excluding
4088- the system tablespace (0). If we are creating a new instance then
4089+ /* Get the tablespace ids of all the undo segments excluding the system
4090+ tablespace (0). If we are creating a new instance then
4091 we build the undo_tablespace_ids ourselves since they don't
4092- already exist. */
4093+ already exist. If we are in the backup mode, don't read the trx header,
4094+ we just need to add all available undo tablespaces to fil_system. */
4095
4096- if (!create_new_db) {
4097+ if (!create_new_db && !backup_mode) {
4098 n_undo_tablespaces = trx_rseg_get_n_undo_tablespaces(
4099 undo_tablespace_ids);
4100 } else {
4101@@ -1369,7 +1383,7 @@
4102 ib_logf(IB_LOG_LEVEL_INFO, "Opened %lu undo tablespaces",
4103 n_undo_tablespaces);
4104
4105- if (n_conf_tablespaces == 0) {
4106+ if (n_conf_tablespaces == 0 && !backup_mode) {
4107 ib_logf(IB_LOG_LEVEL_WARN,
4108 "Using the system tablespace for all UNDO "
4109 "logging because innodb_undo_tablespaces=0");
4110@@ -1442,10 +1456,6 @@
4111 ibool create_new_db;
4112 lsn_t min_flushed_lsn;
4113 lsn_t max_flushed_lsn;
4114-#ifdef UNIV_LOG_ARCHIVE
4115- ulint min_arch_log_no;
4116- ulint max_arch_log_no;
4117-#endif /* UNIV_LOG_ARCHIVE */
4118 ulint sum_of_new_sizes;
4119 ulint sum_of_data_file_sizes;
4120 ulint tablespace_size_in_header;
4121@@ -1670,6 +1680,12 @@
4122
4123 } else if (0 == ut_strcmp(srv_file_flush_method_str, "nosync")) {
4124 srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
4125+ } else if (0 == ut_strcmp(srv_file_flush_method_str, "ALL_O_DIRECT")) {
4126+
4127+ /* ALL_O_DIRECT is currently accepted, but ignored by
4128+ XtraBackup */
4129+ ib_logf(IB_LOG_LEVEL_WARN,
4130+ "ignoring innodb_flush_method=ALL_O_DIRECT\n");
4131 #else
4132 } else if (0 == ut_strcmp(srv_file_flush_method_str, "normal")) {
4133 srv_win_file_flush_method = SRV_WIN_IO_NORMAL;
4134@@ -1883,17 +1899,6 @@
4135 os_thread_create(io_handler_thread, n + i, thread_ids + i);
4136 }
4137
4138-#ifdef UNIV_LOG_ARCHIVE
4139- if (0 != ut_strcmp(srv_log_group_home_dir, srv_arch_dir)) {
4140- ut_print_timestamp(stderr);
4141- fprintf(stderr, " InnoDB: Error: you must set the log group home dir in my.cnf\n");
4142- ut_print_timestamp(stderr);
4143- fprintf(stderr, " InnoDB: the same as log arch dir.\n");
4144-
4145- return(DB_ERROR);
4146- }
4147-#endif /* UNIV_LOG_ARCHIVE */
4148-
4149 if (srv_n_log_files * srv_log_file_size * UNIV_PAGE_SIZE
4150 >= 512ULL * 1024ULL * 1024ULL * 1024ULL) {
4151 /* log_block_convert_lsn_to_no() limits the returned block
4152@@ -1952,9 +1957,6 @@
4153 }
4154
4155 err = open_or_create_data_files(&create_new_db,
4156-#ifdef UNIV_LOG_ARCHIVE
4157- &min_arch_log_no, &max_arch_log_no,
4158-#endif /* UNIV_LOG_ARCHIVE */
4159 &min_flushed_lsn, &max_flushed_lsn,
4160 &sum_of_new_sizes);
4161 if (err == DB_FAIL) {
4162@@ -1982,7 +1984,6 @@
4163
4164 #ifdef UNIV_LOG_ARCHIVE
4165 srv_normalize_path_for_win(srv_arch_dir);
4166- srv_arch_dir = srv_add_path_separator_if_needed(srv_arch_dir);
4167 #endif /* UNIV_LOG_ARCHIVE */
4168
4169 dirnamelen = strlen(srv_log_group_home_dir);
4170@@ -2061,15 +2062,23 @@
4171 max_flushed_lsn, logfile0);
4172
4173 /* Suppress the message about
4174- crash recovery. */
4175- max_flushed_lsn = min_flushed_lsn
4176- = log_get_lsn();
4177+ crash recovery. If archive recovery
4178+ is enabled the min/max_flushed_lsn
4179+ must point to the position from
4180+ which applying is started. */
4181+ if (!srv_archive_recovery) {
4182+ max_flushed_lsn = min_flushed_lsn
4183+ = log_get_lsn();
4184+ }
4185+
4186 goto files_checked;
4187+#if 0
4188 } else if (i < 2) {
4189 /* must have at least 2 log files */
4190 ib_logf(IB_LOG_LEVEL_ERROR,
4191 "Only one log file found.");
4192 return(err);
4193+#endif
4194 }
4195
4196 /* opened all files */
4197@@ -2162,6 +2171,7 @@
4198
4199 err = srv_undo_tablespaces_init(
4200 create_new_db,
4201+ FALSE,
4202 srv_undo_tablespaces,
4203 &srv_undo_tablespaces_open);
4204
4205@@ -2234,10 +2244,13 @@
4206
4207 ib_logf(IB_LOG_LEVEL_INFO,
4208 " Starting archive recovery from a backup...");
4209+ /* Load table spaces before recovery as during recovery
4210+ there can be log records that are applied to the spaces
4211+ with unknown id's */
4212+ fil_load_single_table_tablespaces(NULL);
4213
4214 err = recv_recovery_from_archive_start(
4215- min_flushed_lsn, srv_archive_recovery_limit_lsn,
4216- min_arch_log_no);
4217+ min_flushed_lsn, srv_archive_recovery_limit_lsn);
4218 if (err != DB_SUCCESS) {
4219
4220 return(DB_ERROR);
4221@@ -2261,6 +2274,11 @@
4222 srv_startup_is_before_trx_rollback_phase = FALSE;
4223
4224 recv_recovery_from_archive_finish();
4225+
4226+ if (srv_apply_log_only) {
4227+ goto skip_processes;
4228+ }
4229+
4230 #endif /* UNIV_LOG_ARCHIVE */
4231 } else {
4232
4233@@ -2326,6 +2344,10 @@
4234
4235 recv_recovery_from_checkpoint_finish();
4236
4237+ if (srv_apply_log_only) {
4238+ goto skip_processes;
4239+ }
4240+
4241 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
4242 /* The following call is necessary for the insert
4243 buffer to work with multiple tablespaces. We must
4244@@ -2439,7 +2461,9 @@
4245 value. Important to note that we can do it ONLY after
4246 we have finished the recovery process so that the
4247 image of TRX_SYS_PAGE_NO is not stale. */
4248- trx_sys_file_format_tag_init();
4249+ if (!srv_read_only_mode) {
4250+ trx_sys_file_format_tag_init();
4251+ }
4252 }
4253
4254 if (!create_new_db && sum_of_new_sizes > 0) {
4255@@ -2462,6 +2486,8 @@
4256 if (!srv_log_archive_on) {
4257 ut_a(DB_SUCCESS == log_archive_noarchivelog());
4258 } else {
4259+ bool start_archive;
4260+
4261 mutex_enter(&(log_sys->mutex));
4262
4263 start_archive = FALSE;
4264@@ -2535,6 +2561,8 @@
4265 NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS);
4266 }
4267
4268+ /* Do not re-create system tables in XtraBackup */
4269+#if 0
4270 /* Create the SYS_FOREIGN and SYS_FOREIGN_COLS system tables */
4271 err = dict_create_or_check_foreign_constraint_tables();
4272 if (err != DB_SUCCESS) {
4273@@ -2546,6 +2574,7 @@
4274 if (err != DB_SUCCESS) {
4275 return(err);
4276 }
4277+#endif
4278
4279 srv_is_being_started = FALSE;
4280
4281@@ -2647,6 +2676,7 @@
4282 && srv_auto_extend_last_data_file
4283 && sum_of_data_file_sizes < tablespace_size_in_header) {
4284
4285+#ifdef UNDEFINED
4286 ut_print_timestamp(stderr);
4287 fprintf(stderr,
4288 " InnoDB: Error: tablespace size stored in header"
4289@@ -2683,6 +2713,7 @@
4290
4291 return(DB_ERROR);
4292 }
4293+#endif
4294 }
4295
4296 /* Check that os_fast_mutexes work as expected */
4297@@ -2707,6 +2738,10 @@
4298
4299 os_fast_mutex_free(&srv_os_test_mutex);
4300
4301+ if (srv_rebuild_indexes) {
4302+ xb_compact_rebuild_indexes();
4303+ }
4304+
4305 if (srv_print_verbose_log) {
4306 ib_logf(IB_LOG_LEVEL_INFO,
4307 "%s started; log sequence number " LSN_PF "",
4308@@ -2739,6 +2774,7 @@
4309 fts_optimize_init();
4310 }
4311
4312+skip_processes:
4313 srv_was_started = TRUE;
4314
4315 return(DB_SUCCESS);
4316@@ -2794,7 +2830,7 @@
4317 return(DB_SUCCESS);
4318 }
4319
4320- if (!srv_read_only_mode) {
4321+ if (!srv_read_only_mode && !srv_apply_log_only) {
4322 /* Shutdown the FTS optimize sub system. */
4323 fts_optimize_start_shutdown();
4324
4325
4326=== modified file 'storage/innobase/sync/sync0arr.cc'
4327--- storage/innobase/sync/sync0arr.cc 2013-02-06 20:14:11 +0000
4328+++ storage/innobase/sync/sync0arr.cc 2013-11-27 10:34:29 +0000
4329@@ -42,6 +42,7 @@
4330 #include "lock0lock.h"
4331 #include "srv0srv.h"
4332 #include "ha_prototypes.h"
4333+#include "xb0xb.h"
4334
4335 /*
4336 WAIT ARRAY
4337@@ -899,6 +900,13 @@
4338 ibool fatal = FALSE;
4339 double longest_diff = 0;
4340
4341+ if (srv_rebuild_indexes) {
4342+
4343+ /* Avoid long semaphore waits when rebuilding indexes */
4344+
4345+ return(FALSE);
4346+ }
4347+
4348 /* For huge tables, skip the check during CHECK TABLE etc... */
4349 if (fatal_timeout > SRV_SEMAPHORE_WAIT_EXTENSION) {
4350 return(FALSE);
4351
4352=== modified file 'storage/innobase/trx/trx0rseg.cc'
4353--- storage/innobase/trx/trx0rseg.cc 2011-12-19 08:43:28 +0000
4354+++ storage/innobase/trx/trx0rseg.cc 2013-11-27 10:34:29 +0000
4355@@ -121,9 +121,11 @@
4356
4357 mutex_free(&rseg->mutex);
4358
4359+ if (!srv_apply_log_only) {
4360 /* There can't be any active transactions. */
4361 ut_a(UT_LIST_GET_LEN(rseg->update_undo_list) == 0);
4362 ut_a(UT_LIST_GET_LEN(rseg->insert_undo_list) == 0);
4363+ }
4364
4365 for (undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);
4366 undo != NULL;
4367
4368=== modified file 'storage/innobase/trx/trx0sys.cc'
4369--- storage/innobase/trx/trx0sys.cc 2013-02-08 07:46:26 +0000
4370+++ storage/innobase/trx/trx0sys.cc 2013-11-27 10:34:29 +0000
4371@@ -1185,18 +1185,23 @@
4372 trx_purge_sys_close();
4373
4374 /* Free the double write data structures. */
4375- buf_dblwr_free();
4376+ if (buf_dblwr) {
4377+
4378+ buf_dblwr_free();
4379+ }
4380
4381 mutex_enter(&trx_sys->mutex);
4382
4383 ut_a(UT_LIST_GET_LEN(trx_sys->ro_trx_list) == 0);
4384
4385+ if (!srv_apply_log_only) {
4386 /* Only prepared transactions may be left in the system. Free them. */
4387 ut_a(UT_LIST_GET_LEN(trx_sys->rw_trx_list) == trx_sys->n_prepared_trx);
4388
4389 while ((trx = UT_LIST_GET_FIRST(trx_sys->rw_trx_list)) != NULL) {
4390 trx_free_prepared(trx);
4391 }
4392+ }
4393
4394 /* There can't be any active transactions. */
4395 for (i = 0; i < TRX_SYS_N_RSEGS; ++i) {
4396@@ -1223,10 +1228,12 @@
4397 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
4398 }
4399
4400+ if (!srv_apply_log_only) {
4401 ut_a(UT_LIST_GET_LEN(trx_sys->view_list) == 0);
4402 ut_a(UT_LIST_GET_LEN(trx_sys->ro_trx_list) == 0);
4403 ut_a(UT_LIST_GET_LEN(trx_sys->rw_trx_list) == 0);
4404 ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0);
4405+ }
4406
4407 mutex_exit(&trx_sys->mutex);
4408
4409@@ -1247,6 +1254,10 @@
4410 {
4411 ulint total_trx = 0;
4412
4413+ if (srv_apply_log_only) {
4414+ return(0);
4415+ }
4416+
4417 mutex_enter(&trx_sys->mutex);
4418
4419 total_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list)
4420
4421=== modified file 'storage/innobase/trx/trx0trx.cc'
4422--- storage/innobase/trx/trx0trx.cc 2013-01-29 20:43:38 +0000
4423+++ storage/innobase/trx/trx0trx.cc 2013-11-27 10:34:29 +0000
4424@@ -2084,7 +2084,8 @@
4425 scenario where some undo generated by a transaction,
4426 has XA stuff, and other undo, generated by the same
4427 transaction, doesn't. */
4428- trx->support_xa = thd_supports_xa(trx->mysql_thd);
4429+ trx->support_xa = trx->mysql_thd
4430+ ? thd_supports_xa(trx->mysql_thd) : FALSE;
4431
4432 trx_start_low(trx);
4433 /* fall through */
4434
4435=== renamed directory 'xtrabackup' => 'storage/innobase/xtrabackup'
4436=== modified file 'storage/innobase/xtrabackup/CMakeLists.txt'
4437--- xtrabackup/CMakeLists.txt 2011-04-21 06:36:29 +0000
4438+++ storage/innobase/xtrabackup/CMakeLists.txt 2013-11-27 10:34:29 +0000
4439@@ -1,59 +1,25 @@
4440-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4441-IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6)
4442- CMAKE_POLICY(VERSION 2.8)
4443-ENDIF()
4444-
4445-IF (NOT DEFINED MYSQL_ROOT_DIR)
4446- MESSAGE(FATAL_ERROR
4447- "You must specify a path to the server source directory with
4448- -DMYSQL_ROOT_DIR")
4449-ENDIF()
4450-
4451-if(COMMAND cmake_policy)
4452- cmake_policy(SET CMP0015 NEW)
4453-endif(COMMAND cmake_policy)
4454-
4455-LINK_DIRECTORIES (
4456- ${MYSQL_ROOT_DIR}/mysys/RelWithDebInfo
4457- ${MYSQL_ROOT_DIR}/strings/RelWithDebInfo
4458- ${MYSQL_ROOT_DIR}/storage/innobase/RelWithDebInfo
4459- ${MYSQL_ROOT_DIR}/zlib/RelWithDebInfo
4460- ${MYSQL_ROOT_DIR}/regex/RelWithDebInfo
4461-)
4462-
4463-PROJECT(XtraBackup)
4464-ADD_EXECUTABLE(xtrabackup
4465- xtrabackup.c
4466- xb_regex.h
4467-)
4468-
4469-if(COMMAND cmake_policy)
4470- cmake_policy(SET CMP0016 NEW)
4471-endif(COMMAND cmake_policy)
4472-
4473-# Enable debug info also in Release build, and create PDB to be able to
4474-# analyze crashes
4475-SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")
4476-SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /debug")
4477-
4478-# Force static runtime libraries
4479-FOREACH(flag
4480- CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
4481- CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
4482- CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
4483- CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
4484- STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
4485-ENDFOREACH()
4486-
4487-# Silence "deprecated API" warnings.
4488-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
4489-
4490-INCLUDE_DIRECTORIES(
4491- ${MYSQL_ROOT_DIR}/include
4492- ${MYSQL_ROOT_DIR}/regex
4493- ${MYSQL_ROOT_DIR}/storage/innobase/include
4494-)
4495-
4496-TARGET_LINK_LIBRARIES(xtrabackup mysys strings innobase zlib regex)
4497-ADD_DEFINITIONS(-DDBUG_OFF -DHAVE_CONFIG_H -DWIN_ASYNC_IO
4498- -DHAVE_WINDOWS_ATOMICS)
4499+# Copyright (c) 2013 Percona LLC and/or its affiliates.
4500+#
4501+# This program is free software; you can redistribute it and/or modify
4502+# it under the terms of the GNU General Public License as published by
4503+# the Free Software Foundation; version 2 of the License.
4504+
4505+# This program is distributed in the hope that it will be useful,
4506+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4507+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4508+# GNU General Public License for more details.
4509+
4510+# You should have received a copy of the GNU General Public License
4511+# along with this program; if not, write to the Free Software
4512+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4513+
4514+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/innobackupex.pl
4515+ ${CMAKE_CURRENT_BINARY_DIR}/innobackupex ESCAPE_QUOTES @ONLY)
4516+
4517+INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/innobackupex
4518+ DESTINATION ${INSTALL_BINDIR}
4519+ COMPONENT Server
4520+ )
4521+
4522+ADD_SUBDIRECTORY(src)
4523+ADD_SUBDIRECTORY(test)
4524
4525=== renamed file 'xtrabackup/Makefile' => 'storage/innobase/xtrabackup/Makefile.THIS'
4526=== modified file 'storage/innobase/xtrabackup/innobackupex.pl' (properties changed: -x to +x)
4527--- xtrabackup/innobackupex.pl 2013-11-22 08:48:52 +0000
4528+++ storage/innobase/xtrabackup/innobackupex.pl 2013-11-27 10:34:29 +0000
4529@@ -111,7 +111,7 @@
4530 my $option_slave_info = '';
4531 my $option_galera_info = '';
4532 my $option_no_lock = '';
4533-my $option_ibbackup_binary = 'autodetect';
4534+my $option_ibbackup_binary = 'xtrabackup';
4535 my $option_log_copy_interval = 0;
4536
4537 my $option_defaults_file = '';
4538@@ -1537,41 +1537,11 @@
4539 print_version();
4540
4541 # initialize global variables and perform some checks
4542-if ($option_copy_back || $option_move_back) {
4543- $option_ibbackup_binary = 'xtrabackup' if ($option_ibbackup_binary eq 'autodetect');
4544-} elsif ($option_apply_log) {
4545- # Read XtraBackup version from backup dir
4546- if (-e "$backup_dir/$xtrabackup_binary_file") {
4547- # Read XtraBackup version from file
4548- open XTRABACKUP_BINARY, "$backup_dir/$xtrabackup_binary_file"
4549- or die "Cannot open file $backup_dir/$xtrabackup_binary_file: $!\n";
4550- $option_ibbackup_binary = <XTRABACKUP_BINARY>;
4551- close XTRABACKUP_BINARY;
4552- }
4553-
4554- else {
4555- if( $option_ibbackup_binary eq "autodetect" ){
4556- # Try to connect MySQL and get the version
4557- %mysql = mysql_connect(
4558- abort_on_error => 0,
4559- keepalives => 0
4560- );
4561- if ($mysql{dbh}) {
4562- print STDERR "Connected successfully\n";
4563- $option_ibbackup_binary = set_xtrabackup_version();
4564- mysql_close(\%mysql);
4565- } else {
4566- die "Failed to connect to MySQL server to detect version.\nYou must set xtrabackup version to use with --ibbackup option.\nPossible values are xtrabackup_55 (for MySQL 5.5), xtrabackup_56 (for MySQL or Percona Server 5.6, or xtrabackup (for MySQL 5.1 with InnoDB plugin or Percona Server)\n";
4567- }
4568- }
4569- }
4570-} elsif ($option_backup) {
4571+if ($option_backup) {
4572 # backup
4573 %mysql = mysql_connect(abort_on_error => 1);
4574
4575- if ($option_ibbackup_binary eq 'autodetect') {
4576- $option_ibbackup_binary = set_xtrabackup_version();
4577- }
4578+ check_server_version();
4579
4580 if ($option_version_check) {
4581 $now = current_time();
4582@@ -3600,8 +3570,6 @@
4583 $mysql_server_version = $mysql{vars}->{version}->{Value};
4584 print STDERR "$prefix Using mysql server version $mysql_server_version\n";
4585 }
4586- #require_external($option_ibbackup_binary, '--license',
4587- # 'version (\S+)', \$ibbackup_version);
4588 print STDERR "\n";
4589
4590 if ($option_include
4591@@ -4614,67 +4582,34 @@
4592
4593 }
4594
4595-sub set_xtrabackup_version {
4596- # Based on MySQL version choose correct binary
4597- # MySQL 5.1.* with InnoDB plugin - xtrabackup
4598- # MariaDB 5.1.* - xtrabackup
4599- # MariaDB 5.2.* - xtrabackup
4600- # MariaDB 5.3.* - xtrabackup
4601- # Percona Server 5.0 - xtrabackup_51
4602- # Percona Server 5.1 - xtrabackup
4603- # Percona Server 5.5 - xtrabackup_55
4604- # Percona Server 5.6 - xtrabackup_56
4605- # MySQL 5.5.* - xtrabackup_55
4606- # MySQL 5.6.* - xtrabackup_56
4607- # MariaDB 5.5.* - xtrabackup_55
4608- # MariaDB 10.0.* - xtrabackup_56
4609-
4610+sub check_server_version {
4611 my $var_version = '';
4612 my $var_innodb_version = '';
4613- my $ibbackup_binary;
4614
4615 get_mysql_vars(\%mysql);
4616
4617 $var_version = $mysql{vars}->{version}->{Value};
4618 $var_innodb_version = $mysql{vars}->{innodb_version}->{Value};
4619
4620-
4621- if($var_version =~ m/5\.0\.\d/) {
4622- die "MySQL 5.0 support was removed in Percona XtraBackup 2.1. The last version to support MySQL 5.0 was Percona XtraBackup 2.0.\n";
4623- }
4624-
4625- if($var_version =~ m/5\.1\.\d/ && !defined($var_innodb_version)) {
4626- die "Support for MySQL 5.1 with builtin InnoDB (not the plugin) was removed in Percona XtraBackup 2.1. The last version to support MySQL 5.1 with builtin InnoDB was Percona XtraBackup 2.0.\n";
4627- }
4628-
4629- if($var_version =~ m/5\.1\.\d/) {
4630- $ibbackup_binary = ($win eq 1 ? 'xtrabackup.exe' : 'xtrabackup');
4631- }
4632-
4633- if($var_version =~ m/5\.2\.\d/){
4634- $ibbackup_binary = ($win eq 1 ? 'xtrabackup.exe' : 'xtrabackup');
4635- }
4636-
4637- if($var_version =~ m/5\.3\.\d/){
4638- $ibbackup_binary = ($win eq 1 ? 'xtrabackup.exe' : 'xtrabackup');
4639- }
4640-
4641- if($var_version =~ m/5\.5\.\d/){
4642- $ibbackup_binary = ($win eq 1 ? 'xtrabackup.exe' : 'xtrabackup_55');
4643- }
4644-
4645- if($var_version =~ m/5\.6\.\d/ or $var_version =~ m/10\.0\.\d/){
4646- $ibbackup_binary = ($win eq 1 ? 'xtrabackup.exe' : 'xtrabackup_56');
4647- }
4648-
4649- if (!$ibbackup_binary) {
4650+ # Check supported versions
4651+ if(!(
4652+ # MySQL/Percona Server/MariaDB 5.1 or MariaDB 5.2/5.3 with InnoDB
4653+ # plugin
4654+ (
4655+ $var_version =~ m/5\.[123]\.\d/
4656+ && defined($var_innodb_version)) ||
4657+ # MySQL/Percona Server/MariaDB 5.5
4658+ $var_version =~ m/5\.5\.\d/ ||
4659+ # MySQL/Percona Server 5.6
4660+ $var_version =~ m/5\.6\.\d/ ||
4661+ # MariaDB 10.0
4662+ $var_version =~ m/10\.0\.\d/
4663+ )) {
4664+
4665 die "Unsupported server version: '$var_version' " .
4666- "(InnoDB version: '$var_innodb_version'). " .
4667- "Please report a bug at ".
4668+ "Please report a bug at " .
4669 "https://bugs.launchpad.net/percona-xtrabackup\n";
4670 }
4671-
4672- return $ibbackup_binary;
4673 }
4674
4675 # Wait until it's safe to backup a slave. Returns immediately if
4676
4677=== added file 'storage/innobase/xtrabackup/src/CMakeLists.txt'
4678--- storage/innobase/xtrabackup/src/CMakeLists.txt 1970-01-01 00:00:00 +0000
4679+++ storage/innobase/xtrabackup/src/CMakeLists.txt 2013-11-27 10:34:29 +0000
4680@@ -0,0 +1,98 @@
4681+# Copyright (c) 2013 Percona LLC and/or its affiliates.
4682+#
4683+# This program is free software; you can redistribute it and/or modify
4684+# it under the terms of the GNU General Public License as published by
4685+# the Free Software Foundation; version 2 of the License.
4686+
4687+# This program is distributed in the hope that it will be useful,
4688+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4689+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4690+# GNU General Public License for more details.
4691+
4692+# You should have received a copy of the GNU General Public License
4693+# along with this program; if not, write to the Free Software
4694+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4695+
4696+INCLUDE(gcrypt)
4697+
4698+ADD_SUBDIRECTORY(libarchive)
4699+
4700+FIND_GCRYPT()
4701+
4702+INCLUDE_DIRECTORIES(
4703+ ${CMAKE_SOURCE_DIR}/include
4704+ ${CMAKE_SOURCE_DIR}/storage/innobase/include
4705+ ${CMAKE_SOURCE_DIR}/sql
4706+ ${CMAKE_SOURCE_DIR}/storage/innobase/xtrabackup/src/libarchive/libarchive
4707+ ${CMAKE_SOURCE_DIR}/storage/innobase/xtrabackup/src/quicklz
4708+ ${GCRYPT_INCLUDE_DIR}
4709+ )
4710+
4711+########################################################################
4712+# xtrabackup binary
4713+########################################################################
4714+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/xtrabackup_version.h.in
4715+ ${CMAKE_CURRENT_BINARY_DIR}/xtrabackup_version.h )
4716+
4717+
4718+MYSQL_ADD_EXECUTABLE(xtrabackup
4719+ xtrabackup.cc
4720+ changed_page_bitmap.cc
4721+ compact.cc
4722+ datasink.c
4723+ ds_archive.c
4724+ ds_buffer.c
4725+ ds_compress.c
4726+ ds_encrypt.c
4727+ ds_local.c
4728+ ds_stdout.c
4729+ ds_tmpfile.c
4730+ ds_xbstream.c
4731+ fil_cur.cc
4732+ quicklz/quicklz.c
4733+ read_filt.cc
4734+ write_filt.cc
4735+ xbcrypt_common.c
4736+ xbcrypt_write.c
4737+ xbstream_write.c
4738+ )
4739+
4740+TARGET_LINK_LIBRARIES(xtrabackup
4741+ mysqlserver
4742+ ${GCRYPT_LIBS}
4743+ archive_static
4744+ )
4745+
4746+########################################################################
4747+# xbstream binary
4748+########################################################################
4749+MYSQL_ADD_EXECUTABLE(xbstream
4750+ ds_buffer.c
4751+ ds_local.c
4752+ ds_stdout.c
4753+ datasink.c
4754+ xbstream.c
4755+ xbstream_read.c
4756+ xbstream_write.c
4757+ )
4758+
4759+TARGET_LINK_LIBRARIES(xbstream
4760+ mysys
4761+ mysys_ssl
4762+ )
4763+
4764+########################################################################
4765+# xbcrypt binary
4766+########################################################################
4767+MYSQL_ADD_EXECUTABLE(xbcrypt
4768+ xbcrypt.c
4769+ xbcrypt_common.c
4770+ xbcrypt_read.c
4771+ xbcrypt_write.c
4772+ )
4773+
4774+TARGET_LINK_LIBRARIES(xbcrypt
4775+ ${GCRYPT_LIBS}
4776+ mysys
4777+ mysys_ssl
4778+ )
4779
4780=== modified file 'storage/innobase/xtrabackup/src/changed_page_bitmap.cc'
4781--- xtrabackup/src/changed_page_bitmap.cc 2013-07-29 10:39:08 +0000
4782+++ storage/innobase/xtrabackup/src/changed_page_bitmap.cc 2013-11-27 10:34:29 +0000
4783@@ -25,7 +25,6 @@
4784 #include "changed_page_bitmap.h"
4785
4786 #include "common.h"
4787-#include "innodb_int.h"
4788 #include "xtrabackup.h"
4789
4790 /* TODO: copy-pasted shared definitions from the XtraDB bitmap write code.
4791@@ -195,7 +194,7 @@
4792 <= bitmap_file->size - MODIFIED_PAGE_BLOCK_SIZE);
4793 ut_a(bitmap_file->offset % MODIFIED_PAGE_BLOCK_SIZE == 0);
4794
4795- success = xb_os_file_read(bitmap_file->file, page, bitmap_file->offset,
4796+ success = os_file_read(bitmap_file->file, page, bitmap_file->offset,
4797 MODIFIED_PAGE_BLOCK_SIZE);
4798
4799 if (UNIV_UNLIKELY(!success)) {
4800@@ -445,10 +444,10 @@
4801
4802 ut_snprintf(bitmap_file->name, FN_REFLEN, "%s%s", srv_data_home, name);
4803 bitmap_file->file
4804- = xb_file_create_no_error_handling(bitmap_file->name,
4805- OS_FILE_OPEN,
4806- OS_FILE_READ_ONLY,
4807- &success);
4808+ = os_file_create_simple_no_error_handling(0, bitmap_file->name,
4809+ OS_FILE_OPEN,
4810+ OS_FILE_READ_ONLY,
4811+ &success);
4812 if (UNIV_UNLIKELY(!success)) {
4813
4814 /* Here and below assume that bitmap file names do not
4815@@ -532,7 +531,7 @@
4816
4817 /****************************************************************//**
4818 Print a diagnostic message on missing bitmap data for an LSN range. */
4819-static __attribute__((cold))
4820+static
4821 void
4822 xb_msg_missing_lsn_data(
4823 /*====================*/
4824@@ -583,7 +582,7 @@
4825 return FALSE;
4826 }
4827
4828- *page_end_lsn = MACH_READ_64(page + MODIFIED_PAGE_END_LSN);
4829+ *page_end_lsn = mach_read_from_8(page + MODIFIED_PAGE_END_LSN);
4830 }
4831
4832 /* We check two pages here because the last read page already contains
4833@@ -840,7 +839,7 @@
4834 }
4835
4836 current_page_end_lsn
4837- = MACH_READ_64(page + MODIFIED_PAGE_END_LSN);
4838+ = mach_read_from_8(page + MODIFIED_PAGE_END_LSN);
4839 last_page_in_run
4840 = mach_read_from_4(page + MODIFIED_PAGE_IS_LAST_BLOCK);
4841 }
4842
4843=== modified file 'storage/innobase/xtrabackup/src/changed_page_bitmap.h'
4844--- xtrabackup/src/changed_page_bitmap.h 2013-04-16 10:35:58 +0000
4845+++ storage/innobase/xtrabackup/src/changed_page_bitmap.h 2013-11-27 10:34:29 +0000
4846@@ -25,7 +25,8 @@
4847 #ifndef XB_CHANGED_PAGE_BITMAP_H
4848 #define XB_CHANGED_PAGE_BITMAP_H
4849
4850-#include "innodb_int.h"
4851+#include <ut0rbt.h>
4852+#include <fil0fil.h>
4853
4854 /* The changed page bitmap structure */
4855 typedef ib_rbt_t xb_page_bitmap;
4856
4857=== modified file 'storage/innobase/xtrabackup/src/common.h'
4858--- xtrabackup/src/common.h 2013-08-18 06:54:14 +0000
4859+++ storage/innobase/xtrabackup/src/common.h 2013-11-27 10:34:29 +0000
4860@@ -55,12 +55,6 @@
4861 return result;
4862 }
4863
4864-#if MYSQL_VERSION_ID >= 50500
4865-# define MY_FREE(a) my_free(a)
4866-#else
4867-# define MY_FREE(a) my_free(a, MYF(0))
4868-#endif
4869-
4870 /* Use POSIX_FADV_NORMAL when available */
4871
4872 #ifdef POSIX_FADV_NORMAL
4873
4874=== modified file 'storage/innobase/xtrabackup/src/compact.cc'
4875--- xtrabackup/src/compact.cc 2013-08-21 07:45:08 +0000
4876+++ storage/innobase/xtrabackup/src/compact.cc 2013-11-27 10:34:29 +0000
4877@@ -23,11 +23,17 @@
4878 /* Compact backups implementation */
4879
4880 #include <my_base.h>
4881+#include <table.h>
4882+
4883+#include <univ.i>
4884+#include <dict0mem.h>
4885+#include <dict0priv.h>
4886+#include <fsp0fsp.h>
4887+#include <handler0alter.h>
4888+#include <ibuf0ibuf.h>
4889+#include <page0page.h>
4890+#include <row0merge.h>
4891 #include "common.h"
4892-#if MYSQL_VERSION_ID >= 50600
4893-#include "table.h"
4894-#endif
4895-#include "innodb_int.h"
4896 #include "write_filt.h"
4897 #include "fil_cur.h"
4898 #include "xtrabackup.h"
4899@@ -150,7 +156,7 @@
4900 byte *page;
4901 ulint page_no;
4902 ulint page_type;
4903- INDEX_ID_T index_id;
4904+ index_id_t index_id;
4905
4906
4907 xb_ad(cursor->is_system == FALSE);
4908@@ -195,7 +201,8 @@
4909 } else if (cp->clustered_index_found && page_type == FIL_PAGE_INDEX) {
4910
4911 index_id = mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID);
4912- if (INDEX_ID_CMP(index_id, cp->clustered_index) != 0) {
4913+ if (index_id != cp->clustered_index) {
4914+
4915 ulint fseg_hdr_space =
4916 mach_read_from_4(page + PAGE_HEADER +
4917 PAGE_BTR_SEG_TOP);
4918@@ -635,7 +642,7 @@
4919 space = node->space;
4920
4921 /* System tablespace cannot be compacted */
4922- if (trx_sys_sys_space(space->id)) {
4923+ if (!fil_is_user_tablespace_id(space->id)) {
4924
4925 continue;
4926 }
4927@@ -710,22 +717,20 @@
4928 dict_field_t* field;
4929
4930 field = dict_index_get_nth_field(index, i);
4931- xb_dict_index_field_to_index_field(heap, field, &fields[i]);
4932-
4933+ fields[i].col_no = dict_col_get_no(field->col);
4934+ fields[i].prefix_len = field->prefix_len;
4935 }
4936
4937 index_def->fields = fields;
4938 index_def->n_fields = n_fields;
4939 }
4940
4941-#if MYSQL_VERSION_ID >= 50600
4942 /* A dummy autoc_inc sequence for row_merge_build_indexes(). */
4943 static ib_sequence_t null_seq(NULL, 0, 0);
4944 /* A dummy table share and table for row_merge_build_indexes() error reporting.
4945 Assumes that no errors are going to be reported. */
4946 static struct TABLE_SHARE dummy_table_share;
4947 static struct TABLE dummy_table;
4948-#endif
4949
4950 /********************************************************************//**
4951 Rebuild secondary indexes for a given table. */
4952@@ -744,9 +749,7 @@
4953 ulint i;
4954 mem_heap_t* heap;
4955 ulint error;
4956-#if MYSQL_VERSION_ID >= 50600
4957 ulint* add_key_nums;
4958-#endif
4959
4960 ut_ad(!mutex_own(&(dict_sys->mutex)));
4961 ut_ad(table);
4962@@ -765,10 +768,8 @@
4963 n_indexes * sizeof(*indexes));
4964 index_defs = (index_def_t*) mem_heap_alloc(heap, n_indexes *
4965 sizeof(*index_defs));
4966-#if MYSQL_VERSION_ID >= 50600
4967 add_key_nums = static_cast<ulint *>
4968 (mem_heap_alloc(heap, n_indexes * sizeof(*add_key_nums)));
4969-#endif
4970
4971 /* Skip the primary key. */
4972 index = dict_table_get_first_index(table);
4973@@ -782,23 +783,18 @@
4974
4975 /* Pretend that it's the current trx that created this index.
4976 Required to avoid 5.6+ debug assertions. */
4977- index->trx_id = xb_trx_id_to_index_trx_id(trx->id);
4978+ index->trx_id = trx->id;
4979
4980 xb_build_index_def(heap, index, &index_defs[i]);
4981
4982-#if MYSQL_VERSION_ID >= 50600
4983 /* In 5.6+, row_merge_drop_indexes() drops all the indexes on
4984 the table that have the temp index prefix. It does not accept
4985 an array of indexes to drop as in 5.5-. */
4986 row_merge_rename_index_to_drop(trx, table->id, index->id);
4987-#else
4988- indexes[i] = index;
4989-#endif
4990 }
4991
4992 ut_ad(i == n_indexes);
4993
4994-#if MYSQL_VERSION_ID >= 50600
4995 ut_d(table->n_ref_count++);
4996 row_merge_drop_indexes(trx, table, TRUE);
4997 ut_d(table->n_ref_count--);
4998@@ -823,9 +819,6 @@
4999
5000 index = next_index;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: