summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore7
-rw-r--r--BUILD-CMAKE2
-rw-r--r--BUILD/FINISH.sh6
-rwxr-xr-xBUILD/autorun.sh6
-rwxr-xr-xBUILD/build_mccge.sh4
-rw-r--r--BUILD/cmake_configure.sh6
-rwxr-xr-xBUILD/compile-ia64-debug-max4
-rwxr-xr-xBUILD/compile-pentium-debug4
-rwxr-xr-xBUILD/compile-pentium-debug-max4
-rwxr-xr-xBUILD/compile-pentium-debug-openssl4
-rwxr-xr-xBUILD/compile-pentium-debug-yassl4
-rwxr-xr-xBUILD/compile-pentium-icc-valgrind-max4
-rwxr-xr-xBUILD/compile-pentium-valgrind-max4
-rwxr-xr-xBUILD/compile-pentium64-debug4
-rwxr-xr-xBUILD/compile-pentium64-debug-max4
-rwxr-xr-xBUILD/compile-pentium64-valgrind-max4
-rwxr-xr-xBUILD/compile-solaris-sparc-forte5
-rw-r--r--VERSION2
-rw-r--r--client/CMakeLists.txt5
-rw-r--r--client/client_priv.h6
-rw-r--r--client/completion_hash.cc4
-rw-r--r--client/my_readline.h6
-rw-r--r--client/mysql.cc9
-rw-r--r--client/mysql_plugin.c1202
-rw-r--r--client/mysql_upgrade.c6
-rw-r--r--client/mysqladmin.cc4
-rw-r--r--client/mysqlbinlog.cc8
-rw-r--r--client/mysqlcheck.c7
-rw-r--r--client/mysqldump.c10
-rw-r--r--client/mysqlimport.c18
-rw-r--r--client/mysqlshow.c8
-rw-r--r--client/mysqlslap.c6
-rw-r--r--client/mysqltest.cc204
-rw-r--r--client/readline.cc6
-rw-r--r--client/sql_string.cc6
-rw-r--r--client/sql_string.h4
-rw-r--r--cmake/abi_check.cmake2
-rw-r--r--cmake/bison.cmake3
-rw-r--r--cmake/build_configurations/mysql_release.cmake6
-rw-r--r--cmake/cat.cmake3
-rw-r--r--cmake/check_minimal_version.cmake3
-rw-r--r--cmake/cmake_parse_arguments.cmake2
-rw-r--r--cmake/configure.pl16
-rw-r--r--cmake/cpack_source_ignore_files.cmake15
-rw-r--r--cmake/create_initial_db.cmake.in2
-rw-r--r--cmake/do_abi_check.cmake2
-rw-r--r--cmake/dtrace.cmake2
-rw-r--r--cmake/dtrace_prelink.cmake3
-rw-r--r--cmake/install_layout.cmake2
-rw-r--r--cmake/install_macros.cmake2
-rw-r--r--cmake/libutils.cmake2
-rw-r--r--cmake/maintainer.cmake2
-rw-r--r--cmake/merge_archives_unix.cmake.in3
-rw-r--r--cmake/mysql_add_executable.cmake2
-rw-r--r--cmake/mysql_version.cmake2
-rw-r--r--cmake/os/AIX.cmake2
-rw-r--r--cmake/os/Cygwin.cmake3
-rw-r--r--cmake/os/Darwin.cmake3
-rw-r--r--cmake/os/HP-UX.cmake3
-rw-r--r--cmake/os/Linux.cmake2
-rw-r--r--cmake/os/OS400.cmake3
-rw-r--r--cmake/os/SunOS.cmake2
-rw-r--r--cmake/os/Windows.cmake2
-rw-r--r--cmake/os/WindowsCache.cmake2
-rw-r--r--cmake/package_name.cmake2
-rw-r--r--cmake/plugin.cmake4
-rw-r--r--cmake/readline.cmake3
-rw-r--r--cmake/ssl.cmake2
-rw-r--r--cmake/stack_direction.c6
-rw-r--r--cmake/versioninfo.rc.in15
-rw-r--r--cmake/zlib.cmake3
-rw-r--r--cmd-line-utils/readline/CMakeLists.txt2
-rw-r--r--config.h.cmake1
-rw-r--r--configure.cmake3
-rw-r--r--dbug/dbug.c2
-rwxr-xr-xdbug/dbug_add_tags.pl16
-rw-r--r--dbug/my_main.c3
-rw-r--r--dbug/tests.c3
-rw-r--r--extra/comp_err.c6
-rw-r--r--extra/innochecksum.c14
-rw-r--r--extra/my_print_defaults.c6
-rw-r--r--extra/mysql_waitpid.c4
-rw-r--r--extra/perror.c10
-rw-r--r--extra/replace.c3
-rw-r--r--extra/resolve_stack_dump.c4
-rw-r--r--extra/resolveip.c4
-rw-r--r--extra/yassl/include/cert_wrapper.hpp3
-rw-r--r--extra/yassl/include/openssl/prefix_ssl.h3
-rw-r--r--extra/yassl/include/openssl/ssl.h3
-rw-r--r--extra/yassl/include/yassl_error.hpp3
-rw-r--r--extra/yassl/include/yassl_imp.hpp3
-rw-r--r--extra/yassl/include/yassl_int.hpp2
-rw-r--r--extra/yassl/include/yassl_types.hpp3
-rw-r--r--extra/yassl/src/buffer.cpp3
-rw-r--r--extra/yassl/src/cert_wrapper.cpp3
-rw-r--r--extra/yassl/src/crypto_wrapper.cpp2
-rw-r--r--extra/yassl/src/handshake.cpp3
-rw-r--r--extra/yassl/src/socket_wrapper.cpp2
-rw-r--r--extra/yassl/src/ssl.cpp3
-rw-r--r--extra/yassl/src/yassl_error.cpp2
-rw-r--r--extra/yassl/src/yassl_imp.cpp2
-rw-r--r--extra/yassl/src/yassl_int.cpp2
-rw-r--r--extra/yassl/taocrypt/include/asn.hpp3
-rw-r--r--extra/yassl/taocrypt/include/block.hpp3
-rw-r--r--extra/yassl/taocrypt/include/blowfish.hpp2
-rw-r--r--extra/yassl/taocrypt/include/misc.hpp2
-rw-r--r--extra/yassl/taocrypt/include/modes.hpp3
-rw-r--r--extra/yassl/taocrypt/include/runtime.hpp2
-rw-r--r--extra/yassl/taocrypt/src/aes.cpp2
-rw-r--r--extra/yassl/taocrypt/src/algebra.cpp2
-rw-r--r--extra/yassl/taocrypt/src/asn.cpp3
-rw-r--r--extra/yassl/taocrypt/src/blowfish.cpp2
-rw-r--r--extra/yassl/taocrypt/src/coding.cpp2
-rw-r--r--extra/yassl/taocrypt/src/integer.cpp2
-rw-r--r--extra/yassl/taocrypt/src/misc.cpp2
-rw-r--r--extra/yassl/taocrypt/src/random.cpp2
-rw-r--r--extra/yassl/taocrypt/src/twofish.cpp2
-rw-r--r--extra/yassl/testsuite/test.hpp2
-rw-r--r--include/CMakeLists.txt2
-rw-r--r--include/atomic/gcc_builtins.h4
-rw-r--r--include/atomic/generic-msvc.h5
-rw-r--r--include/atomic/nolock.h4
-rw-r--r--include/atomic/rwlock.h5
-rw-r--r--include/atomic/solaris.h4
-rw-r--r--include/atomic/x86-gcc.h4
-rw-r--r--include/decimal.h13
-rw-r--r--include/errmsg.h4
-rw-r--r--include/ft_global.h5
-rw-r--r--include/hash.h4
-rw-r--r--include/heap.h9
-rw-r--r--include/keycache.h4
-rw-r--r--include/lf.h4
-rw-r--r--include/m_ctype.h4
-rw-r--r--include/m_string.h5
-rw-r--r--include/my_aes.h5
-rw-r--r--include/my_alarm.h4
-rw-r--r--include/my_alloc.h4
-rw-r--r--include/my_atomic.h5
-rw-r--r--include/my_attribute.h4
-rw-r--r--include/my_base.h16
-rw-r--r--include/my_compiler.h2
-rw-r--r--include/my_dbug.h6
-rw-r--r--include/my_dir.h4
-rw-r--r--include/my_getopt.h3
-rw-r--r--include/my_global.h7
-rw-r--r--include/my_libwrap.h5
-rw-r--r--include/my_list.h4
-rw-r--r--include/my_nosys.h4
-rw-r--r--include/my_rdtsc.h5
-rw-r--r--include/my_stacktrace.h4
-rw-r--r--include/my_time.h4
-rw-r--r--include/my_tree.h4
-rw-r--r--include/my_uctype.h3
-rw-r--r--include/myisam.h6
-rw-r--r--include/myisammrg.h5
-rw-r--r--include/myisampack.h5
-rw-r--r--include/mysql.h4
-rw-r--r--include/mysql/client_plugin.h3
-rw-r--r--include/mysql/plugin.h17
-rw-r--r--include/mysql/plugin_audit.h13
-rw-r--r--include/mysql/plugin_audit.h.pp1
-rw-r--r--include/mysql/plugin_auth.h4
-rw-r--r--include/mysql/plugin_auth.h.pp1
-rw-r--r--include/mysql/plugin_auth_common.h4
-rw-r--r--include/mysql/plugin_ftparser.h5
-rw-r--r--include/mysql/plugin_ftparser.h.pp1
-rw-r--r--include/mysql/service_my_snprintf.h4
-rw-r--r--include/mysql/service_thd_alloc.h4
-rw-r--r--include/mysql/service_thd_wait.h4
-rw-r--r--include/mysql/service_thread_scheduler.h4
-rw-r--r--include/mysql/services.h4
-rw-r--r--include/mysql/thread_pool_priv.h4
-rw-r--r--include/mysql_com.h5
-rw-r--r--include/mysql_embed.h4
-rw-r--r--include/mysys_err.h4
-rw-r--r--include/password.h2
-rw-r--r--include/probes_mysql.d.base5
-rw-r--r--include/probes_mysql.h16
-rw-r--r--include/rijndael.h5
-rw-r--r--include/service_versions.h4
-rw-r--r--include/sha1.h3
-rw-r--r--include/sha2.h4
-rw-r--r--include/sql_common.h5
-rw-r--r--include/sslopt-case.h4
-rw-r--r--include/sslopt-longopts.h4
-rw-r--r--include/sslopt-vars.h4
-rw-r--r--include/thr_alarm.h4
-rw-r--r--include/thr_lock.h4
-rw-r--r--include/welcome_copyright_notice.h6
-rw-r--r--libmysql/client_settings.h9
-rw-r--r--libmysql/errmsg.c4
-rw-r--r--libmysql/get_password.c4
-rw-r--r--libmysql/libmysql.c4
-rw-r--r--libmysqld/emb_qcache.cc4
-rw-r--r--libmysqld/emb_qcache.h4
-rw-r--r--libmysqld/embedded_priv.h4
-rw-r--r--libmysqld/examples/CMakeLists.txt4
-rw-r--r--libmysqld/examples/builder-sample/emb_sample.bpr16
-rw-r--r--libmysqld/examples/builder-sample/emb_sample.cpp16
-rw-r--r--libmysqld/examples/builder-sample/emb_samples.cpp16
-rw-r--r--libmysqld/examples/builder-sample/emb_samples.h16
-rw-r--r--libmysqld/lib_sql.cc15
-rw-r--r--libmysqld/libmysqld.c4
-rw-r--r--libservices/HOWTO2
-rw-r--r--libservices/my_snprintf_service.c5
-rw-r--r--libservices/my_thread_scheduler_service.c13
-rw-r--r--libservices/thd_alloc_service.c5
-rw-r--r--libservices/thd_wait_service.c4
-rw-r--r--mysql-test/CMakeLists.txt25
-rw-r--r--mysql-test/collections/README8
-rw-r--r--mysql-test/collections/default.experimental11
-rw-r--r--mysql-test/collections/default.release.in (renamed from mysql-test/collections/default.release)6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_duplicate.test59
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id.test29
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_ignore.test51
-rw-r--r--mysql-test/extra/rpl_tests/rpl_reset_slave.test28
-rw-r--r--mysql-test/include/commit.inc34
-rw-r--r--mysql-test/include/daemon_example_bad_format.ini8
-rw-r--r--mysql-test/include/daemon_example_bad_soname.ini9
-rw-r--r--mysql-test/include/default_my.cnf4
-rw-r--r--mysql-test/include/default_mysqld.cnf4
-rw-r--r--mysql-test/include/mtr_check.sql31
-rw-r--r--mysql-test/include/mtr_warnings.sql15
-rw-r--r--mysql-test/include/mysqld--help.inc2
-rw-r--r--mysql-test/include/plugin.defs1
-rw-r--r--mysql-test/include/set_binlog_format_mixed.sql16
-rw-r--r--mysql-test/include/set_binlog_format_row.sql16
-rw-r--r--mysql-test/include/set_binlog_format_statement.sql16
-rw-r--r--mysql-test/lib/My/Config.pm15
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm2
-rw-r--r--mysql-test/lib/My/CoreDump.pm4
-rw-r--r--mysql-test/lib/My/File/Path.pm3
-rw-r--r--mysql-test/lib/My/Find.pm2
-rw-r--r--mysql-test/lib/My/Handles.pm2
-rw-r--r--mysql-test/lib/My/Options.pm2
-rw-r--r--mysql-test/lib/My/Platform.pm3
-rw-r--r--mysql-test/lib/My/SafeProcess.pm2
-rw-r--r--mysql-test/lib/My/SafeProcess/Base.pm3
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_kill_win.cc4
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.pl15
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process_win.cc4
-rw-r--r--mysql-test/lib/My/SysInfo.pm3
-rw-r--r--mysql-test/lib/mtr_cases.pm46
-rw-r--r--mysql-test/lib/mtr_gprof.pl2
-rw-r--r--mysql-test/lib/mtr_io.pl3
-rw-r--r--mysql-test/lib/mtr_stress.pl3
-rw-r--r--mysql-test/lib/mtr_unique.pm3
-rw-r--r--mysql-test/lib/t/Base.t17
-rw-r--r--mysql-test/lib/t/Find.t17
-rw-r--r--mysql-test/lib/t/Options.t17
-rw-r--r--mysql-test/lib/t/Platform.t17
-rw-r--r--mysql-test/lib/t/SafeProcess.t16
-rwxr-xr-xmysql-test/lib/t/SafeProcessStress.pl16
-rw-r--r--mysql-test/lib/t/copytree.t16
-rw-r--r--mysql-test/lib/t/dummyd.pl16
-rw-r--r--mysql-test/lib/t/rmtree.t16
-rwxr-xr-xmysql-test/lib/t/testMyConfig.t16
-rwxr-xr-xmysql-test/lib/t/testMyConfigFactory.t16
-rwxr-xr-xmysql-test/lib/t/test_child.pl16
-rw-r--r--mysql-test/lib/v1/My/Config.pm16
-rw-r--r--mysql-test/lib/v1/mtr_cases.pl3
-rw-r--r--mysql-test/lib/v1/mtr_gcov.pl3
-rw-r--r--mysql-test/lib/v1/mtr_gprof.pl3
-rw-r--r--mysql-test/lib/v1/mtr_im.pl3
-rw-r--r--mysql-test/lib/v1/mtr_io.pl2
-rw-r--r--mysql-test/lib/v1/mtr_match.pl3
-rw-r--r--mysql-test/lib/v1/mtr_misc.pl2
-rw-r--r--mysql-test/lib/v1/mtr_process.pl3
-rw-r--r--mysql-test/lib/v1/mtr_report.pl2
-rw-r--r--mysql-test/lib/v1/mtr_stress.pl3
-rw-r--r--mysql-test/lib/v1/mtr_timer.pl3
-rw-r--r--mysql-test/lib/v1/mtr_unique.pl3
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl16
-rwxr-xr-xmysql-test/mysql-stress-test.pl7
-rwxr-xr-xmysql-test/mysql-test-run.pl108
-rw-r--r--mysql-test/r/alter_table.result29
-rw-r--r--mysql-test/r/auth_rpl.result24
-rw-r--r--mysql-test/r/commit_1innodb.result2
-rw-r--r--mysql-test/r/ctype_errors.result12
-rw-r--r--mysql-test/r/ctype_utf16.result9
-rw-r--r--mysql-test/r/ctype_utf32_uca.result20
-rw-r--r--mysql-test/r/execution_constants.result2
-rw-r--r--mysql-test/r/explain.result3
-rw-r--r--mysql-test/r/flush.result23
-rw-r--r--mysql-test/r/func_math.result31
-rw-r--r--mysql-test/r/func_str.result35
-rw-r--r--mysql-test/r/func_time.result6
-rw-r--r--mysql-test/r/gis.result17
-rw-r--r--mysql-test/r/group_by.result34
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/heap.result4
-rw-r--r--mysql-test/r/information_schema.result114
-rw-r--r--mysql-test/r/merge.result46
-rw-r--r--mysql-test/r/myisampack.result32
-rw-r--r--mysql-test/r/mysql_plugin.result110
-rw-r--r--mysql-test/r/mysqld--help-notwin.result4
-rw-r--r--mysql-test/r/mysqltest.result53
-rw-r--r--mysql-test/r/order_by.result7
-rw-r--r--mysql-test/r/partition_innodb_plugin.result2
-rw-r--r--mysql-test/r/plugin_auth.result35
-rw-r--r--mysql-test/r/secure_file_priv_win.result38
-rw-r--r--mysql-test/r/select_safe.result12
-rw-r--r--mysql-test/r/show_check.result46
-rw-r--r--mysql-test/r/sp-error.result16
-rw-r--r--mysql-test/r/sp-security.result25
-rw-r--r--mysql-test/r/sp.result106
-rw-r--r--mysql-test/r/sp_sync.result16
-rw-r--r--mysql-test/r/sp_trans.result46
-rw-r--r--mysql-test/r/type_datetime_hires.result2
-rw-r--r--mysql-test/r/type_float.result15
-rw-r--r--mysql-test/r/type_newdecimal.result11
-rw-r--r--mysql-test/r/type_time_hires.result2
-rw-r--r--mysql-test/r/type_timestamp_hires.result2
-rw-r--r--mysql-test/r/union.result57
-rw-r--r--mysql-test/r/xml.result18
-rw-r--r--mysql-test/std_data/bug11747416_32228_binlog.000001bin0 -> 8192 bytes
-rw-r--r--mysql-test/std_data/bug57108.cnf95
-rw-r--r--mysql-test/std_data/latin1.xml5
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_blackhole.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result38
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test48
-rw-r--r--mysql-test/suite/federated/my.cnf2
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result133
-rw-r--r--mysql-test/suite/innodb/r/innodb-zip.result114
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug52745.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53591.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59733.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb_corrupt_bit.result81
-rw-r--r--mysql-test/suite/innodb/r/innodb_file_format.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_index_large_prefix.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result1
-rw-r--r--mysql-test/suite/innodb/t/disabled.def2
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-44030.test9
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-create-options.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test149
-rw-r--r--mysql-test/suite/innodb/t/innodb-zip.test22
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug36172.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47167-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug52745.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53591.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56680.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59733.test53
-rw-r--r--mysql-test/suite/innodb/t/innodb_corrupt_bit.test120
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_index_large_prefix.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test2
-rw-r--r--mysql-test/suite/percona/disabled.def3
-rw-r--r--mysql-test/suite/percona/percona_server_variables_release.test2
-rw-r--r--mysql-test/suite/perfschema/include/cleanup_helper.inc19
-rw-r--r--mysql-test/suite/perfschema/include/privilege.inc4
-rw-r--r--mysql-test/suite/perfschema/include/start_server_common.inc4
-rw-r--r--mysql-test/suite/perfschema/include/upgrade_check.inc6
-rw-r--r--mysql-test/suite/perfschema/r/all_instances.result7
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result20
-rw-r--r--mysql-test/suite/perfschema/r/selects.result2
-rw-r--r--mysql-test/suite/perfschema/t/all_instances.test4
-rw-r--r--mysql-test/suite/perfschema/t/cnf_option.cnf4
-rw-r--r--mysql-test/suite/perfschema/t/disabled.def4
-rw-r--r--mysql-test/suite/perfschema/t/relaylog.test18
-rw-r--r--mysql-test/suite/perfschema/t/selects.test6
-rw-r--r--mysql-test/suite/perfschema_stress/README4
-rw-r--r--mysql-test/suite/perfschema_stress/include/settings.inc4
-rw-r--r--mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_duplicate.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_ignore.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_select.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_manual_change_index_file.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_corruption.result49
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result8
-rw-r--r--mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test64
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_duplicate.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_select.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_corruption.test115
-rw-r--r--mysql-test/suite/stress/t/wrapper.test29
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result127
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result66
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result93
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result92
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result65
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result84
-rw-r--r--mysql-test/suite/sys_vars/r/max_join_size_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/plugin_dir_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sql_max_join_size_func.result2
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/debug_crc_break_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/disabled.def3
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test112
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test61
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test102
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test71
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test70
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test59
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test73
-rw-r--r--mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/plugin_dir_basic.test16
-rw-r--r--mysql-test/t/alter_table.test27
-rw-r--r--mysql-test/t/auth_rpl-master.opt2
-rw-r--r--mysql-test/t/auth_rpl-slave.opt4
-rw-r--r--mysql-test/t/auth_rpl.test66
-rw-r--r--mysql-test/t/ctype_errors.test17
-rw-r--r--mysql-test/t/ctype_utf16.test7
-rw-r--r--mysql-test/t/ctype_utf32_uca.test21
-rw-r--r--mysql-test/t/disabled.def4
-rw-r--r--mysql-test/t/error_simulation.test1
-rw-r--r--mysql-test/t/execution_constants.test10
-rw-r--r--mysql-test/t/explain.test10
-rw-r--r--mysql-test/t/flush.test33
-rw-r--r--mysql-test/t/func_math.test22
-rw-r--r--mysql-test/t/func_str.test19
-rw-r--r--mysql-test/t/func_time.test6
-rw-r--r--mysql-test/t/gis.test18
-rw-r--r--mysql-test/t/group_by.test14
-rw-r--r--mysql-test/t/heap.test2
-rw-r--r--mysql-test/t/implicit_commit.test1
-rw-r--r--mysql-test/t/information_schema.test182
-rw-r--r--mysql-test/t/merge.test27
-rw-r--r--mysql-test/t/myisampack.test44
-rw-r--r--mysql-test/t/mysql_embedded.test8
-rw-r--r--mysql-test/t/mysql_plugin-master.opt1
-rw-r--r--mysql-test/t/mysql_plugin.test318
-rw-r--r--mysql-test/t/mysqld--defaults-file.test16
-rw-r--r--mysql-test/t/mysqltest.test124
-rw-r--r--mysql-test/t/order_by.test7
-rw-r--r--mysql-test/t/partition_innodb_plugin.test2
-rw-r--r--mysql-test/t/plugin_auth.test59
-rw-r--r--mysql-test/t/secure_file_priv_win-master.opt1
-rw-r--r--mysql-test/t/secure_file_priv_win.test79
-rw-r--r--mysql-test/t/show_check.test18
-rw-r--r--mysql-test/t/sp-error.test22
-rw-r--r--mysql-test/t/sp-security.test37
-rw-r--r--mysql-test/t/sp.test103
-rw-r--r--mysql-test/t/sp_sync.test29
-rw-r--r--mysql-test/t/sp_trans.test33
-rw-r--r--mysql-test/t/subselect.test33
-rw-r--r--mysql-test/t/type_float.test23
-rw-r--r--mysql-test/t/type_newdecimal.test14
-rw-r--r--mysql-test/t/union.test41
-rw-r--r--mysql-test/t/xml.test9
-rw-r--r--mysql-test/valgrind.supp43
-rw-r--r--mysys/CMakeLists.txt2
-rw-r--r--mysys/array.c4
-rw-r--r--mysys/base64.c5
-rw-r--r--mysys/charset-def.c5
-rw-r--r--mysys/charset.c4
-rw-r--r--mysys/checksum.c4
-rw-r--r--mysys/errors.c4
-rw-r--r--mysys/hash.c4
-rw-r--r--mysys/lf_alloc-pin.c4
-rw-r--r--mysys/lf_dynarray.c4
-rw-r--r--mysys/lf_hash.c4
-rw-r--r--mysys/list.c4
-rw-r--r--mysys/mf_cache.c4
-rw-r--r--mysys/mf_dirname.c4
-rw-r--r--mysys/mf_fn_ext.c4
-rw-r--r--mysys/mf_format.c4
-rw-r--r--mysys/mf_getdate.c5
-rw-r--r--mysys/mf_iocache.c4
-rw-r--r--mysys/mf_iocache2.c4
-rw-r--r--mysys/mf_keycache.c4
-rw-r--r--mysys/mf_keycaches.c5
-rw-r--r--mysys/mf_loadpath.c4
-rw-r--r--mysys/mf_pack.c2
-rw-r--r--mysys/mf_path.c4
-rw-r--r--mysys/mf_sort.c4
-rw-r--r--mysys/mf_tempdir.c4
-rw-r--r--mysys/mf_tempfile.c4
-rw-r--r--mysys/mf_unixpath.c4
-rw-r--r--mysys/my_alloc.c4
-rw-r--r--mysys/my_atomic.c4
-rw-r--r--mysys/my_bit.c4
-rw-r--r--mysys/my_bitmap.c6
-rw-r--r--mysys/my_chsize.c5
-rw-r--r--mysys/my_compress.c4
-rw-r--r--mysys/my_copy.c4
-rw-r--r--mysys/my_create.c5
-rw-r--r--mysys/my_delete.c4
-rw-r--r--mysys/my_error.c4
-rw-r--r--mysys/my_file.c4
-rw-r--r--mysys/my_fstream.c4
-rw-r--r--mysys/my_gethwaddr.c4
-rw-r--r--mysys/my_getncpus.c4
-rw-r--r--mysys/my_getwd.c4
-rw-r--r--mysys/my_handler_errors.h17
-rw-r--r--mysys/my_init.c8
-rw-r--r--mysys/my_largepage.c4
-rw-r--r--mysys/my_lib.c4
-rw-r--r--mysys/my_lock.c4
-rw-r--r--mysys/my_lockmem.c4
-rw-r--r--mysys/my_mess.c4
-rw-r--r--mysys/my_mmap.c4
-rw-r--r--mysys/my_new.cc5
-rw-r--r--mysys/my_once.c4
-rw-r--r--mysys/my_open.c4
-rw-r--r--mysys/my_pread.c5
-rw-r--r--mysys/my_pthread.c4
-rw-r--r--mysys/my_quick.c5
-rw-r--r--mysys/my_rdtsc.c4
-rw-r--r--mysys/my_read.c4
-rw-r--r--mysys/my_redel.c4
-rw-r--r--mysys/my_rename.c4
-rw-r--r--mysys/my_seek.c4
-rw-r--r--mysys/my_sleep.c4
-rw-r--r--mysys/my_static.c4
-rw-r--r--mysys/my_static.h4
-rw-r--r--mysys/my_symlink.c19
-rw-r--r--mysys/my_sync.c4
-rw-r--r--mysys/my_thr_init.c4
-rw-r--r--mysys/my_timer_cycles.il5
-rw-r--r--mysys/my_wincond.c4
-rw-r--r--mysys/my_windac.c4
-rw-r--r--mysys/my_winerr.c5
-rw-r--r--mysys/my_winfile.c4
-rw-r--r--mysys/my_winthread.c4
-rw-r--r--mysys/my_write.c4
-rw-r--r--mysys/mysys_priv.h4
-rw-r--r--mysys/ptr_cmp.c4
-rw-r--r--mysys/rijndael.c4
-rw-r--r--mysys/stacktrace.c4
-rw-r--r--mysys/string.c4
-rw-r--r--mysys/test_charset.c4
-rw-r--r--mysys/testhash.c4
-rw-r--r--mysys/thr_alarm.c4
-rw-r--r--mysys/thr_lock.c4
-rw-r--r--mysys/thr_mutex.c5
-rw-r--r--mysys/thr_rwlock.c4
-rw-r--r--mysys/tree.c4
-rw-r--r--packaging/WiX/CMakeLists.txt2
-rw-r--r--packaging/WiX/CPackWixConfig.cmake14
-rw-r--r--packaging/WiX/ca/CMakeLists.txt2
-rw-r--r--packaging/WiX/ca/CustomAction.cpp4
-rw-r--r--packaging/WiX/create_msi.cmake.in15
-rw-r--r--packaging/WiX/custom_ui.wxs18
-rw-r--r--packaging/WiX/extra.wxs.in17
-rw-r--r--packaging/WiX/mysql_server.wxs.in18
-rw-r--r--plugin/audit_null/audit_null.c14
-rw-r--r--plugin/auth_examples/dialog_examples.c6
-rw-r--r--plugin/auth_examples/qa_auth_interface.c3
-rw-r--r--plugin/auth_examples/qa_auth_server.c3
-rw-r--r--plugin/auth_examples/test_plugin.c8
-rw-r--r--plugin/auth_socket/auth_socket.c5
-rw-r--r--plugin/daemon_example/CMakeLists.txt2
-rw-r--r--plugin/daemon_example/daemon_example.cc5
-rw-r--r--plugin/daemon_example/daemon_example.ini9
-rw-r--r--plugin/fulltext/plugin_example.c5
-rw-r--r--plugin/semisync/semisync_master.cc21
-rw-r--r--plugin/semisync/semisync_master.h4
-rw-r--r--plugin/semisync/semisync_master_plugin.cc6
-rw-r--r--plugin/semisync/semisync_slave.cc3
-rw-r--r--plugin/semisync/semisync_slave.h3
-rw-r--r--plugin/semisync/semisync_slave_plugin.cc3
-rw-r--r--plugin/win_auth_client/common.cc18
-rw-r--r--plugin/win_auth_client/common.h14
-rw-r--r--plugin/win_auth_client/handshake_client.cc27
-rw-r--r--plugin/win_auth_client/log_client.cc50
-rw-r--r--scripts/CMakeLists.txt12
-rwxr-xr-xscripts/dheadgen.pl2
-rw-r--r--scripts/mysql_config.pl.in4
-rw-r--r--scripts/mysql_config.sh4
-rw-r--r--scripts/mysql_convert_table_format.sh3
-rw-r--r--scripts/mysql_find_rows.sh3
-rw-r--r--scripts/mysql_fix_extensions.sh7
-rw-r--r--scripts/mysql_install_db.pl.in5
-rw-r--r--scripts/mysql_install_db.sh8
-rwxr-xr-xscripts/mysql_secure_installation.pl.in4
-rw-r--r--scripts/mysql_secure_installation.sh4
-rw-r--r--scripts/mysql_setpermission.sh7
-rw-r--r--scripts/mysql_system_tables.sql2
-rw-r--r--scripts/mysql_system_tables_data.sql4
-rw-r--r--scripts/mysql_system_tables_fix.sql2
-rw-r--r--scripts/mysql_zap.sh3
-rw-r--r--scripts/mysqlaccess.sh7
-rw-r--r--scripts/mysqld_multi.sh17
-rw-r--r--scripts/mysqldumpslow.sh19
-rw-r--r--scripts/mysqlhotcopy.sh17
-rw-r--r--sql-bench/as3ap.sh7
-rw-r--r--sql-bench/bench-count-distinct.sh7
-rw-r--r--sql-bench/bench-init.pl.sh7
-rw-r--r--sql-bench/compare-results.sh7
-rw-r--r--sql-bench/copy-db.sh7
-rw-r--r--sql-bench/crash-me.sh7
-rw-r--r--sql-bench/run-all-tests.sh7
-rw-r--r--sql-bench/server-cfg.sh7
-rw-r--r--sql-bench/test-ATIS.sh7
-rw-r--r--sql-bench/test-alter-table.sh7
-rw-r--r--sql-bench/test-big-tables.sh7
-rw-r--r--sql-bench/test-connect.sh7
-rw-r--r--sql-bench/test-create.sh7
-rw-r--r--sql-bench/test-insert.sh7
-rw-r--r--sql-bench/test-select.sh7
-rw-r--r--sql-bench/test-transactions.sh7
-rw-r--r--sql-bench/test-wisconsin.sh7
-rw-r--r--sql-common/client.c2
-rw-r--r--sql-common/client_plugin.c4
-rw-r--r--sql-common/my_time.c4
-rw-r--r--sql-common/my_user.c5
-rw-r--r--sql/CMakeLists.txt10
-rw-r--r--sql/authors.h2
-rw-r--r--sql/client_settings.h19
-rw-r--r--sql/contributors.h3
-rw-r--r--sql/debug_sync.cc4
-rw-r--r--sql/debug_sync.h4
-rw-r--r--sql/derror.h2
-rw-r--r--sql/des_key_file.cc4
-rw-r--r--sql/des_key_file.h2
-rw-r--r--sql/discover.cc4
-rw-r--r--sql/discover.h2
-rw-r--r--sql/event_data_objects.cc4
-rw-r--r--sql/event_data_objects.h4
-rw-r--r--sql/event_db_repository.cc5
-rw-r--r--sql/event_db_repository.h7
-rw-r--r--sql/event_parse_data.cc5
-rw-r--r--sql/event_parse_data.h5
-rw-r--r--sql/event_queue.cc4
-rw-r--r--sql/event_queue.h4
-rw-r--r--sql/event_scheduler.cc2
-rw-r--r--sql/event_scheduler.h4
-rw-r--r--sql/events.cc3
-rw-r--r--sql/field.cc7
-rw-r--r--sql/field.h10
-rw-r--r--sql/field_conv.cc7
-rw-r--r--sql/filesort.cc17
-rw-r--r--sql/filesort.h2
-rw-r--r--sql/frm_crypt.cc4
-rw-r--r--sql/frm_crypt.h2
-rw-r--r--sql/gen_lex_hash.cc28
-rw-r--r--sql/gstream.cc4
-rw-r--r--sql/gstream.h4
-rw-r--r--sql/ha_ndbcluster.cc5
-rw-r--r--sql/ha_ndbcluster.h5
-rw-r--r--sql/ha_ndbcluster_binlog.cc6
-rw-r--r--sql/ha_ndbcluster_binlog.h5
-rw-r--r--sql/ha_partition.cc9
-rw-r--r--sql/ha_partition.h5
-rw-r--r--sql/handler.cc7
-rw-r--r--sql/handler.h7
-rw-r--r--sql/hash_filo.cc4
-rw-r--r--sql/hash_filo.h4
-rw-r--r--sql/hostname.h2
-rw-r--r--sql/init.cc4
-rw-r--r--sql/init.h2
-rw-r--r--sql/item.cc9
-rw-r--r--sql/item_buff.cc4
-rw-r--r--sql/item_cmpfunc.cc34
-rw-r--r--sql/item_create.cc3
-rw-r--r--sql/item_create.h5
-rw-r--r--sql/item_func.cc14
-rw-r--r--sql/item_geofunc.cc4
-rw-r--r--sql/item_row.cc4
-rw-r--r--sql/item_row.h4
-rw-r--r--sql/item_strfunc.cc9
-rw-r--r--sql/item_subselect.cc17
-rw-r--r--sql/item_subselect.h5
-rw-r--r--sql/item_sum.cc11
-rw-r--r--sql/item_sum.h5
-rw-r--r--sql/item_timefunc.cc7
-rw-r--r--sql/item_xmlfunc.cc23
-rw-r--r--sql/item_xmlfunc.h5
-rw-r--r--sql/key.cc4
-rw-r--r--sql/key.h2
-rw-r--r--sql/keycaches.cc4
-rw-r--r--sql/keycaches.h4
-rw-r--r--sql/lex.h4
-rw-r--r--sql/lock.cc4
-rw-r--r--sql/lock.h15
-rw-r--r--sql/log.cc16
-rw-r--r--sql/log_event.cc168
-rw-r--r--sql/log_event.h4
-rw-r--r--sql/log_event_old.cc14
-rw-r--r--sql/main.cc5
-rw-r--r--sql/mdl.cc4
-rw-r--r--sql/mdl.h27
-rw-r--r--sql/message.h5
-rw-r--r--sql/mf_iocache.cc4
-rw-r--r--sql/my_decimal.cc4
-rw-r--r--sql/my_decimal.h8
-rw-r--r--sql/mysqld.cc27
-rw-r--r--sql/mysqld.h2
-rw-r--r--sql/mysqld_suffix.h5
-rw-r--r--sql/opt_range.cc5
-rw-r--r--sql/opt_range.h4
-rw-r--r--sql/opt_sum.cc3
-rw-r--r--sql/parse_file.cc4
-rw-r--r--sql/parse_file.h4
-rw-r--r--sql/partition_element.h2
-rw-r--r--sql/partition_info.cc4
-rw-r--r--sql/partition_info.h2
-rw-r--r--sql/password.c5
-rw-r--r--sql/procedure.cc4
-rw-r--r--sql/procedure.h4
-rw-r--r--sql/protocol.cc30
-rw-r--r--sql/protocol.h4
-rw-r--r--sql/records.cc4
-rw-r--r--sql/records.h4
-rw-r--r--sql/repl_failsafe.cc4
-rw-r--r--sql/repl_failsafe.h4
-rw-r--r--sql/replication.h4
-rw-r--r--sql/rpl_constants.h16
-rw-r--r--sql/rpl_filter.cc4
-rw-r--r--sql/rpl_filter.h4
-rw-r--r--sql/rpl_handler.cc4
-rw-r--r--sql/rpl_handler.h4
-rw-r--r--sql/rpl_injector.cc2
-rw-r--r--sql/rpl_injector.h2
-rw-r--r--sql/rpl_mi.cc19
-rw-r--r--sql/rpl_mi.h6
-rw-r--r--sql/rpl_record.cc4
-rw-r--r--sql/rpl_record.h4
-rw-r--r--sql/rpl_record_old.cc14
-rw-r--r--sql/rpl_record_old.h4
-rw-r--r--sql/rpl_reporting.cc4
-rw-r--r--sql/rpl_reporting.h2
-rw-r--r--sql/rpl_rli.cc4
-rw-r--r--sql/rpl_rli.h4
-rw-r--r--sql/rpl_tblmap.cc4
-rw-r--r--sql/rpl_tblmap.h4
-rw-r--r--sql/rpl_utility.cc2
-rw-r--r--sql/rpl_utility.h2
-rw-r--r--sql/scheduler.cc4
-rw-r--r--sql/scheduler.h4
-rw-r--r--sql/set_var.cc6
-rw-r--r--sql/sha2.cc4
-rw-r--r--sql/share/CMakeLists.txt3
-rw-r--r--sql/share/charsets/cp1251.xml4
-rw-r--r--sql/share/errmsg-utf8.txt258
-rw-r--r--sql/slave.cc8
-rw-r--r--sql/slave.h4
-rw-r--r--sql/sp.cc54
-rw-r--r--sql/sp.h4
-rw-r--r--sql/sp_cache.cc4
-rw-r--r--sql/sp_cache.h4
-rw-r--r--sql/sp_head.cc8
-rw-r--r--sql/sp_head.h4
-rw-r--r--sql/sp_pcontext.cc4
-rw-r--r--sql/sp_pcontext.h4
-rw-r--r--sql/sp_rcontext.cc4
-rw-r--r--sql/sp_rcontext.h4
-rw-r--r--sql/spatial.cc5
-rw-r--r--sql/spatial.h4
-rw-r--r--sql/sql_acl.cc15
-rw-r--r--sql/sql_acl.h4
-rw-r--r--sql/sql_admin.cc2
-rw-r--r--sql/sql_admin.h2
-rw-r--r--sql/sql_alter.cc2
-rw-r--r--sql/sql_alter.h2
-rw-r--r--sql/sql_analyse.cc3
-rw-r--r--sql/sql_analyse.h4
-rw-r--r--sql/sql_array.h5
-rw-r--r--sql/sql_audit.cc4
-rw-r--r--sql/sql_audit.h4
-rw-r--r--sql/sql_base.cc85
-rw-r--r--sql/sql_binlog.cc3
-rw-r--r--sql/sql_binlog.h2
-rw-r--r--sql/sql_bitmap.h4
-rw-r--r--sql/sql_builtin.cc.in2
-rw-r--r--sql/sql_cache.cc4
-rw-r--r--sql/sql_cache.h4
-rw-r--r--sql/sql_callback.h4
-rw-r--r--sql/sql_class.cc45
-rw-r--r--sql/sql_class.h29
-rw-r--r--sql/sql_client.cc4
-rw-r--r--sql/sql_connect.cc6
-rw-r--r--sql/sql_connect.h2
-rw-r--r--sql/sql_const.h2
-rw-r--r--sql/sql_crypt.cc4
-rw-r--r--sql/sql_crypt.h4
-rw-r--r--sql/sql_cursor.h4
-rw-r--r--sql/sql_db.cc6
-rw-r--r--sql/sql_db.h2
-rw-r--r--sql/sql_delete.cc4
-rw-r--r--sql/sql_delete.h2
-rw-r--r--sql/sql_derived.cc4
-rw-r--r--sql/sql_derived.h2
-rw-r--r--sql/sql_do.cc4
-rw-r--r--sql/sql_do.h2
-rw-r--r--sql/sql_error.cc4
-rw-r--r--sql/sql_handler.cc2
-rw-r--r--sql/sql_help.cc2
-rw-r--r--sql/sql_help.h2
-rw-r--r--sql/sql_insert.cc15
-rw-r--r--sql/sql_insert.h2
-rw-r--r--sql/sql_lex.cc21
-rw-r--r--sql/sql_lex.h89
-rw-r--r--sql/sql_list.cc4
-rw-r--r--sql/sql_list.h4
-rw-r--r--sql/sql_load.cc19
-rw-r--r--sql/sql_load.h2
-rw-r--r--sql/sql_locale.cc4
-rw-r--r--sql/sql_locale.h2
-rw-r--r--sql/sql_manager.cc4
-rw-r--r--sql/sql_manager.h2
-rw-r--r--sql/sql_parse.cc53
-rw-r--r--sql/sql_parse.h2
-rw-r--r--sql/sql_partition.cc29
-rw-r--r--sql/sql_partition.h4
-rw-r--r--sql/sql_partition_admin.cc2
-rw-r--r--sql/sql_partition_admin.h2
-rw-r--r--sql/sql_plist.h4
-rw-r--r--sql/sql_plugin.cc4
-rw-r--r--sql/sql_plugin.h4
-rw-r--r--sql/sql_plugin_services.h4
-rw-r--r--sql/sql_prepare.cc4
-rw-r--r--sql/sql_prepare.h5
-rw-r--r--sql/sql_priv.h11
-rw-r--r--sql/sql_profile.cc6
-rw-r--r--sql/sql_profile.h4
-rw-r--r--sql/sql_rename.cc4
-rw-r--r--sql/sql_rename.h2
-rw-r--r--sql/sql_repl.cc45
-rw-r--r--sql/sql_repl.h4
-rw-r--r--sql/sql_select.cc17
-rw-r--r--sql/sql_select.h4
-rw-r--r--sql/sql_servers.cc4
-rw-r--r--sql/sql_servers.h2
-rw-r--r--sql/sql_show.cc33
-rw-r--r--sql/sql_show.h2
-rw-r--r--sql/sql_signal.cc4
-rw-r--r--sql/sql_signal.h5
-rw-r--r--sql/sql_sort.h4
-rw-r--r--sql/sql_string.cc4
-rw-r--r--sql/sql_string.h4
-rw-r--r--sql/sql_table.cc23
-rw-r--r--sql/sql_table.h2
-rw-r--r--sql/sql_tablespace.cc4
-rw-r--r--sql/sql_tablespace.h2
-rw-r--r--sql/sql_test.cc4
-rw-r--r--sql/sql_test.h2
-rw-r--r--sql/sql_time.cc4
-rw-r--r--sql/sql_time.h2
-rw-r--r--sql/sql_trigger.cc3
-rw-r--r--sql/sql_trigger.h5
-rw-r--r--sql/sql_udf.cc4
-rw-r--r--sql/sql_udf.h5
-rw-r--r--sql/sql_union.cc40
-rw-r--r--sql/sql_union.h2
-rw-r--r--sql/sql_update.cc4
-rw-r--r--sql/sql_update.h2
-rw-r--r--sql/sql_view.h4
-rw-r--r--sql/sql_yacc.yy46
-rw-r--r--sql/strfunc.h2
-rw-r--r--sql/structs.h4
-rw-r--r--sql/sys_vars.cc2
-rw-r--r--sql/sys_vars.h4
-rw-r--r--sql/sys_vars_shared.h4
-rw-r--r--sql/table.cc3
-rw-r--r--sql/table.h4
-rw-r--r--sql/thr_malloc.cc4
-rw-r--r--sql/thr_malloc.h2
-rw-r--r--sql/transaction.h5
-rw-r--r--sql/tzfile.h5
-rw-r--r--sql/tztime.cc4
-rw-r--r--sql/tztime.h4
-rw-r--r--sql/udf_example.c4
-rw-r--r--sql/uniques.cc4
-rw-r--r--sql/unireg.cc6
-rw-r--r--storage/archive/archive_reader.c15
-rw-r--r--storage/archive/ha_archive.cc10
-rw-r--r--storage/archive/ha_archive.h4
-rw-r--r--storage/blackhole/ha_blackhole.cc7
-rw-r--r--storage/blackhole/ha_blackhole.h4
-rw-r--r--storage/csv/ha_tina.cc7
-rw-r--r--storage/csv/ha_tina.h4
-rw-r--r--storage/csv/transparent_file.cc4
-rw-r--r--storage/csv/transparent_file.h5
-rw-r--r--storage/example/ha_example.cc7
-rw-r--r--storage/example/ha_example.h4
-rw-r--r--storage/federated/ha_federated.cc7
-rw-r--r--storage/federated/ha_federated.h4
-rw-r--r--storage/federatedx/ha_federatedx.cc16
-rw-r--r--storage/heap/ha_heap.cc9
-rw-r--r--storage/heap/ha_heap.h6
-rw-r--r--storage/heap/heapdef.h4
-rw-r--r--storage/heap/hp_block.c4
-rw-r--r--storage/heap/hp_clear.c5
-rw-r--r--storage/heap/hp_close.c4
-rw-r--r--storage/heap/hp_create.c5
-rw-r--r--storage/heap/hp_hash.c4
-rw-r--r--storage/heap/hp_info.c1
-rw-r--r--storage/heap/hp_open.c4
-rw-r--r--storage/heap/hp_panic.c5
-rw-r--r--storage/heap/hp_rename.c4
-rw-r--r--storage/heap/hp_rkey.c5
-rw-r--r--storage/heap/hp_static.c4
-rw-r--r--storage/heap/hp_test1.c4
-rw-r--r--storage/heap/hp_test2.c6
-rw-r--r--storage/heap/hp_write.c5
-rw-r--r--storage/innobase/btr/btr0btr.c100
-rw-r--r--storage/innobase/btr/btr0cur.c105
-rw-r--r--storage/innobase/btr/btr0pcur.c38
-rw-r--r--storage/innobase/btr/btr0sea.c3
-rw-r--r--storage/innobase/buf/buf0buddy.c411
-rw-r--r--storage/innobase/buf/buf0buf.c591
-rw-r--r--storage/innobase/buf/buf0flu.c4
-rw-r--r--storage/innobase/buf/buf0lru.c233
-rw-r--r--storage/innobase/buf/buf0rea.c173
-rw-r--r--storage/innobase/dict/dict0crea.c4
-rw-r--r--storage/innobase/dict/dict0dict.c192
-rw-r--r--storage/innobase/dict/dict0load.c94
-rw-r--r--storage/innobase/handler/ha_innodb.cc195
-rw-r--r--storage/innobase/handler/i_s.cc42
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c44
-rw-r--r--storage/innobase/include/btr0btr.h32
-rw-r--r--storage/innobase/include/btr0btr.ic10
-rw-r--r--storage/innobase/include/btr0pcur.h21
-rw-r--r--storage/innobase/include/btr0pcur.ic9
-rw-r--r--storage/innobase/include/buf0buddy.h46
-rw-r--r--storage/innobase/include/buf0buddy.ic68
-rw-r--r--storage/innobase/include/buf0buf.h47
-rw-r--r--storage/innobase/include/buf0buf.ic59
-rw-r--r--storage/innobase/include/buf0lru.h51
-rw-r--r--storage/innobase/include/buf0rea.h25
-rw-r--r--storage/innobase/include/buf0types.h17
-rw-r--r--storage/innobase/include/db0err.h6
-rw-r--r--storage/innobase/include/dict0boot.h6
-rw-r--r--storage/innobase/include/dict0dict.h82
-rw-r--r--storage/innobase/include/dict0dict.ic46
-rw-r--r--storage/innobase/include/dict0mem.h14
-rw-r--r--storage/innobase/include/dict0types.h3
-rw-r--r--storage/innobase/include/mtr0mtr.h10
-rw-r--r--storage/innobase/include/page0page.h5
-rw-r--r--storage/innobase/include/row0row.h28
-rw-r--r--storage/innobase/include/row0row.ic25
-rw-r--r--storage/innobase/include/row0upd.ic9
-rw-r--r--storage/innobase/include/srv0srv.h6
-rw-r--r--storage/innobase/include/sync0rw.h5
-rw-r--r--storage/innobase/include/sync0rw.ic1
-rw-r--r--storage/innobase/include/sync0sync.h10
-rw-r--r--storage/innobase/include/sync0sync.ic5
-rw-r--r--storage/innobase/include/trx0sys.h13
-rw-r--r--storage/innobase/include/trx0sys.ic24
-rw-r--r--storage/innobase/include/trx0undo.h46
-rw-r--r--storage/innobase/include/ut0mem.h39
-rw-r--r--storage/innobase/include/ut0mem.ic23
-rw-r--r--storage/innobase/mtr/mtr0mtr.c38
-rw-r--r--storage/innobase/page/page0zip.c186
-rw-r--r--storage/innobase/pars/pars0opt.c2
-rw-r--r--storage/innobase/rem/rem0rec.c10
-rw-r--r--storage/innobase/row/row0ins.c11
-rw-r--r--storage/innobase/row/row0merge.c5
-rw-r--r--storage/innobase/row/row0mysql.c70
-rw-r--r--storage/innobase/row/row0purge.c33
-rw-r--r--storage/innobase/row/row0row.c55
-rw-r--r--storage/innobase/row/row0sel.c116
-rw-r--r--storage/innobase/row/row0uins.c4
-rw-r--r--storage/innobase/row/row0umod.c25
-rw-r--r--storage/innobase/row/row0upd.c7
-rw-r--r--storage/innobase/srv/srv0srv.c4
-rw-r--r--storage/innobase/sync/sync0rw.c9
-rw-r--r--storage/innobase/sync/sync0sync.c35
-rw-r--r--storage/innobase/trx/trx0rec.c70
-rw-r--r--storage/innobase/trx/trx0undo.c66
-rw-r--r--storage/innobase/ut/ut0mem.c49
-rw-r--r--storage/innobase/ut/ut0ut.c6
-rw-r--r--storage/myisam/ft_boolean_search.c6
-rw-r--r--storage/myisam/ft_nlq_search.c6
-rw-r--r--storage/myisam/ft_parser.c4
-rw-r--r--storage/myisam/ft_static.c5
-rw-r--r--storage/myisam/ft_update.c4
-rw-r--r--storage/myisam/ftdefs.h5
-rw-r--r--storage/myisam/fulltext.h4
-rw-r--r--storage/myisam/ha_myisam.cc8
-rw-r--r--storage/myisam/ha_myisam.h3
-rw-r--r--storage/myisam/mi_cache.c5
-rw-r--r--storage/myisam/mi_changed.c5
-rw-r--r--storage/myisam/mi_check.c9
-rw-r--r--storage/myisam/mi_close.c4
-rw-r--r--storage/myisam/mi_create.c5
-rw-r--r--storage/myisam/mi_dbug.c4
-rw-r--r--storage/myisam/mi_delete.c4
-rw-r--r--storage/myisam/mi_delete_all.c4
-rw-r--r--storage/myisam/mi_delete_table.c4
-rw-r--r--storage/myisam/mi_dynrec.c4
-rw-r--r--storage/myisam/mi_extra.c4
-rw-r--r--storage/myisam/mi_extrafunc.h5
-rw-r--r--storage/myisam/mi_info.c5
-rw-r--r--storage/myisam/mi_key.c4
-rw-r--r--storage/myisam/mi_keycache.c5
-rw-r--r--storage/myisam/mi_locking.c4
-rw-r--r--storage/myisam/mi_log.c4
-rw-r--r--storage/myisam/mi_open.c4
-rw-r--r--storage/myisam/mi_packrec.c4
-rw-r--r--storage/myisam/mi_page.c4
-rw-r--r--storage/myisam/mi_panic.c5
-rw-r--r--storage/myisam/mi_preload.c4
-rw-r--r--storage/myisam/mi_range.c5
-rw-r--r--storage/myisam/mi_rename.c4
-rw-r--r--storage/myisam/mi_rkey.c5
-rw-r--r--storage/myisam/mi_rnext.c4
-rw-r--r--storage/myisam/mi_rnext_same.c5
-rw-r--r--storage/myisam/mi_rprev.c5
-rw-r--r--storage/myisam/mi_rsame.c5
-rw-r--r--storage/myisam/mi_search.c4
-rw-r--r--storage/myisam/mi_static.c4
-rw-r--r--storage/myisam/mi_statrec.c4
-rw-r--r--storage/myisam/mi_test1.c5
-rw-r--r--storage/myisam/mi_test2.c4
-rw-r--r--storage/myisam/mi_test3.c4
-rw-r--r--storage/myisam/mi_unique.c4
-rw-r--r--storage/myisam/mi_update.c5
-rw-r--r--storage/myisam/mi_write.c7
-rw-r--r--storage/myisam/myisam_ftdump.c4
-rw-r--r--storage/myisam/myisamdef.h5
-rw-r--r--storage/myisam/myisamlog.c4
-rw-r--r--storage/myisam/myisampack.c4
-rw-r--r--storage/myisam/rt_split.c4
-rw-r--r--storage/myisam/rt_test.c4
-rw-r--r--storage/myisam/sort.c4
-rw-r--r--storage/myisam/sp_key.c4
-rw-r--r--storage/myisam/sp_test.c4
-rw-r--r--storage/myisammrg/ha_myisammrg.cc77
-rw-r--r--storage/myisammrg/ha_myisammrg.h5
-rw-r--r--storage/myisammrg/myrg_close.c4
-rw-r--r--storage/myisammrg/myrg_create.c5
-rw-r--r--storage/myisammrg/myrg_def.h4
-rw-r--r--storage/myisammrg/myrg_extra.c5
-rw-r--r--storage/myisammrg/myrg_info.c5
-rw-r--r--storage/myisammrg/myrg_open.c24
-rw-r--r--storage/myisammrg/myrg_queue.c4
-rw-r--r--storage/myisammrg/myrg_rkey.c5
-rw-r--r--storage/myisammrg/myrg_static.c5
-rw-r--r--storage/ndb/MAINTAINERS2
-rw-r--r--storage/ndb/config/win-lib.am16
-rw-r--r--storage/ndb/config/win-prg.am16
-rw-r--r--storage/ndb/src/kernel/blocks/lgman.cpp7
-rw-r--r--storage/ndb/test/run-test/autotest-boot.sh17
-rw-r--r--storage/ndb/test/run-test/autotest-run.sh17
-rw-r--r--storage/ndb/test/run-test/files.cpp18
-rw-r--r--storage/ndb/test/run-test/setup.cpp17
-rw-r--r--storage/ndb/test/run-test/upgrade-boot.sh17
-rw-r--r--storage/ndb/test/sql/BANK.sql44
-rw-r--r--storage/ndb/test/sql/T1.sql9
-rw-r--r--storage/ndb/test/sql/test_create_drop.pl196
-rw-r--r--storage/ndb/test/sql/test_range_bounds.pl235
-rw-r--r--storage/ndb/test/tools/log_listner.cpp18
-rw-r--r--storage/pbxt/src/ha_pbxt.cc58
-rw-r--r--storage/perfschema/ha_perfschema.cc3
-rw-r--r--storage/perfschema/pfs.cc3
-rw-r--r--storage/perfschema/pfs_atomic.cc4
-rw-r--r--storage/perfschema/pfs_atomic.h4
-rw-r--r--storage/perfschema/pfs_column_types.h3
-rw-r--r--storage/perfschema/pfs_instr.cc2
-rw-r--r--storage/perfschema/pfs_timer.cc3
-rw-r--r--storage/perfschema/pfs_timer.h3
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.h2
-rw-r--r--storage/perfschema/table_setup_consumers.h3
-rw-r--r--storage/perfschema/table_setup_instruments.h3
-rw-r--r--storage/perfschema/table_setup_timers.h3
-rw-r--r--storage/perfschema/unittest/CMakeLists.txt3
-rw-r--r--storage/perfschema/unittest/conf.txt2
-rw-r--r--storage/perfschema/unittest/pfs-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_timer-t.cc2
-rw-r--r--storage/perfschema/unittest/stub_pfs_global.h3
-rw-r--r--storage/perfschema/unittest/stub_print_error.h3
-rw-r--r--storage/sphinx/ha_sphinx.cc20
-rw-r--r--storage/xtradb/handler/ha_innodb.cc57
-rw-r--r--storage/xtradb/handler/i_s.cc963
-rw-r--r--strings/conf_to_src.c5
-rw-r--r--strings/ctype-big5.c4
-rw-r--r--strings/ctype-cp932.c4
-rw-r--r--strings/ctype-czech.c4
-rw-r--r--strings/ctype-euc_kr.c4
-rw-r--r--strings/ctype-eucjpms.c5
-rw-r--r--strings/ctype-extra.c3
-rw-r--r--strings/ctype-gb2312.c4
-rw-r--r--strings/ctype-gbk.c4
-rw-r--r--strings/ctype-latin1.c5
-rw-r--r--strings/ctype-mb.c4
-rw-r--r--strings/ctype-simple.c4
-rw-r--r--strings/ctype-sjis.c4
-rw-r--r--strings/ctype-tis620.c8
-rw-r--r--strings/ctype-uca.c84
-rw-r--r--strings/ctype-ucs2.c8
-rw-r--r--strings/ctype-ujis.c2
-rw-r--r--strings/ctype-utf8.c6
-rw-r--r--strings/ctype-win1250ch.c4
-rw-r--r--strings/ctype.c5
-rw-r--r--strings/decimal.c15
-rw-r--r--strings/do_ctype.c4
-rw-r--r--strings/dtoa.c25
-rw-r--r--strings/dump_map.c3
-rw-r--r--strings/my_strchr.c4
-rw-r--r--strings/my_vsnprintf.c4
-rw-r--r--strings/str_alloc.c5
-rw-r--r--strings/strmake.c5
-rw-r--r--strings/uca-dump.c3
-rw-r--r--strings/uctypedump.c3
-rw-r--r--strings/utr11-dump.c3
-rw-r--r--strings/xml.c2
-rw-r--r--support-files/config.huge.ini.sh16
-rw-r--r--support-files/config.medium.ini.sh15
-rw-r--r--support-files/config.small.ini.sh15
-rw-r--r--support-files/dtrace/locktime.d16
-rw-r--r--support-files/dtrace/query-execandqc.d16
-rw-r--r--support-files/dtrace/query-filesort-time.d16
-rw-r--r--support-files/dtrace/query-network-time.d16
-rw-r--r--support-files/dtrace/query-parse-time.d16
-rw-r--r--support-files/dtrace/query-rowops.d16
-rw-r--r--support-files/dtrace/query-time.d16
-rw-r--r--support-files/dtrace/statement-time.d16
-rw-r--r--support-files/dtrace/statement-type-aggregate.d16
-rw-r--r--support-files/mysql.spec.sh291
-rw-r--r--support-files/ndb-config-2-node.ini.sh15
-rwxr-xr-xtests/big_record.pl4
-rw-r--r--tests/bug25714.c5
-rwxr-xr-xtests/grant.pl5
-rw-r--r--tests/mysql_client_test.c45
-rw-r--r--tests/thread_test.c4
-rw-r--r--unittest/examples/core-t.c3
-rw-r--r--unittest/examples/skip-t.c2
-rw-r--r--unittest/examples/skip_all-t.c2
-rw-r--r--unittest/examples/todo-t.c2
-rw-r--r--unittest/mysys/base64-t.c5
-rw-r--r--unittest/mysys/bitmap-t.c5
-rw-r--r--unittest/mysys/lf-t.c9
-rw-r--r--unittest/mysys/my_atomic-t.c13
-rw-r--r--unittest/mysys/my_rdtsc-t.c5
-rw-r--r--unittest/mysys/my_vsnprintf-t.c4
-rw-r--r--unittest/mysys/thr_template.c5
-rw-r--r--unittest/mytap/t/basic-t.c2
-rw-r--r--unittest/strings/strings-t.c2
-rw-r--r--unittest/unit.pl3
-rw-r--r--vio/test-ssl.c4
-rw-r--r--vio/test-sslclient.c4
-rw-r--r--vio/test-sslserver.c4
-rw-r--r--vio/vio.c4
-rw-r--r--vio/vio_priv.h4
-rw-r--r--vio/viosocket.c3
-rw-r--r--vio/viossl.c4
-rw-r--r--vio/viosslfactories.c4
-rw-r--r--vio/viotest-ssl.c4
-rw-r--r--vio/viotest-sslconnect.cc15
-rw-r--r--vio/viotest.cc16
-rw-r--r--win/create_def_file.js3
1160 files changed, 12806 insertions, 6189 deletions
diff --git a/.bzrignore b/.bzrignore
index 0d70e0375e1..1c9bb50e800 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -145,8 +145,6 @@ COPYING
COPYING.LIB
core
core.*
-CPackConfig.cmake
-CPackSourceConfig.cmake
cscope.in.out
cscope.out
cscope.po.out
@@ -1098,6 +1096,8 @@ sql/share/slovak
sql/share/spanish
sql/share/swedish
sql/share/ukrainian
+CPackConfig.cmake
+CPackSourceConfig.cmake
Docs/INFO_BIN
Docs/INFO_SRC
tags
@@ -1131,3 +1131,6 @@ storage/maria/aria_log_control
scripts/mytop
include/*.h.tmp
cmd-line-utils/libedit/emacs.h
+mysql-test/collections/default.release
+support-files/plugins.files
+client/mysql_plugin
diff --git a/BUILD-CMAKE b/BUILD-CMAKE
index 68c40167da5..2f46a4581f9 100644
--- a/BUILD-CMAKE
+++ b/BUILD-CMAKE
@@ -1,3 +1,5 @@
+Copyright (c) 2009, 2010 Sun Microsystems, Inc.
+
How to Build MySQL server with CMake
WHAT YOU NEED
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index 3c30485ec5e..fb4add74d8b 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -1,4 +1,4 @@
-# Copyright (C) 2000, 2005 MySQL AB, 2008 Sun Microsystems, Inc.
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -12,8 +12,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
cflags="$c_warnings $extra_flags $EXTRA_FLAGS $EXTRA_CFLAGS"
cxxflags="$cxx_warnings $base_cxxflags $extra_flags $EXTRA_FLAGS $EXTRA_CXXFLAGS"
diff --git a/BUILD/autorun.sh b/BUILD/autorun.sh
index e9d92c4ebae..1d7cf5561ad 100755
--- a/BUILD/autorun.sh
+++ b/BUILD/autorun.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -14,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
# Create MySQL cmake configure wrapper
diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh
index 057e21ad02f..78e5350dc1b 100755
--- a/BUILD/build_mccge.sh
+++ b/BUILD/build_mccge.sh
@@ -15,8 +15,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
die()
{
diff --git a/BUILD/cmake_configure.sh b/BUILD/cmake_configure.sh
index 887408f9bfa..668d6a81b5c 100644
--- a/BUILD/cmake_configure.sh
+++ b/BUILD/cmake_configure.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -14,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
# Ensure cmake and perl are there
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
diff --git a/BUILD/compile-ia64-debug-max b/BUILD/compile-ia64-debug-max
index 85807e3752e..508cadf73e2 100755
--- a/BUILD/compile-ia64-debug-max
+++ b/BUILD/compile-ia64-debug-max
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2001, 2005 MySQL AB
+# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
gmake -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache
diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug
index 83de3c68152..faeb1b89597 100755
--- a/BUILD/compile-pentium-debug
+++ b/BUILD/compile-pentium-debug
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2000, 2007 MySQL AB
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max
index 37e4a30337b..0c925d8426f 100755
--- a/BUILD/compile-pentium-debug-max
+++ b/BUILD/compile-pentium-debug-max
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2001, 2007 MySQL AB
+# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-openssl b/BUILD/compile-pentium-debug-openssl
index 67e2327cb08..abf6b41a2d2 100755
--- a/BUILD/compile-pentium-debug-openssl
+++ b/BUILD/compile-pentium-debug-openssl
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2001, 2003 MySQL AB
+# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-yassl b/BUILD/compile-pentium-debug-yassl
index 29242a6853b..e8cfff6cb07 100755
--- a/BUILD/compile-pentium-debug-yassl
+++ b/BUILD/compile-pentium-debug-yassl
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-icc-valgrind-max b/BUILD/compile-pentium-icc-valgrind-max
index ebefb1b3fd0..b26df4b1bd6 100755
--- a/BUILD/compile-pentium-icc-valgrind-max
+++ b/BUILD/compile-pentium-icc-valgrind-max
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max
index ef4d7267e5f..7a2c6ae4980 100755
--- a/BUILD/compile-pentium-valgrind-max
+++ b/BUILD/compile-pentium-valgrind-max
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2002, 2005 MySQL AB
+# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug
index 01c15836a54..74909c346ec 100755
--- a/BUILD/compile-pentium64-debug
+++ b/BUILD/compile-pentium64-debug
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2005, 2007 MySQL AB
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max
index 375f15e9908..49a9c7daf3a 100755
--- a/BUILD/compile-pentium64-debug-max
+++ b/BUILD/compile-pentium64-debug-max
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2005, 2007 MySQL AB
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max
index e29fa64d261..cec7f734ef5 100755
--- a/BUILD/compile-pentium64-valgrind-max
+++ b/BUILD/compile-pentium64-valgrind-max
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2005 MySQL AB
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-solaris-sparc-forte b/BUILD/compile-solaris-sparc-forte
index 087fe22a591..14cb3ce1ff9 100755
--- a/BUILD/compile-solaris-sparc-forte
+++ b/BUILD/compile-solaris-sparc-forte
@@ -1,6 +1,7 @@
#! /bin/sh
-# Copyright (C) 2001, 2005 MySQL AB
+# Copyright (c) 2001, 2002, 2005, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Assume Forte is installed in /opt/SUNWSpro and ld is installed in
# /usr/ccs/bin
diff --git a/VERSION b/VERSION
index bb2827af62c..2b05cbd2d34 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
-MYSQL_VERSION_PATCH=15
+MYSQL_VERSION_PATCH=18
MYSQL_VERSION_EXTRA=-MariaDB
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 97fb4289872..25ae9370829 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -55,6 +55,9 @@ ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c)
TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
+MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c)
+TARGET_LINK_LIBRARIES(mysql_plugin mysqlclient)
+
MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
@@ -70,7 +73,7 @@ IF(WIN32)
MYSQL_ADD_EXECUTABLE(echo echo.c)
ENDIF(WIN32)
-SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap
+SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin
PROPERTIES HAS_CXX TRUE)
ADD_DEFINITIONS(-DHAVE_DLOPEN)
diff --git a/client/client_priv.h b/client/client_priv.h
index d6fe90b2644..607bd3997c1 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2001-2006 MySQL AB, 2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* Common defines for all clients */
diff --git a/client/completion_hash.cc b/client/completion_hash.cc
index dc7f0329db8..9ffb2082c06 100644
--- a/client/completion_hash.cc
+++ b/client/completion_hash.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Quick & light hash implementation for tab completion purposes
*
diff --git a/client/my_readline.h b/client/my_readline.h
index 276e279f43d..d288a33e1cc 100644
--- a/client/my_readline.h
+++ b/client/my_readline.h
@@ -1,7 +1,8 @@
#ifndef CLIENT_MY_READLINE_INCLUDED
#define CLIENT_MY_READLINE_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* readline for batch mode */
diff --git a/client/mysql.cc b/client/mysql.cc
index b66b4263f54..db6f5b83a1b 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -13,7 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* mysql command tool
* Commands compatible with mSQL by David J. Hughes
@@ -1189,7 +1190,7 @@ int main(int argc,char *argv[])
mysql_thread_id(&mysql), server_version_string(&mysql));
put_info((char*) glob_buffer.ptr(),INFO_INFO);
- put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"), INFO_INFO);
+ put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"), INFO_INFO);
#ifdef HAVE_READLINE
initialize_readline((char*) my_progname);
@@ -1620,7 +1621,7 @@ static void usage(int version)
if (version)
return;
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
@@ -4409,7 +4410,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
{
char init_command[100];
sprintf(init_command,
- "SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=%lu,SQL_MAX_JOIN_SIZE=%lu",
+ "SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=%lu,MAX_JOIN_SIZE=%lu",
select_limit,max_join_size);
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command);
}
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
new file mode 100644
index 00000000000..825c962c486
--- /dev/null
+++ b/client/mysql_plugin.c
@@ -0,0 +1,1202 @@
+/*
+ Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <m_string.h>
+#include <mysql.h>
+#include <my_getopt.h>
+#include <my_dir.h>
+#include <my_global.h>
+#include <stdio.h>
+#include <string.h>
+
+
+#define SHOW_VERSION "1.0.0"
+#define PRINT_VERSION do { printf("%s Ver %s Distrib %s\n", \
+ my_progname, SHOW_VERSION, MYSQL_SERVER_VERSION); \
+ } while(0)
+
+/* Global variables. */
+static uint my_end_arg= 0;
+static uint opt_verbose=0;
+static uint opt_no_defaults= 0;
+static uint opt_print_defaults= 0;
+static char *opt_datadir=0, *opt_basedir=0,
+ *opt_plugin_dir=0, *opt_plugin_ini=0,
+ *opt_mysqld=0, *opt_my_print_defaults=0;
+static char bootstrap[FN_REFLEN];
+
+
+/* plugin struct */
+struct st_plugin
+{
+ const char *name; /* plugin name */
+ const char *so_name; /* plugin so (library) name */
+ const char *components[16]; /* components to load */
+} plugin_data;
+
+
+/* Options */
+static struct my_option my_long_options[] =
+{
+ {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
+ 0, 0, 0, 0, 0, 0},
+ {"basedir", 'b', "The basedir for the server.",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"datadir", 'd', "The datadir for the server.",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"plugin-dir", 'p', "The plugin dir for the server.",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"plugin-ini", 'i', "Read plugin information from configuration file "
+ "specified instead of from <plugin-dir>/<plugin_name>.ini.",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"no-defaults", 'n', "Do not read values from configuration file.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"print-defaults", 'P', "Show default values from configuration file.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"mysqld", 'm', "Path to mysqld executable. Example: /sbin/temp1/mysql/bin",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"my-print-defaults", 'f', "Path to my_print_defaults executable. "
+ "Example: /source/temp11/extra",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose", 'v',
+ "More verbose output; you can use this multiple times to get even more "
+ "verbose output.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
+ NO_ARG, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
+};
+
+
+/* Methods */
+static int process_options(int argc, char *argv[], char *operation);
+static int check_access();
+static int find_tool(const char *tool_name, char *tool_path);
+static int find_plugin(char *tp_path);
+static int build_bootstrap_file(char *operation, char *bootstrap);
+static int dump_bootstrap_file(char *bootstrap_file);
+static int bootstrap_server(char *server_path, char *bootstrap_file);
+
+
+int main(int argc,char *argv[])
+{
+ int error= 0;
+ char tp_path[FN_REFLEN];
+ char server_path[FN_REFLEN];
+ char operation[16];
+
+ MY_INIT(argv[0]);
+ plugin_data.name= 0; // initialize name
+
+ /*
+ The following operations comprise the method for enabling or disabling
+ a plugin. We begin by processing the command options then check the
+ directories specified for --datadir, --basedir, --plugin-dir, and
+ --plugin-ini (if specified). If the directories are Ok, we then look
+ for the mysqld executable and the plugin soname. Finally, we build a
+ bootstrap command file for use in bootstraping the server.
+
+ If any step fails, the method issues an error message and the tool exits.
+
+ 1) Parse, execute, and verify command options.
+ 2) Check access to directories.
+ 3) Look for mysqld executable.
+ 4) Look for the plugin.
+ 5) Build a bootstrap file with commands to enable or disable plugin.
+
+ */
+ if ((error= process_options(argc, argv, operation)) ||
+ (error= check_access()) ||
+ (error= find_tool("mysqld" FN_EXEEXT, server_path)) ||
+ (error= find_plugin(tp_path)) ||
+ (error= build_bootstrap_file(operation, bootstrap)))
+ goto exit;
+
+ /* Dump the bootstrap file if --verbose specified. */
+ if (opt_verbose && ((error= dump_bootstrap_file(bootstrap))))
+ goto exit;
+
+ /* Start the server in bootstrap mode and execute bootstrap commands */
+ error= bootstrap_server(server_path, bootstrap);
+
+exit:
+ /* Remove file */
+ my_delete(bootstrap, MYF(0));
+ if (opt_verbose && error == 0)
+ {
+ printf("# Operation succeeded.\n");
+ }
+
+ my_end(my_end_arg);
+ exit(error ? 1 : 0);
+ return 0; /* No compiler warnings */
+}
+
+
+/**
+ Get a temporary file name.
+
+ @param[out] filename The file name of the temporary file
+ @param[in] ext An extension for the file (optional)
+
+ @retval int error = 1, success = 0
+*/
+
+static int make_tempfile(char *filename, const char *ext)
+{
+ int fd= 0;
+
+ if ((fd=create_temp_file(filename, NullS, ext, O_CREAT | O_WRONLY,
+ MYF(MY_WME))) < 0)
+ {
+ fprintf(stderr, "ERROR: Cannot generate temporary file. Error code: %d.\n",
+ fd);
+ return 1;
+ }
+ my_close(fd, MYF(0));
+ return 0;
+}
+
+
+/**
+ Get the value of an option from a string read from my_print_defaults output.
+
+ @param[in] line The line (string) read from the file
+ @param[in] item The option to search for (e.g. --datadir)
+
+ @returns NULL if not found, string containing value if found
+*/
+
+static char *get_value(char *line, const char *item)
+{
+ char *destination= 0;
+ int item_len= (int)strlen(item);
+ int line_len = (int)strlen(line);
+
+ if ((strncasecmp(line, item, item_len) == 0))
+ {
+ int start= 0;
+ char *s= 0;
+
+ s = line + item_len + 1;
+ destination= my_strndup(s, line_len - start, MYF(MY_FAE));
+ destination[line_len - item_len - 2]= 0;
+ }
+ return destination;
+}
+
+
+/**
+ Run a command in a shell.
+
+ This function will attempt to execute the command specified by using the
+ popen() method to open a shell and execute the command passed and store the
+ output in a result file. If the --verbose option was specified, it will open
+ the result file and print the contents to stdout.
+
+ @param[in] cmd The command to execute.
+ @param[in] mode The mode for popen() (e.g. "r", "w", "rw")
+
+ @return int error code or 0 for success.
+*/
+
+static int run_command(char* cmd, const char *mode)
+{
+ char buf[512]= {0};
+ FILE *res_file;
+ int error;
+
+ if (!(res_file= popen(cmd, mode)))
+ return -1;
+
+ if (opt_verbose)
+ {
+ while (fgets(buf, sizeof(buf), res_file))
+ {
+ fprintf(stdout, "%s", buf);
+ }
+ }
+ error= pclose(res_file);
+ return error;
+}
+
+
+#ifdef __WIN__
+/**
+ Check to see if there are spaces in a path.
+
+ @param[in] path The Windows path to examine.
+
+ @retval int spaces found = 1, no spaces = 0
+*/
+static int has_spaces(const char *path)
+{
+ if (strchr(path, ' ') != NULL)
+ return 1;
+ return 0;
+}
+
+
+/**
+ Convert a Unix path to a Windows path.
+
+ @param[in] path The Windows path to examine.
+
+ @returns string containing path with / changed to \\
+*/
+static char *convert_path(const char *argument)
+{
+ /* Convert / to \\ to make Windows paths */
+ char *winfilename= my_strdup(argument, MYF(MY_FAE));
+ char *pos, *end;
+ int length= strlen(argument);
+
+ for (pos= winfilename, end= pos+length ; pos < end ; pos++)
+ {
+ if (*pos == '/')
+ {
+ *pos= '\\';
+ }
+ }
+ return winfilename;
+}
+
+
+/**
+ Add quotes if the path has spaces in it.
+
+ @param[in] path The Windows path to examine.
+
+ @returns string containing excaped quotes if spaces found in path
+*/
+static char *add_quotes(const char *path)
+{
+ char windows_cmd_friendly[FN_REFLEN];
+
+ if (has_spaces(path))
+ snprintf(windows_cmd_friendly, sizeof(windows_cmd_friendly),
+ "\"%s\"", path);
+ else
+ snprintf(windows_cmd_friendly, sizeof(windows_cmd_friendly),
+ "%s", path);
+ return my_strdup(windows_cmd_friendly, MYF(MY_FAE));
+}
+#endif
+
+
+/**
+ Get the default values from the my.cnf file.
+
+ This method gets the default values for the following parameters:
+
+ --datadir
+ --basedir
+ --plugin-dir
+ --plugin-ini
+
+ These values are used if the user has not specified a value.
+
+ @retval int error = 1, success = 0
+*/
+
+static int get_default_values()
+{
+ char tool_path[FN_REFLEN];
+ char defaults_cmd[FN_REFLEN];
+ char defaults_file[FN_REFLEN];
+ char line[FN_REFLEN];
+ int error= 0;
+ int ret= 0;
+ FILE *file= 0;
+
+ bzero(tool_path, FN_REFLEN);
+ if ((error= find_tool("my_print_defaults" FN_EXEEXT, tool_path)))
+ goto exit;
+ else
+ {
+ if ((error= make_tempfile(defaults_file, "txt")))
+ goto exit;
+
+#ifdef __WIN__
+ {
+ char *format_str= 0;
+
+ if (has_spaces(tool_path) || has_spaces(defaults_file))
+ format_str = "\"%s mysqld > %s\"";
+ else
+ format_str = "%s mysqld > %s";
+
+ snprintf(defaults_cmd, sizeof(defaults_cmd), format_str,
+ add_quotes(tool_path), add_quotes(defaults_file));
+ if (opt_verbose)
+ {
+ printf("# my_print_defaults found: %s\n", tool_path);
+ }
+ }
+#else
+ snprintf(defaults_cmd, sizeof(defaults_cmd),
+ "%s mysqld > %s", tool_path, defaults_file);
+#endif
+
+ /* Execute the command */
+ if (opt_verbose)
+ {
+ printf("# Command: %s\n", defaults_cmd);
+ }
+ error= run_command(defaults_cmd, "r");
+ if (error)
+ {
+ fprintf(stderr, "ERROR: my_print_defaults failed. Error code: %d.\n",
+ ret);
+ goto exit;
+ }
+ /* Now open the file and read the defaults we want. */
+ file= fopen(defaults_file, "r");
+ while (fgets(line, FN_REFLEN, file) != NULL)
+ {
+ char *value= 0;
+
+ if ((opt_datadir == 0) && ((value= get_value(line, "--datadir"))))
+ {
+ opt_datadir= my_strdup(value, MYF(MY_FAE));
+ }
+ if ((opt_basedir == 0) && ((value= get_value(line, "--basedir"))))
+ {
+ opt_basedir= my_strdup(value, MYF(MY_FAE));
+ }
+ if ((opt_plugin_dir == 0) && ((value= get_value(line, "--plugin_dir"))))
+ {
+ opt_plugin_dir= my_strdup(value, MYF(MY_FAE));
+ }
+ if ((opt_plugin_ini == 0) && ((value= get_value(line, "--plugin_ini"))))
+ {
+ opt_plugin_ini= my_strdup(value, MYF(MY_FAE));
+ }
+ }
+ }
+exit:
+ if (file)
+ {
+ fclose(file);
+ /* Remove file */
+ my_delete(defaults_file, MYF(0));
+ }
+ return error;
+}
+
+
+/**
+ Print usage.
+*/
+
+static void usage(void)
+{
+ PRINT_VERSION;
+ puts("Copyright (c) 2011, Oracle and/or its affiliates. "
+ "All rights reserved.\n");
+ puts("Enable or disable plugins.");
+ printf("\nUsage: %s [options] <plugin> ENABLE|DISABLE\n\nOptions:\n",
+ my_progname);
+ my_print_help(my_long_options);
+ puts("\n");
+}
+
+
+/**
+ Print the default values as read from the my.cnf file.
+
+ This method displays the default values for the following parameters:
+
+ --datadir
+ --basedir
+ --plugin-dir
+ --plugin-ini
+
+*/
+
+static void print_default_values(void)
+{
+ printf("%s would have been started with the following arguments:\n",
+ my_progname);
+ get_default_values();
+ if (opt_datadir)
+ {
+ printf("--datadir=%s ", opt_datadir);
+ }
+ if (opt_basedir)
+ {
+ printf("--basedir=%s ", opt_basedir);
+ }
+ if (opt_plugin_dir)
+ {
+ printf("--plugin_dir=%s ", opt_plugin_dir);
+ }
+ if (opt_plugin_ini)
+ {
+ printf("--plugin_ini=%s ", opt_plugin_ini);
+ }
+ if (opt_mysqld)
+ {
+ printf("--mysqld=%s ", opt_mysqld);
+ }
+ if (opt_my_print_defaults)
+ {
+ printf("--my_print_defaults=%s ", opt_my_print_defaults);
+ }
+ printf("\n");
+}
+
+
+/**
+ Process the arguments and identify an option and store its value.
+
+ @param[in] optid The single character shortcut for the argument.
+ @param[in] my_option Structure of legal options.
+ @param[in] argument The argument value to process.
+*/
+
+static my_bool
+get_one_option(int optid,
+ const struct my_option *opt __attribute__((unused)),
+ char *argument)
+{
+ switch(optid) {
+ case 'n':
+ opt_no_defaults++;
+ break;
+ case 'P':
+ opt_print_defaults++;
+ print_default_values();
+ break;
+ case 'v':
+ opt_verbose++;
+ break;
+ case 'V':
+ PRINT_VERSION;
+ exit(0);
+ break;
+ case '?':
+ case 'I': /* Info */
+ usage();
+ exit(0);
+ case 'd':
+ opt_datadir= my_strdup(argument, MYF(MY_FAE));
+ break;
+ case 'b':
+ opt_basedir= my_strdup(argument, MYF(MY_FAE));
+ break;
+ case 'p':
+ opt_plugin_dir= my_strdup(argument, MYF(MY_FAE));
+ break;
+ case 'i':
+ opt_plugin_ini= my_strdup(argument, MYF(MY_FAE));
+ break;
+ case 'm':
+ opt_mysqld= my_strdup(argument, MYF(MY_FAE));
+ break;
+ case 'f':
+ opt_my_print_defaults= my_strdup(argument, MYF(MY_FAE));
+ break;
+ }
+ return 0;
+}
+
+
+/**
+ Check to see if a file exists.
+
+ @param[in] filename File to locate.
+
+ @retval int file not found = 1, file found = 0
+*/
+
+static int file_exists(char * filename)
+{
+ MY_STAT stat_arg;
+
+ if (!my_stat(filename, &stat_arg, MYF(0)))
+ {
+ return 0;
+ }
+ return 1;
+}
+
+
+/**
+ Search a specific path and sub directory for a file name.
+
+ @param[in] base_path Original path to use.
+ @param[in] tool_name Name of the tool to locate.
+ @param[in] subdir The sub directory to search.
+ @param[out] tool_path If tool found, return complete path.
+
+ @retval int error = 1, success = 0
+*/
+
+static int search_dir(const char * base_path, const char *tool_name,
+ const char *subdir, char *tool_path)
+{
+ char new_path[FN_REFLEN];
+ char source_path[FN_REFLEN];
+
+ strcpy(source_path, base_path);
+ strcat(source_path, subdir);
+ fn_format(new_path, tool_name, source_path, "", MY_UNPACK_FILENAME);
+ if (file_exists(new_path))
+ {
+ strcpy(tool_path, new_path);
+ return 1;
+ }
+ return 0;
+}
+
+
+/**
+ Search known common paths and sub directories for a file name.
+
+ @param[in] base_path Original path to use.
+ @param[in] tool_name Name of the tool to locate.
+ @param[out] tool_path If tool found, return complete path.
+
+ @retval int error = 1, success = 0
+*/
+
+static int search_paths(const char *base_path, const char *tool_name,
+ char *tool_path)
+{
+ int i= 0;
+
+ static const char *paths[]= {
+ "", "/share/", "/scripts/", "/bin/", "/sbin/", "/libexec/",
+ "/mysql/", "/sql/",
+ };
+ for (i = 0 ; i < (int)array_elements(paths); i++)
+ {
+ if (search_dir(base_path, tool_name, paths[i], tool_path))
+ {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+/**
+ Read the plugin ini file.
+
+ This function attempts to read the plugin config file from the plugin_dir
+ path saving the data in the the st_plugin structure. If the file is not
+ found or the file cannot be read, an error is generated.
+
+ @retval int error = 1, success = 0
+*/
+
+static int load_plugin_data(char *plugin_name, char *config_file)
+{
+ FILE *file_ptr;
+ char path[FN_REFLEN];
+ char line[1024];
+ char *reason= 0;
+ char *res;
+ int i= -1;
+
+ if (opt_plugin_ini == 0)
+ {
+ fn_format(path, config_file, opt_plugin_dir, "", MYF(0));
+ opt_plugin_ini= my_strdup(path, MYF(MY_FAE));
+ }
+ if (!file_exists(opt_plugin_ini))
+ {
+ reason= (char *)"File does not exist.";
+ goto error;
+ }
+
+ file_ptr= fopen(opt_plugin_ini, "r");
+ if (file_ptr == NULL)
+ {
+ reason= (char *)"Cannot open file.";
+ goto error;
+ }
+
+ /* save name */
+ plugin_data.name= my_strdup(plugin_name, MYF(MY_WME));
+
+ /* Read plugin components */
+ while (i < 16)
+ {
+ res= fgets(line, sizeof(line), file_ptr);
+ /* strip /n */
+ if (line[strlen(line)-1] == '\n')
+ {
+ line[strlen(line)-1]= '\0';
+ }
+ if (res == NULL)
+ {
+ if (i < 1)
+ {
+ reason= (char *)"Bad format in plugin configuration file.";
+ fclose(file_ptr);
+ goto error;
+ }
+ break;
+ }
+ if ((line[0] == '#') || (line[0] == '\n')) // skip comment and blank lines
+ {
+ continue;
+ }
+ if (i == -1) // if first pass, read this line as so_name
+ {
+ /* Add proper file extension for soname */
+ strcat(line, FN_SOEXT);
+ /* save so_name */
+ plugin_data.so_name= my_strdup(line, MYF(MY_WME|MY_ZEROFILL));
+ i++;
+ }
+ else
+ {
+ if (strlen(line) > 0)
+ {
+ plugin_data.components[i]= my_strdup(line, MYF(MY_WME));
+ i++;
+ }
+ else
+ {
+ plugin_data.components[i]= NULL;
+ }
+ }
+ }
+
+ fclose(file_ptr);
+ return 0;
+
+error:
+ fprintf(stderr, "ERROR: Cannot read plugin config file %s. %s\n",
+ plugin_name, reason);
+ return 1;
+}
+
+
+/**
+ Check the options for validity.
+
+ This function checks the arguments for validity issuing the appropriate
+ error message if arguments are missing or invalid. On success, @operation
+ is set to either "ENABLE" or "DISABLE".
+
+ @param[in] argc The number of arguments.
+ @param[in] argv The arguments.
+ @param[out] operation The operation chosen (enable|disable)
+
+ @retval int error = 1, success = 0
+*/
+
+static int check_options(int argc, char **argv, char *operation)
+{
+ int i= 0; // loop counter
+ int num_found= 0; // number of options found (shortcut loop)
+ char config_file[FN_REFLEN]; // configuration file name
+ char plugin_name[FN_REFLEN]; // plugin name
+
+ /* Form prefix strings for the options. */
+ const char *basedir_prefix = "--basedir=";
+ int basedir_len= strlen(basedir_prefix);
+ const char *datadir_prefix = "--datadir=";
+ int datadir_len= strlen(datadir_prefix);
+ const char *plugin_dir_prefix = "--plugin_dir=";
+ int plugin_dir_len= strlen(plugin_dir_prefix);
+
+ strcpy(plugin_name, "");
+ for (i = 0; i < argc && num_found < 5; i++)
+ {
+
+ if (!argv[i])
+ {
+ continue;
+ }
+ if ((strcasecmp(argv[i], "ENABLE") == 0) ||
+ (strcasecmp(argv[i], "DISABLE") == 0))
+ {
+ strcpy(operation, argv[i]);
+ num_found++;
+ }
+ else if ((strncasecmp(argv[i], basedir_prefix, basedir_len) == 0) &&
+ !opt_basedir)
+ {
+ opt_basedir= my_strndup(argv[i]+basedir_len,
+ strlen(argv[i])-basedir_len, MYF(MY_FAE));
+ num_found++;
+ }
+ else if ((strncasecmp(argv[i], datadir_prefix, datadir_len) == 0) &&
+ !opt_datadir)
+ {
+ opt_datadir= my_strndup(argv[i]+datadir_len,
+ strlen(argv[i])-datadir_len, MYF(MY_FAE));
+ num_found++;
+ }
+ else if ((strncasecmp(argv[i], plugin_dir_prefix, plugin_dir_len) == 0) &&
+ !opt_plugin_dir)
+ {
+ opt_plugin_dir= my_strndup(argv[i]+plugin_dir_len,
+ strlen(argv[i])-plugin_dir_len, MYF(MY_FAE));
+ num_found++;
+ }
+ /* read the plugin config file and check for match against argument */
+ else
+ {
+ strcpy(plugin_name, argv[i]);
+ strcpy(config_file, argv[i]);
+ strcat(config_file, ".ini");
+ }
+ }
+
+ if (!opt_basedir)
+ {
+ fprintf(stderr, "ERROR: Missing --basedir option.\n");
+ return 1;
+ }
+
+ if (!opt_datadir)
+ {
+ fprintf(stderr, "ERROR: Missing --datadir option.\n");
+ return 1;
+ }
+
+ if (!opt_plugin_dir)
+ {
+ fprintf(stderr, "ERROR: Missing --plugin_dir option.\n");
+ return 1;
+ }
+ /* If a plugin was specified, read the config file. */
+ else if (strlen(plugin_name) > 0)
+ {
+ if (load_plugin_data(plugin_name, config_file))
+ {
+ return 1;
+ }
+ if (strcasecmp(plugin_data.name, plugin_name) != 0)
+ {
+ fprintf(stderr, "ERROR: plugin name requested does not match config "
+ "file data.\n");
+ return 1;
+ }
+ }
+ else
+ {
+ fprintf(stderr, "ERROR: No plugin specified.\n");
+ return 1;
+ }
+
+ if ((strlen(operation) == 0))
+ {
+ fprintf(stderr, "ERROR: missing operation. Please specify either "
+ "'<plugin> ENABLE' or '<plugin> DISABLE'.\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/**
+ Parse, execute, and verify command options.
+
+ This method handles all of the option processing including the optional
+ features for displaying data (--print-defaults, --help ,etc.) that do not
+ result in an attempt to ENABLE or DISABLE of a plugin.
+
+ @param[in] arc Count of arguments
+ @param[in] argv Array of arguments
+ @param[out] operation Operation (ENABLE or DISABLE)
+
+ @retval int error = 1, success = 0, exit program = -1
+*/
+
+static int process_options(int argc, char *argv[], char *operation)
+{
+ int error= 0;
+ int i= 0;
+
+ /* Parse and execute command-line options */
+ if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
+ goto exit;
+
+ /* If the print defaults option used, exit. */
+ if (opt_print_defaults)
+ {
+ error= -1;
+ goto exit;
+ }
+
+ /* Add a trailing directory separator if not present */
+ if (opt_basedir)
+ {
+ i= (int)strlength(opt_basedir);
+ if (opt_basedir[i-1] != FN_LIBCHAR || opt_basedir[i-1] != FN_LIBCHAR2)
+ {
+ char buff[FN_REFLEN];
+
+ strncpy(buff, opt_basedir, sizeof(buff) - 1);
+#ifdef __WIN__
+ strncat(buff, "/", sizeof(buff) - strlen(buff) - 1);
+#else
+ strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1);
+#endif
+ buff[sizeof(buff) - 1]= 0;
+ my_delete(opt_basedir, MYF(0));
+ opt_basedir= my_strdup(buff, MYF(MY_FAE));
+ }
+ }
+
+ /*
+ If the user did not specify the option to skip loading defaults from a
+ config file and the required options are not present or there was an error
+ generated when the defaults were read from the file, exit.
+ */
+ if (!opt_no_defaults && ((error= get_default_values())))
+ {
+ error= -1;
+ goto exit;
+ }
+
+ /*
+ Check to ensure required options are present and validate the operation.
+ Note: this method also validates the plugin specified by attempting to
+ read a configuration file named <plugin_name>.ini from the --plugin-dir
+ or --plugin-ini location if the --plugin-ini option presented.
+ */
+ strcpy(operation, "");
+ if ((error = check_options(argc, argv, operation)))
+ {
+ goto exit;
+ }
+
+ if (opt_verbose)
+ {
+ printf("# basedir = %s\n", opt_basedir);
+ printf("# plugin_dir = %s\n", opt_plugin_dir);
+ printf("# datadir = %s\n", opt_datadir);
+ printf("# plugin_ini = %s\n", opt_plugin_ini);
+ }
+
+exit:
+ return error;
+}
+
+
+/**
+ Check access
+
+ This method checks to ensure all of the directories (opt_basedir,
+ opt_plugin_dir, opt_datadir, and opt_plugin_ini) are accessible by
+ the user.
+
+ @retval int error = 1, success = 0
+*/
+
+static int check_access()
+{
+ int error= 0;
+
+ if ((error= my_access(opt_basedir, F_OK)))
+ {
+ fprintf(stderr, "ERROR: Cannot access basedir at '%s'.\n",
+ opt_basedir);
+ goto exit;
+ }
+ if ((error= my_access(opt_plugin_dir, F_OK)))
+ {
+ fprintf(stderr, "ERROR: Cannot access plugin_dir at '%s'.\n",
+ opt_plugin_dir);
+ goto exit;
+ }
+ if ((error= my_access(opt_datadir, F_OK)))
+ {
+ fprintf(stderr, "ERROR: Cannot access datadir at '%s'.\n",
+ opt_datadir);
+ goto exit;
+ }
+ if ((error= my_access(opt_plugin_ini, F_OK)))
+ {
+ fprintf(stderr, "ERROR: Cannot access plugin config file at '%s'.\n",
+ opt_plugin_ini);
+ goto exit;
+ }
+ if ((error= my_access(opt_mysqld, F_OK)))
+ {
+ fprintf(stderr, "ERROR: Cannot access mysqld path '%s'.\n",
+ opt_mysqld);
+ goto exit;
+ }
+ if ((error= my_access(opt_my_print_defaults, F_OK)))
+ {
+ fprintf(stderr, "ERROR: Cannot access my-print-defaults path '%s'.\n",
+ opt_my_print_defaults);
+ goto exit;
+ }
+
+exit:
+ return error;
+}
+
+
+/**
+ Locate the tool and form tool path.
+
+ @param[in] tool_name Name of the tool to locate.
+ @param[out] tool_path If tool found, return complete path.
+
+ @retval int error = 1, success = 0
+*/
+
+static int find_tool(const char *tool_name, char *tool_path)
+{
+ int i= 0;
+
+ const char *paths[]= {
+ opt_basedir, opt_mysqld, opt_my_print_defaults, "/usr",
+ "/usr/local/mysql", "/usr/sbin", "/usr/share", "/extra", "/extra/debug",
+ "/extra/release", "/bin", "/usr/bin", "/mysql/bin"
+ };
+ for (i= 0; i < (int)array_elements(paths); i++)
+ {
+ if (paths[i] && (search_paths(paths[i], tool_name, tool_path)))
+ goto found;
+ }
+ fprintf(stderr, "WARNING: Cannot find %s.\n", tool_name);
+ return 1;
+found:
+ if (opt_verbose)
+ printf("# Found tool '%s' as '%s'.\n", tool_name, tool_path);
+ return 0;
+}
+
+
+/**
+ Find the plugin library.
+
+ This function attempts to use the @c plugin_dir option passed on the
+ command line to locate the plugin.
+
+ @param[out] tp_path The actual path to plugin with FN_SOEXT applied.
+
+ @retval int error = 1, success = 0
+*/
+
+static int find_plugin(char *tp_path)
+{
+ /* Check for existance of plugin */
+ fn_format(tp_path, plugin_data.so_name, opt_plugin_dir, "", MYF(0));
+ if (!file_exists(tp_path))
+ {
+ fprintf(stderr, "ERROR: The plugin library is missing or in a different"
+ " location.\n");
+ return 1;
+ }
+ else if (opt_verbose)
+ {
+ printf("# Found plugin '%s' as '%s'\n", plugin_data.name, tp_path);
+ }
+ return 0;
+}
+
+
+/**
+ Build the boostrap file.
+
+ Create a new file and populate it with SQL commands to ENABLE or DISABLE
+ the plugin via INSERT and DELETE operations on the mysql.plugin table.
+
+ param[in] operation The type of operation (ENABLE or DISABLE)
+ param[out] bootstrap A FILE* pointer
+
+ @retval int error = 1, success = 0
+*/
+
+static int build_bootstrap_file(char *operation, char *bootstrap)
+{
+ int error= 0;
+ FILE *file= 0;
+
+ /*
+ Perform plugin operation : ENABLE or DISABLE
+
+ The following creates a temporary bootstrap file and populates it with
+ the appropriate SQL commands for the operation. For ENABLE, INSERT
+ statements are created. For DISABLE, DELETE statements are created. The
+ values for these statements are derived from the plugin_data read from the
+ <plugin_name>.ini configuration file. Once the file is built, a call to
+ mysqld is made in read only, bootstrap modes to read the SQL statements
+ and execute them.
+ */
+ if ((error= make_tempfile(bootstrap, "sql")))
+ {
+ /* Fail if we cannot create a temporary file for the bootstrap commands. */
+ fprintf(stderr, "ERROR: Cannot create bootstrap file.\n");
+ goto exit;
+ }
+ if ((file= fopen(bootstrap, "w+")) == NULL)
+ {
+ fprintf(stderr, "ERROR: Cannot open bootstrap file for writing.\n");
+ error= 1;
+ goto exit;
+ }
+ if (strcasecmp(operation, "enable") == 0)
+ {
+ int i= 0;
+ fprintf(file, "INSERT IGNORE INTO mysql.plugin VALUES ");
+ for (i= 0; i < (int)array_elements(plugin_data.components); i++)
+ {
+ /* stop when we read the end of the symbol list - marked with NULL */
+ if (plugin_data.components[i] == NULL)
+ {
+ break;
+ }
+ if (i > 0)
+ {
+ fprintf(file, ", ");
+ }
+ fprintf(file, "('%s','%s')",
+ plugin_data.components[i], plugin_data.so_name);
+ }
+ fprintf(file, ";\n");
+ if (opt_verbose)
+ {
+ printf("# Enabling %s...\n", plugin_data.name);
+ }
+ }
+ else
+ {
+ fprintf(file,
+ "DELETE FROM mysql.plugin WHERE name = '%s';", plugin_data.name);
+ if (opt_verbose)
+ {
+ printf("# Disabling %s...\n", plugin_data.name);
+ }
+ }
+
+exit:
+ fclose(file);
+ return error;
+}
+
+
+/**
+ Dump bootstrap file.
+
+ Read the contents of the bootstrap file and print it out.
+
+ @param[in] bootstrap_file Name of bootstrap file to read
+
+ @retval int error = 1, success = 0
+*/
+
+static int dump_bootstrap_file(char *bootstrap_file)
+{
+ char *ret= 0;
+ int error= 0;
+ char query_str[512];
+ FILE *file= 0;
+
+ if ((file= fopen(bootstrap_file, "r")) == NULL)
+ {
+ fprintf(stderr, "ERROR: Cannot open bootstrap file for reading.\n");
+ error= 1;
+ goto exit;
+ }
+ ret= fgets(query_str, 512, file);
+ if (ret == 0)
+ {
+ fprintf(stderr, "ERROR: Cannot read bootstrap file.\n");
+ error= 1;
+ goto exit;
+ }
+ printf("# Query: %s", query_str);
+
+exit:
+ if (file)
+ {
+ fclose(file);
+ }
+ return error;
+}
+
+
+/**
+ Bootstrap the server
+
+ Create a command line sequence to launch mysqld in bootstrap mode. This
+ will allow mysqld to launch a minimal server instance to read and
+ execute SQL commands from a file piped in (the boostrap file). We use
+ the --no-defaults option to skip reading values from the config file.
+
+ The bootstrap mode skips loading of plugins and many other subsystems.
+ This allows the mysql_plugin tool to insert the correct rows into the
+ mysql.plugin table (for ENABLE) or delete the rows (for DISABLE). Once
+ the server is launched in normal mode, the plugin will be loaded
+ (for ENABLE) or not loaded (for DISABLE). In this way, we avoid the
+ (sometimes) complicated LOAD PLUGIN commands.
+
+ @param[in] server_path Path to server executable
+ @param[in] bootstrap_file Name of bootstrap file to read
+
+ @retval int error = 1, success = 0
+*/
+
+static int bootstrap_server(char *server_path, char *bootstrap_file)
+{
+ char bootstrap_cmd[FN_REFLEN];
+ int error= 0;
+ int ret= 0;
+
+#ifdef __WIN__
+ char *format_str= 0;
+ const char *verbose_str= NULL;
+
+
+ if (opt_verbose)
+ verbose_str= "--console";
+ else
+ verbose_str= "";
+ if (has_spaces(opt_datadir) || has_spaces(opt_basedir) ||
+ has_spaces(bootstrap_file))
+ format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s < %s\"";
+ else
+ format_str= "%s %s --bootstrap --datadir=%s --basedir=%s < %s";
+
+ snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), format_str,
+ add_quotes(convert_path(server_path)), verbose_str,
+ add_quotes(opt_datadir), add_quotes(opt_basedir),
+ add_quotes(bootstrap_file));
+#else
+ snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
+ "%s --no-defaults --bootstrap --datadir=%s --basedir=%s"
+ " < %s", server_path, opt_datadir, opt_basedir, bootstrap_file);
+#endif
+
+ /* Execute the command */
+ if (opt_verbose)
+ {
+ printf("# Command: %s\n", bootstrap_cmd);
+ }
+ error= run_command(bootstrap_cmd, "r");
+ if (error)
+ fprintf(stderr,
+ "ERROR: Unexpected result from bootstrap. Error code: %d.\n",
+ ret);
+
+ return error;
+}
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 73acc241912..424d847c187 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (C) 2010 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
#include "client_priv.h"
#include <sslopt-vars.h>
@@ -247,6 +248,7 @@ get_one_option(int optid, const struct my_option *opt,
switch (optid) {
case '?':
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("%s Ver %s Distrib %s, for %s (%s)\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 4335acdfb9c..463ec37fae2 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -700,7 +700,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
case ADMIN_VER:
new_line=1;
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
printf("Connection\t\t%s\n",mysql_get_host_info(mysql));
@@ -1172,7 +1172,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
puts("Administration program for the mysqld daemon.");
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
my_print_help(my_long_options);
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index e5af12bf49a..71ebd5d4ab7 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
@@ -1443,7 +1445,7 @@ static void print_version()
static void usage()
{
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2001, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("\
Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
the mysql command line client.\n\n");
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index e0a2bce1e85..445f4522cef 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (C) 2010-2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
@@ -228,7 +229,7 @@ static void usage(void)
{
DBUG_ENTER("usage");
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
my_progname);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 4103d8ccb04..0d209bd7034 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
/* mysqldump.c - Dump a tables contents and format to an ASCII file
**
@@ -53,6 +55,8 @@
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
/* Exit codes */
#define EX_USAGE 1
@@ -598,7 +602,7 @@ static void short_usage_sub(void)
static void usage(void)
{
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
puts("Dumping structure and contents of MySQL databases and tables.");
short_usage_sub();
print_defaults("my",load_default_groups);
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 33fd70d6316..3b9939d7c6d 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,19 +12,14 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
** mysqlimport.c - Imports all given files
** into a table(s).
-**
-** *************************
-** * *
-** * AUTHOR: Monty & Jani *
-** * DATE: June 24, 1997 *
-** * *
-** *************************
*/
+
#define IMPORT_VERSION "3.7"
#include "client_priv.h"
@@ -42,6 +38,8 @@ pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold;
#endif
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
static void db_error_with_table(MYSQL *mysql, char *table);
static void db_error(MYSQL *mysql);
static char *field_escape(char *to,const char *from,uint length);
@@ -202,7 +200,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("\
Loads tables from text files in various formats. The base name of the\n\
text file must be the name of the table that should be used.\n\
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 30e2cfcc06c..1f299753587 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* Show databases, tables or columns */
@@ -263,7 +265,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010)"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011)"));
puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
puts("\n\
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index fa9a1e4d2a7..0f8a1edc476 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
MySQL Slap
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 23b9eb578c6..2f12ee7f280 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -23,13 +23,6 @@
http://dev.mysql.com/doc/mysqltest/en/index.html
Please keep the test framework tools identical in all versions!
-
- Written by:
- Sasha Pachev <sasha@mysql.com>
- Matt Wagner <matt@mysql.com>
- Monty
- Jani
- Holyfoot
*/
#define MTEST_VERSION "3.3"
@@ -129,6 +122,41 @@ static const char *load_default_groups[]=
{ "mysqltest", "client", "client-server", "client-mariadb", 0 };
static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer;
+/* Info on properties that can be set with --enable_X and --disable_X */
+
+struct property {
+ my_bool *var; /* Actual variable */
+ my_bool set; /* Has been set for ONE command */
+ my_bool old; /* If set, thus is the old value */
+ my_bool reverse; /* Varible is true if disabled */
+ const char *env_name; /* Env. variable name */
+};
+
+static struct property prop_list[] = {
+ { &abort_on_error, 0, 1, 0, "$ENABLED_ABORT_ON_ERROR" },
+ { &disable_connect_log, 0, 1, 1, "$ENABLED_CONNECT_LOG" },
+ { &disable_info, 0, 1, 1, "$ENABLED_INFO" },
+ { &display_metadata, 0, 0, 0, "$ENABLED_METADATA" },
+ { &ps_protocol_enabled, 0, 0, 0, "$ENABLED_PS_PROTOCOL" },
+ { &disable_query_log, 0, 0, 1, "$ENABLED_QUERY_LOG" },
+ { &disable_result_log, 0, 0, 1, "$ENABLED_RESULT_LOG" },
+ { &disable_warnings, 0, 0, 1, "$ENABLED_WARNINGS" }
+};
+
+static my_bool once_property= FALSE;
+
+enum enum_prop {
+ P_ABORT= 0,
+ P_CONNECT,
+ P_INFO,
+ P_META,
+ P_PS,
+ P_QUERY,
+ P_RESULT,
+ P_WARN,
+ P_MAX
+};
+
static uint start_lineno= 0; /* Start line of current command */
static uint my_end_arg= 0;
@@ -488,6 +516,7 @@ TYPELIB command_typelib= {array_elements(command_names),"",
DYNAMIC_STRING ds_res;
/* Points to ds_warning in run_query, so it can be freed */
DYNAMIC_STRING *ds_warn= 0;
+struct st_command *curr_command= 0;
char builtin_echo[FN_REFLEN];
@@ -519,6 +548,7 @@ void str_to_file(const char *fname, char *str, int size);
void str_to_file2(const char *fname, char *str, int size, my_bool append);
void fix_win_paths(const char *val, int len);
+const char *get_errname_from_code (uint error_code);
#ifdef __WIN__
void free_tmp_sh_file();
@@ -741,6 +771,7 @@ void handle_error(struct st_command*,
unsigned int err_errno, const char *err_error,
const char *err_sqlstate, DYNAMIC_STRING *ds);
void handle_no_error(struct st_command*);
+void revert_properties();
#ifdef EMBEDDED_LIBRARY
@@ -1211,6 +1242,7 @@ void handle_command_error(struct st_command *command, uint error,
DBUG_PRINT("info", ("command \"%.*s\" failed with expected error: %u, errno: %d",
command->first_word_len, command->query, error,
sys_errno));
+ revert_properties();
DBUG_VOID_RETURN;
}
if (command->expected_errors.count > 0)
@@ -1225,6 +1257,7 @@ void handle_command_error(struct st_command *command, uint error,
command->first_word_len, command->query,
command->expected_errors.err[0].code.errnum);
}
+ revert_properties();
DBUG_VOID_RETURN;
}
@@ -2345,6 +2378,51 @@ void var_set_int(const char* name, int value)
void var_set_errno(int sql_errno)
{
var_set_int("$mysql_errno", sql_errno);
+ var_set_string("$mysql_errname", get_errname_from_code(sql_errno));
+}
+
+/* Functions to handle --disable and --enable properties */
+
+void set_once_property(enum_prop prop, my_bool val)
+{
+ property &pr= prop_list[prop];
+ pr.set= 1;
+ pr.old= *pr.var;
+ *pr.var= val;
+ var_set_int(pr.env_name, (val != pr.reverse));
+ once_property= TRUE;
+}
+
+void set_property(st_command *command, enum_prop prop, my_bool val)
+{
+ char* p= command->first_argument;
+ if (p && !strcmp (p, "ONCE"))
+ {
+ command->last_argument= p + 4;
+ set_once_property(prop, val);
+ return;
+ }
+ property &pr= prop_list[prop];
+ *pr.var= val;
+ pr.set= 0;
+ var_set_int(pr.env_name, (val != pr.reverse));
+}
+
+void revert_properties()
+{
+ if (! once_property)
+ return;
+ for (int i= 0; i < (int) P_MAX; i++)
+ {
+ property &pr= prop_list[i];
+ if (pr.set)
+ {
+ *pr.var= pr.old;
+ pr.set= 0;
+ var_set_int(pr.env_name, (pr.old != pr.reverse));
+ }
+ }
+ once_property=FALSE;
}
@@ -2398,9 +2476,16 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
do_eval(&ds_query, query, end, FALSE);
- if (mysql_real_query(mysql, ds_query.str, ds_query.length))
- die("Error running query '%s': %d %s", ds_query.str,
- mysql_errno(mysql), mysql_error(mysql));
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length))
+ {
+ handle_error (curr_command, mysql_errno(mysql), mysql_error(mysql),
+ mysql_sqlstate(mysql), &ds_res);
+ /* If error was acceptable, return empty string */
+ dynstr_free(&ds_query);
+ eval_expr(var, "", 0);
+ DBUG_VOID_RETURN;
+ }
+
if (!(res= mysql_store_result(mysql)))
die("Query '%s' didn't return a result set", ds_query.str);
dynstr_free(&ds_query);
@@ -2554,8 +2639,15 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
/* Run the query */
if (mysql_real_query(mysql, ds_query.str, ds_query.length))
- die("Error running query '%s': %d %s", ds_query.str,
- mysql_errno(mysql), mysql_error(mysql));
+ {
+ handle_error (curr_command, mysql_errno(mysql), mysql_error(mysql),
+ mysql_sqlstate(mysql), &ds_res);
+ /* If error was acceptable, return empty string */
+ dynstr_free(&ds_query);
+ eval_expr(var, "", 0);
+ DBUG_VOID_RETURN;
+ }
+
if (!(res= mysql_store_result(mysql)))
die("Query '%s' didn't return a result set", ds_query.str);
@@ -4510,6 +4602,7 @@ void do_let(struct st_command *command)
var_set(var_name, var_name_end, let_rhs_expr.str,
(let_rhs_expr.str + let_rhs_expr.length));
dynstr_free(&let_rhs_expr);
+ revert_properties();
DBUG_VOID_RETURN;
}
@@ -4756,8 +4849,7 @@ void do_shutdown_server(struct st_command *command)
}
-#if MYSQL_VERSION_ID >= 50000
-/* List of error names to error codes, available from 5.0 */
+/* List of error names to error codes */
typedef struct
{
const char *name;
@@ -4767,6 +4859,7 @@ typedef struct
static st_error global_error_names[] =
{
+ { "<No error>", -1, "" },
#include <mysqld_ername.h>
{ 0, 0, 0 }
};
@@ -4797,16 +4890,28 @@ uint get_errcode_from_name(char *error_name, char *error_end)
die("Unknown SQL error name '%s'", error_name);
DBUG_RETURN(0);
}
-#else
-uint get_errcode_from_name(char *error_name __attribute__((unused)),
- char *error_end __attribute__((unused)))
+
+const char *get_errname_from_code (uint error_code)
{
- abort_not_in_this_version();
- return 0; /* Never reached */
-}
-#endif
+ st_error *e= global_error_names;
+ DBUG_ENTER("get_errname_from_code");
+ DBUG_PRINT("enter", ("error_code: %d", error_code));
+ if (! error_code)
+ {
+ DBUG_RETURN("");
+ }
+ for (; e->name; e++)
+ {
+ if (e->code == error_code)
+ {
+ DBUG_RETURN(e->name);
+ }
+ }
+ /* Apparently, errors without known names may occur */
+ DBUG_RETURN("<Unknown>");
+}
void do_get_errcodes(struct st_command *command)
{
@@ -5339,6 +5444,7 @@ do_handle_error:
var_set_errno(0);
handle_no_error(command);
+ revert_properties();
return 1; /* Connected */
}
@@ -6517,7 +6623,7 @@ void print_version(void)
void usage()
{
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("Runs a test against the mysql server and compares output with a results file.\n\n");
printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname);
my_print_help(my_long_options);
@@ -7319,6 +7425,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
/* If we come here the query is both executed and read successfully */
handle_no_error(command);
+ revert_properties();
end:
@@ -7452,6 +7559,7 @@ void handle_error(struct st_command *command,
dynstr_append(ds,"Got one of the listed errors\n");
}
/* OK */
+ revert_properties();
DBUG_VOID_RETURN;
}
@@ -7479,6 +7587,7 @@ void handle_error(struct st_command *command,
command->expected_errors.err[0].code.sqlstate);
}
+ revert_properties();
DBUG_VOID_RETURN;
}
@@ -7512,7 +7621,6 @@ void handle_no_error(struct st_command *command)
die("query '%s' succeeded - should have failed with sqlstate %s...",
command->query, command->expected_errors.err[0].code.sqlstate);
}
-
DBUG_VOID_RETURN;
}
@@ -7727,6 +7835,8 @@ end:
var_set_errno(mysql_stmt_errno(stmt));
+ revert_properties();
+
/* Close the statement if reconnect, need new prepare */
if (mysql->reconnect)
{
@@ -8580,6 +8690,8 @@ int main(int argc, char **argv)
{
command->last_argument= command->first_argument;
processed = 1;
+ /* Need to remember this for handle_error() */
+ curr_command= command;
switch (command->type) {
case Q_CONNECT:
do_connect(command);
@@ -8591,60 +8703,46 @@ int main(int argc, char **argv)
case Q_ENABLE_PREPARE_WARNINGS: prepare_warnings_enabled=1; break;
case Q_DISABLE_PREPARE_WARNINGS: prepare_warnings_enabled=0; break;
case Q_ENABLE_QUERY_LOG:
- disable_query_log= 0;
- var_set_int("$ENABLED_QUERY_LOG", 1);
+ set_property(command, P_QUERY, 0);
break;
case Q_DISABLE_QUERY_LOG:
- disable_query_log= 1;
- var_set_int("$ENABLED_QUERY_LOG", 0);
+ set_property(command, P_QUERY, 1);
break;
case Q_ENABLE_ABORT_ON_ERROR:
- abort_on_error= 1;
- var_set_int("$ENABLED_ABORT_ON_ERROR", 1);
+ set_property(command, P_ABORT, 1);
break;
case Q_DISABLE_ABORT_ON_ERROR:
- abort_on_error= 0;
- var_set_int("$ENABLED_ABORT_ON_ERROR", 0);
+ set_property(command, P_ABORT, 0);
break;
case Q_ENABLE_RESULT_LOG:
- disable_result_log= 0;
- var_set_int("$ENABLED_RESULT_LOG", 1);
+ set_property(command, P_RESULT, 0);
break;
case Q_DISABLE_RESULT_LOG:
- disable_result_log=1;
- var_set_int("$ENABLED_RESULT_LOG", 0);
+ set_property(command, P_RESULT, 1);
break;
case Q_ENABLE_CONNECT_LOG:
- disable_connect_log=0;
- var_set_int("$ENABLED_CONNECT_LOG", 1);
+ set_property(command, P_CONNECT, 0);
break;
case Q_DISABLE_CONNECT_LOG:
- disable_connect_log=1;
- var_set_int("$ENABLED_CONNECT_LOG", 0);
+ set_property(command, P_CONNECT, 1);
break;
case Q_ENABLE_WARNINGS:
- disable_warnings= 0;
- var_set_int("$ENABLED_WARNINGS", 1);
+ set_property(command, P_WARN, 0);
break;
case Q_DISABLE_WARNINGS:
- disable_warnings= 1;
- var_set_int("$ENABLED_WARNINGS", 0);
+ set_property(command, P_WARN, 1);
break;
case Q_ENABLE_INFO:
- disable_info= 0;
- var_set_int("$ENABLED_INFO", 1);
+ set_property(command, P_INFO, 0);
break;
case Q_DISABLE_INFO:
- disable_info= 1;
- var_set_int("$ENABLED_INFO", 0);
+ set_property(command, P_INFO, 1);
break;
case Q_ENABLE_METADATA:
- display_metadata= 1;
- var_set_int("$ENABLED_METADATA", 1);
+ set_property(command, P_META, 1);
break;
case Q_DISABLE_METADATA:
- display_metadata= 0;
- var_set_int("$ENABLED_METADATA", 0);
+ set_property(command, P_META, 0);
break;
case Q_ENABLE_COLUMN_NAMES:
disable_column_names= 0;
@@ -8870,12 +8968,12 @@ int main(int argc, char **argv)
do_set_charset(command);
break;
case Q_DISABLE_PS_PROTOCOL:
- ps_protocol_enabled= 0;
+ set_property(command, P_PS, 0);
/* Close any open statements */
close_statements();
break;
case Q_ENABLE_PS_PROTOCOL:
- ps_protocol_enabled= ps_protocol;
+ set_property(command, P_PS, ps_protocol);
break;
case Q_DISABLE_RECONNECT:
set_reconnect(cur_con->mysql, 0);
diff --git a/client/readline.cc b/client/readline.cc
index 51cbd89f29f..e451baff341 100644
--- a/client/readline.cc
+++ b/client/readline.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* readline for batch mode */
diff --git a/client/sql_string.cc b/client/sql_string.cc
index 684e9f337af..26181722b11 100644
--- a/client/sql_string.cc
+++ b/client/sql_string.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/*
+ Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* This file is originally from the mysql distribution. Coded by monty */
diff --git a/client/sql_string.h b/client/sql_string.h
index 60f3c557367..26f3b330f20 100644
--- a/client/sql_string.h
+++ b/client/sql_string.h
@@ -1,7 +1,7 @@
#ifndef SQL_STRING_INCLUDED
#define SQL_STRING_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is originally from the mysql distribution. Coded by monty */
diff --git a/cmake/abi_check.cmake b/cmake/abi_check.cmake
index a671aeff342..9948f526b7a 100644
--- a/cmake/abi_check.cmake
+++ b/cmake/abi_check.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/bison.cmake b/cmake/bison.cmake
index 1dd5d10cd33..d5c725fbbde 100644
--- a/cmake/bison.cmake
+++ b/cmake/bison.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 91d598db465..ee6d6b85004 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -210,8 +210,8 @@ IF(UNIX)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
- SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
- SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
+ SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-xO1 ${COMMON_CXX_FLAGS}")
IF(32BIT)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_CXX_FLAGS}")
diff --git a/cmake/cat.cmake b/cmake/cat.cmake
index 532f4115104..1ffe2ecfa1d 100644
--- a/cmake/cat.cmake
+++ b/cmake/cat.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/check_minimal_version.cmake b/cmake/check_minimal_version.cmake
index 4f134712fae..d96c6a93418 100644
--- a/cmake/check_minimal_version.cmake
+++ b/cmake/check_minimal_version.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/cmake_parse_arguments.cmake b/cmake/cmake_parse_arguments.cmake
index db540ae9020..487fe2bacd9 100644
--- a/cmake/cmake_parse_arguments.cmake
+++ b/cmake/cmake_parse_arguments.cmake
@@ -1,5 +1,5 @@
-# Copyright (C) 2007 MySQL AB, 2009 Sun Microsystems,Inc
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/configure.pl b/cmake/configure.pl
index bf872264953..565de571452 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl
+
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use Cwd 'abs_path';
use File::Basename;
diff --git a/cmake/cpack_source_ignore_files.cmake b/cmake/cpack_source_ignore_files.cmake
index 5eef20dccc6..5db383ae73f 100644
--- a/cmake/cpack_source_ignore_files.cmake
+++ b/cmake/cpack_source_ignore_files.cmake
@@ -1,3 +1,18 @@
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
SET(CPACK_SOURCE_IGNORE_FILES
\\\\.bzr/
\\\\.bzr-mysql
diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake.in
index 881afe265ef..e37f41255e0 100644
--- a/cmake/create_initial_db.cmake.in
+++ b/cmake/create_initial_db.cmake.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake
index 96943e1a4c4..e42f11abde2 100644
--- a/cmake/do_abi_check.cmake
+++ b/cmake/do_abi_check.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake
index 5beb45ca524..882ea0de6aa 100644
--- a/cmake/dtrace.cmake
+++ b/cmake/dtrace.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/dtrace_prelink.cmake b/cmake/dtrace_prelink.cmake
index 37e560cdaf8..0efc2bb64bb 100644
--- a/cmake/dtrace_prelink.cmake
+++ b/cmake/dtrace_prelink.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index bbf29c2e46c..9f9dc7dc9a3 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index e244e4262e0..a8a84e48455 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index 89eb5a74d80..89a9de9b322 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index d24211a6ff8..a91905a281b 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/merge_archives_unix.cmake.in b/cmake/merge_archives_unix.cmake.in
index a9a060ab49e..d05336d6c91 100644
--- a/cmake/merge_archives_unix.cmake.in
+++ b/cmake/merge_archives_unix.cmake.in
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake
index ac812fbcdfd..b1e1d3129e6 100644
--- a/cmake/mysql_add_executable.cmake
+++ b/cmake/mysql_add_executable.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index 5b18dd97756..4a9f35e6b35 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/AIX.cmake b/cmake/os/AIX.cmake
index c08cbbdc0cf..c86392f8bc4 100644
--- a/cmake/os/AIX.cmake
+++ b/cmake/os/AIX.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/Cygwin.cmake b/cmake/os/Cygwin.cmake
index 5b2d82c19b8..9c29277c626 100644
--- a/cmake/os/Cygwin.cmake
+++ b/cmake/os/Cygwin.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/Darwin.cmake b/cmake/os/Darwin.cmake
index 09d82bed7bd..0d8bac106f0 100644
--- a/cmake/os/Darwin.cmake
+++ b/cmake/os/Darwin.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/HP-UX.cmake b/cmake/os/HP-UX.cmake
index 5eaa0477040..4cadddc7b18 100644
--- a/cmake/os/HP-UX.cmake
+++ b/cmake/os/HP-UX.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake
index 10d3a719609..61361d1d48b 100644
--- a/cmake/os/Linux.cmake
+++ b/cmake/os/Linux.cmake
@@ -1,5 +1,5 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/OS400.cmake b/cmake/os/OS400.cmake
index b8cad2917f9..502eeccc30a 100644
--- a/cmake/os/OS400.cmake
+++ b/cmake/os/OS400.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/SunOS.cmake b/cmake/os/SunOS.cmake
index 9e8ca0ef11f..3d2b4b8949a 100644
--- a/cmake/os/SunOS.cmake
+++ b/cmake/os/SunOS.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index 6a8c027daf8..0ccdc3cb6a4 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index 68bbb337e15..897012896c8 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake
index 7d6e4d7348a..212fa99d7f0 100644
--- a/cmake/package_name.cmake
+++ b/cmake/package_name.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 615b1d7a717..5e59b71fd91 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -196,6 +196,10 @@ MACRO(MYSQL_ADD_PLUGIN)
# Install dynamic library
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
+ # Add installed files to list for RPMs
+ FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
+ "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n"
+ "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/debug/${ARG_MODULE_OUTPUT_NAME}.so\n")
# For internal testing in PB2, append collections files
IF(DEFINED ENV{PB2WORKDIR})
PLUGIN_APPEND_COLLECTIONS(${plugin})
diff --git a/cmake/readline.cmake b/cmake/readline.cmake
index 5b6d23fc14e..4840229a82e 100644
--- a/cmake/readline.cmake
+++ b/cmake/readline.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index c5aa2de2721..9b16bf09394 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmake/stack_direction.c b/cmake/stack_direction.c
index 11bcf803bfa..d75bbbfa035 100644
--- a/cmake/stack_direction.c
+++ b/cmake/stack_direction.c
@@ -1,4 +1,6 @@
-/* Copyright (C) 2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,4 +30,4 @@ int main()
{
int a;
return ptr_f(&a);
-} \ No newline at end of file
+}
diff --git a/cmake/versioninfo.rc.in b/cmake/versioninfo.rc.in
index fc3e72f33ac..6eb853936d2 100644
--- a/cmake/versioninfo.rc.in
+++ b/cmake/versioninfo.rc.in
@@ -1,3 +1,18 @@
+// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
index 59f1f7ba68e..3ede3aba228 100644
--- a/cmake/zlib.cmake
+++ b/cmake/zlib.cmake
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/cmd-line-utils/readline/CMakeLists.txt b/cmd-line-utils/readline/CMakeLists.txt
index be84f22f210..abe83b5a85c 100644
--- a/cmd-line-utils/readline/CMakeLists.txt
+++ b/cmd-line-utils/readline/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/config.h.cmake b/config.h.cmake
index 6de3d997a55..8da37135cc1 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -219,7 +219,6 @@
#cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1
#cmakedefine HAVE_PTHREAD_CONDATTR_SETCLOCK 1
-#cmakedefine HAVE_PTHREAD_INIT 1
#cmakedefine HAVE_PTHREAD_KEY_DELETE 1
#cmakedefine HAVE_PTHREAD_KEY_DELETE 1
#cmakedefine HAVE_PTHREAD_KILL 1
diff --git a/configure.cmake b/configure.cmake
index c0043664486..1a434e91f23 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1,5 +1,5 @@
-# Copyright (C) 2009 Sun Microsystems,Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -391,7 +391,6 @@ CHECK_FUNCTION_EXISTS (pthread_attr_setscope HAVE_PTHREAD_ATTR_SETSCOPE)
CHECK_FUNCTION_EXISTS (pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
CHECK_FUNCTION_EXISTS (pthread_condattr_create HAVE_PTHREAD_CONDATTR_CREATE)
CHECK_FUNCTION_EXISTS (pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK)
-CHECK_FUNCTION_EXISTS (pthread_init HAVE_PTHREAD_INIT)
CHECK_FUNCTION_EXISTS (pthread_key_delete HAVE_PTHREAD_KEY_DELETE)
CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK)
CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK)
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 63b373921be..8d2d5082b6a 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -1861,7 +1861,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
const char *name,const char *end,int append)
{
FILE *fp;
- BOOLEAN newfile;
if (name != NULL)
{
@@ -1890,7 +1889,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
}
else
{
- newfile= !EXISTS(name);
if (!(fp= fopen(name, append ? "a+" : "w")))
{
(void) fprintf(stderr, ERR_OPEN, cs->process, name);
diff --git a/dbug/dbug_add_tags.pl b/dbug/dbug_add_tags.pl
index 9653124cfd0..fe3637b4d12 100755
--- a/dbug/dbug_add_tags.pl
+++ b/dbug/dbug_add_tags.pl
@@ -1,5 +1,21 @@
#!/usr/bin/perl
+# Copyright (c) 2002 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
die "No files specified\n" unless $ARGV[0];
$ctags="exctags -x -f - --c-types=f -u";
diff --git a/dbug/my_main.c b/dbug/my_main.c
index 48d092ca10a..490e1808dd2 100644
--- a/dbug/my_main.c
+++ b/dbug/my_main.c
@@ -16,9 +16,6 @@ char *argv[];
{
register int result, ix;
extern int factorial(int);
-#if defined(HAVE_PTHREAD_INIT)
- pthread_init(); /* Must be called before DBUG_ENTER */
-#endif
my_thread_global_init();
{
diff --git a/dbug/tests.c b/dbug/tests.c
index 837a477aef3..5fb84d48ffc 100644
--- a/dbug/tests.c
+++ b/dbug/tests.c
@@ -44,9 +44,6 @@ int main (int argc, char *argv[])
if (argc == 1)
return 0;
-#if defined(HAVE_PTHREAD_INIT)
- pthread_init(); /* Must be called before DBUG_ENTER */
-#endif
my_thread_global_init();
dup2(1, 2);
diff --git a/extra/comp_err.c b/extra/comp_err.c
index f1159232087..718b1ef7c36 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2004 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
Written by Anjuta Widenius
diff --git a/extra/innochecksum.c b/extra/innochecksum.c
index 9bd4bfcc0cd..b55b510b888 100644
--- a/extra/innochecksum.c
+++ b/extra/innochecksum.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2005 MySQL AB & Innobase Oy
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
InnoDB offline file checksum utility. 85% of the code in this file
@@ -23,12 +25,7 @@
Published with a permission.
*/
-/* needed to have access to 64 bit file functions */
-#define _LARGEFILE_SOURCE
-#define _LARGEFILE64_SOURCE
-
-#define _XOPEN_SOURCE 500 /* needed to include getopt.h on some platforms. */
-
+#include <my_global.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@@ -51,7 +48,6 @@
/* another argument to specify page ranges... seek to right spot and go from there */
typedef unsigned long int ulint;
-typedef unsigned char uchar;
/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */
ulint mach_read_from_4(uchar *b)
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index 3f172a11042..d38ce1b49ff 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2000 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
** print_default.c:
diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c
index d5c9f2f42ae..23177eb51cb 100644
--- a/extra/mysql_waitpid.c
+++ b/extra/mysql_waitpid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Wait until a program dies */
diff --git a/extra/perror.c b/extra/perror.c
index 3c00b9b11d7..af5d95d3c5b 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Return error-text for system error messages and handler messages */
@@ -64,7 +65,8 @@ static struct my_option my_long_options[] =
&ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#ifdef HAVE_SYS_ERRLIST
- {"all", 'a', "Print all the error messages and the number.",
+ {"all", 'a', "Print all the error messages and the number. Deprecated,"
+ " will be removed in a future release.",
&print_all_codes, &print_all_codes, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
@@ -295,6 +297,8 @@ int main(int argc,char *argv[])
if (print_all_codes)
{
HA_ERRORS *ha_err_ptr;
+ printf("WARNING: option '-a/--all' is deprecated and will be removed in a"
+ " future release.\n");
for (code=1 ; code < sys_nerr ; code++)
{
if (sys_errlist[code] && sys_errlist[code][0])
diff --git a/extra/replace.c b/extra/replace.c
index 1afc373ef38..f09d0454eef 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index 6ea818c601b..3422b7ef4de 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Resolve numeric stack dump produced by mysqld 3.23.30 and later
versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
diff --git a/extra/resolveip.c b/extra/resolveip.c
index 094dfecae59..f69aa7fec5f 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Resolves IP's to hostname and hostnames to IP's */
diff --git a/extra/yassl/include/cert_wrapper.hpp b/extra/yassl/include/cert_wrapper.hpp
index 572b9f87293..d07e5b627b0 100644
--- a/extra/yassl/include/cert_wrapper.hpp
+++ b/extra/yassl/include/cert_wrapper.hpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h
index fcd91cd5b9a..024cb0a9aff 100644
--- a/extra/yassl/include/openssl/prefix_ssl.h
+++ b/extra/yassl/include/openssl/prefix_ssl.h
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2006, 2007 MySQL AB
+ Copyright (c) 2006, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 05b34a0dc45..ba5fa51f34c 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/include/yassl_error.hpp b/extra/yassl/include/yassl_error.hpp
index d2473fb3e2b..87bb4c55e96 100644
--- a/extra/yassl/include/yassl_error.hpp
+++ b/extra/yassl/include/yassl_error.hpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/include/yassl_imp.hpp b/extra/yassl/include/yassl_imp.hpp
index 8893ba8a8ba..04e85c16a04 100644
--- a/extra/yassl/include/yassl_imp.hpp
+++ b/extra/yassl/include/yassl_imp.hpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index 1cc4200d10c..433649c545b 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -1,5 +1,5 @@
/*
- Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/include/yassl_types.hpp b/extra/yassl/include/yassl_types.hpp
index 28535792828..c73a54a7c15 100644
--- a/extra/yassl/include/yassl_types.hpp
+++ b/extra/yassl/include/yassl_types.hpp
@@ -1,5 +1,6 @@
/*
- Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/buffer.cpp b/extra/yassl/src/buffer.cpp
index 5bd69905772..a5028e7bb53 100644
--- a/extra/yassl/src/buffer.cpp
+++ b/extra/yassl/src/buffer.cpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/cert_wrapper.cpp b/extra/yassl/src/cert_wrapper.cpp
index ebec0882265..d8660533f2e 100644
--- a/extra/yassl/src/cert_wrapper.cpp
+++ b/extra/yassl/src/cert_wrapper.cpp
@@ -1,5 +1,6 @@
/*
- Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005-2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp
index 09afc835fce..41b03f037a7 100644
--- a/extra/yassl/src/crypto_wrapper.cpp
+++ b/extra/yassl/src/crypto_wrapper.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index b4d9005af15..08fae4ac17d 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/socket_wrapper.cpp b/extra/yassl/src/socket_wrapper.cpp
index cebbd9c5529..3cf6c14c4b3 100644
--- a/extra/yassl/src/socket_wrapper.cpp
+++ b/extra/yassl/src/socket_wrapper.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 4d8b6ac69b8..67d2d428e51 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -1,5 +1,6 @@
/*
- Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005-2007 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp
index 4bd38445a6b..9f042ddbcd5 100644
--- a/extra/yassl/src/yassl_error.cpp
+++ b/extra/yassl/src/yassl_error.cpp
@@ -1,5 +1,5 @@
/*
- Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp
index 5128c00418e..48afc86ae20 100644
--- a/extra/yassl/src/yassl_imp.cpp
+++ b/extra/yassl/src/yassl_imp.cpp
@@ -1,5 +1,5 @@
/*
- Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp
index 5af2f180bb1..66a854e6922 100644
--- a/extra/yassl/src/yassl_int.cpp
+++ b/extra/yassl/src/yassl_int.cpp
@@ -1,5 +1,5 @@
/*
- Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/include/asn.hpp b/extra/yassl/taocrypt/include/asn.hpp
index 168b8a8c755..ece7140741a 100644
--- a/extra/yassl/taocrypt/include/asn.hpp
+++ b/extra/yassl/taocrypt/include/asn.hpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/include/block.hpp b/extra/yassl/taocrypt/include/block.hpp
index d5bc8756fdd..9885c44d2c9 100644
--- a/extra/yassl/taocrypt/include/block.hpp
+++ b/extra/yassl/taocrypt/include/block.hpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/include/blowfish.hpp b/extra/yassl/taocrypt/include/blowfish.hpp
index 94bbab7aea8..99d932353df 100644
--- a/extra/yassl/taocrypt/include/blowfish.hpp
+++ b/extra/yassl/taocrypt/include/blowfish.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/include/misc.hpp b/extra/yassl/taocrypt/include/misc.hpp
index 431316b84d1..a375b17eb1e 100644
--- a/extra/yassl/taocrypt/include/misc.hpp
+++ b/extra/yassl/taocrypt/include/misc.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp
index 4575fe1414b..2285bd0e845 100644
--- a/extra/yassl/taocrypt/include/modes.hpp
+++ b/extra/yassl/taocrypt/include/modes.hpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/include/runtime.hpp b/extra/yassl/taocrypt/include/runtime.hpp
index 9d12b253dd6..ad66a5bf9d0 100644
--- a/extra/yassl/taocrypt/include/runtime.hpp
+++ b/extra/yassl/taocrypt/include/runtime.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp
index 42cb0622e56..a3fbd9b7d74 100644
--- a/extra/yassl/taocrypt/src/aes.cpp
+++ b/extra/yassl/taocrypt/src/aes.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp
index 437563b9093..6da0040c6d9 100644
--- a/extra/yassl/taocrypt/src/algebra.cpp
+++ b/extra/yassl/taocrypt/src/algebra.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp
index f87b466502e..1b81db4f0a4 100644
--- a/extra/yassl/taocrypt/src/asn.cpp
+++ b/extra/yassl/taocrypt/src/asn.cpp
@@ -1,5 +1,6 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005-2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/blowfish.cpp b/extra/yassl/taocrypt/src/blowfish.cpp
index 2a5ae7ffadf..445de6d8935 100644
--- a/extra/yassl/taocrypt/src/blowfish.cpp
+++ b/extra/yassl/taocrypt/src/blowfish.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp
index 7fc681e1a05..7c6a6a8bd8b 100644
--- a/extra/yassl/taocrypt/src/coding.cpp
+++ b/extra/yassl/taocrypt/src/coding.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp
index b054e98bef4..c00815df8cf 100644
--- a/extra/yassl/taocrypt/src/integer.cpp
+++ b/extra/yassl/taocrypt/src/integer.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp
index 978665b2f7c..b0382d0ba69 100644
--- a/extra/yassl/taocrypt/src/misc.cpp
+++ b/extra/yassl/taocrypt/src/misc.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp
index 729421fc71d..1be0fed612f 100644
--- a/extra/yassl/taocrypt/src/random.cpp
+++ b/extra/yassl/taocrypt/src/random.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/taocrypt/src/twofish.cpp b/extra/yassl/taocrypt/src/twofish.cpp
index 85feaa23280..c7f2e27d4f3 100644
--- a/extra/yassl/taocrypt/src/twofish.cpp
+++ b/extra/yassl/taocrypt/src/twofish.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/extra/yassl/testsuite/test.hpp b/extra/yassl/testsuite/test.hpp
index e7de3268ec4..e14cdc54ae0 100644
--- a/extra/yassl/testsuite/test.hpp
+++ b/extra/yassl/testsuite/test.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006, 2007 MySQL AB
+ Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 773c26f9d0a..5d9c701fda8 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h
index d03d28f572e..fb6a537d204 100644
--- a/include/atomic/gcc_builtins.h
+++ b/include/atomic/gcc_builtins.h
@@ -1,7 +1,7 @@
#ifndef ATOMIC_GCC_BUILTINS_INCLUDED
#define ATOMIC_GCC_BUILTINS_INCLUDED
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define make_atomic_add_body(S) \
v= __sync_fetch_and_add(a, v);
diff --git a/include/atomic/generic-msvc.h b/include/atomic/generic-msvc.h
index a84cde6b2c3..6c5272c98f4 100644
--- a/include/atomic/generic-msvc.h
+++ b/include/atomic/generic-msvc.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _atomic_h_cleanup_
#define _atomic_h_cleanup_ "atomic/generic-msvc.h"
diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h
index 4c871473b60..1da184158ab 100644
--- a/include/atomic/nolock.h
+++ b/include/atomic/nolock.h
@@ -1,7 +1,7 @@
#ifndef ATOMIC_NOLOCK_INCLUDED
#define ATOMIC_NOLOCK_INCLUDED
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#if defined(__i386__) || defined(_MSC_VER) || defined(__x86_64__) \
|| defined(HAVE_GCC_ATOMIC_BUILTINS) \
diff --git a/include/atomic/rwlock.h b/include/atomic/rwlock.h
index a31f8ed6ca1..f6bf7d0b76f 100644
--- a/include/atomic/rwlock.h
+++ b/include/atomic/rwlock.h
@@ -1,7 +1,8 @@
#ifndef ATOMIC_RWLOCK_INCLUDED
#define ATOMIC_RWLOCK_INCLUDED
-/* Copyright (C) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define MY_ATOMIC_MODE_RWLOCKS 1
diff --git a/include/atomic/solaris.h b/include/atomic/solaris.h
index 5643f878cd2..7b6f0561ff0 100644
--- a/include/atomic/solaris.h
+++ b/include/atomic/solaris.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _atomic_h_cleanup_
#define _atomic_h_cleanup_ "atomic/solaris.h"
diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h
index ea3202aa9c9..2238347d419 100644
--- a/include/atomic/x86-gcc.h
+++ b/include/atomic/x86-gcc.h
@@ -1,7 +1,7 @@
#ifndef ATOMIC_X86_GCC_INCLUDED
#define ATOMIC_X86_GCC_INCLUDED
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
XXX 64-bit atomic operations can be implemented using
diff --git a/include/decimal.h b/include/decimal.h
index bc948125f22..935d341437d 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _decimal_h
#define _decimal_h
@@ -21,6 +21,15 @@ typedef enum
decimal_round_mode;
typedef int32 decimal_digit_t;
+/**
+ intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
+ before the point
+ frac is the number of decimal digits after the point
+ len is the length of buf (length of allocated space) in decimal_digit_t's,
+ not in bytes
+ sign false means positive, true means negative
+ buf is an array of decimal_digit_t's
+ */
typedef struct st_decimal_t {
int intg, frac, len;
my_bool sign;
diff --git a/include/errmsg.h b/include/errmsg.h
index f1d7dd65f97..64ec2df395c 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -1,7 +1,7 @@
#ifndef ERRMSG_INCLUDED
#define ERRMSG_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Error messages for MySQL clients */
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
diff --git a/include/ft_global.h b/include/ft_global.h
index eb1f84d307b..8a1069d6e62 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
diff --git a/include/hash.h b/include/hash.h
index ae3f017a03e..98bcf911db2 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Dynamic hashing of record with different key-length */
diff --git a/include/heap.h b/include/heap.h
index b23ec47db67..6ce95c88521 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
- reserved
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* This file should be included when using heap_database_functions */
/* Author: Michael Widenius */
@@ -50,6 +51,7 @@ typedef struct st_heapinfo /* Struct from heap_info */
uint reclength; /* Length of one record */
int errkey;
ulonglong auto_increment;
+ time_t create_time;
} HEAPINFO;
@@ -148,6 +150,7 @@ typedef struct st_heap_share
uint open_count;
uchar *del_link; /* Link to next block with del. rec */
char * name; /* Name of "memory-file" */
+ time_t create_time;
THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */
my_bool delete_on_close;
diff --git a/include/keycache.h b/include/keycache.h
index bc14bdef0bf..da6624725e7 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Key cache variable structures */
diff --git a/include/lf.h b/include/lf.h
index 9698086bacf..cdd24c07502 100644
--- a/include/lf.h
+++ b/include/lf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _lf_h
#define _lf_h
diff --git a/include/m_ctype.h b/include/m_ctype.h
index ff0a870b268..2a7175f739a 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
A better inplementation of the UNIX ctype(3) library.
diff --git a/include/m_string.h b/include/m_string.h
index ba906e2e62c..6268888028f 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* There may be prolems include all of theese. Try to test in
configure with ones are needed? */
diff --git a/include/my_aes.h b/include/my_aes.h
index 2e2a66b4968..58a78919023 100644
--- a/include/my_aes.h
+++ b/include/my_aes.h
@@ -1,7 +1,8 @@
#ifndef MY_AES_INCLUDED
#define MY_AES_INCLUDED
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Header file for my_aes.c */
diff --git a/include/my_alarm.h b/include/my_alarm.h
index fa396cf02f9..57d86f56755 100644
--- a/include/my_alarm.h
+++ b/include/my_alarm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
File to include when we want to use alarm or a loop_counter to display
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 11e1331988b..85ac75fc666 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Data structures for mysys/my_alloc.c (root memory allocator)
diff --git a/include/my_atomic.h b/include/my_atomic.h
index 849b54f3532..7c589cd776a 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -1,6 +1,7 @@
#ifndef MY_ATOMIC_INCLUDED
#define MY_ATOMIC_INCLUDED
-/* Copyright (C) 2006 MySQL AB
+
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This header defines five atomic operations:
diff --git a/include/my_attribute.h b/include/my_attribute.h
index 13d1dc42fc1..14ed35cfe24 100644
--- a/include/my_attribute.h
+++ b/include/my_attribute.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Helper macros used for setting different __attributes__
diff --git a/include/my_base.h b/include/my_base.h
index c71df96dbed..4edecf63d18 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
reserved
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file includes constants used with all databases */
@@ -456,11 +456,13 @@ enum ha_base_keytype {
#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */
-#define HA_ERR_INDEX_COL_TOO_LONG 178 /* Index column length exceeds limit */
-#define HA_ERR_ROW_NOT_VISIBLE 179
-#define HA_ERR_ABORTED_BY_USER 180
-#define HA_ERR_DISK_FULL 181
-#define HA_ERR_LAST 181 /* Copy of last error nr */
+#define HA_ERR_INDEX_COL_TOO_LONG 178 /* Index column length exceeds limit */
+#define HA_ERR_INDEX_CORRUPT 179 /* Index corrupted */
+#define HA_ERR_UNDO_REC_TOO_BIG 180 /* Undo log record too big */
+#define HA_ERR_ROW_NOT_VISIBLE 181
+#define HA_ERR_ABORTED_BY_USER 182
+#define HA_ERR_DISK_FULL 183
+#define HA_ERR_LAST 183 /* Copy of last error nr */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
diff --git a/include/my_compiler.h b/include/my_compiler.h
index 9fe8de574a7..000d4e42848 100644
--- a/include/my_compiler.h
+++ b/include/my_compiler.h
@@ -1,7 +1,7 @@
#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED
-/* Copyright (c) 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/my_dbug.h b/include/my_dbug.h
index e4de723e1d7..920ba4d4f90 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -1,5 +1,5 @@
-/* Copyright (c) 2009-2011 Monty Program Ab
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2009-2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_dbug_h
#define _my_dbug_h
diff --git a/include/my_dir.h b/include/my_dir.h
index de21bee7385..1ee002cc380 100644
--- a/include/my_dir.h
+++ b/include/my_dir.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MY_DIR_H
#define MY_DIR_H
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 6c1db277db8..092accc05a1 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/my_global.h b/include/my_global.h
index 5590570df94..451cb9127a3 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -626,6 +627,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_LIBCHAR '\\'
#define FN_LIBCHAR2 '/'
#define FN_DIRSEP "/\\" /* Valid directory separators */
+#define FN_EXEEXT ".exe"
+#define FN_SOEXT ".dll"
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
@@ -634,6 +637,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_LIBCHAR '/'
#define FN_LIBCHAR2 '/'
#define FN_DIRSEP "/" /* Valid directory separators */
+#define FN_EXEEXT ""
+#define FN_SOEXT ".so"
#define FN_ROOTDIR "/"
#endif
diff --git a/include/my_libwrap.h b/include/my_libwrap.h
index 8235c00d8f3..9a017611408 100644
--- a/include/my_libwrap.h
+++ b/include/my_libwrap.h
@@ -1,7 +1,8 @@
#ifndef MY_LIBWRAP_INCLUDED
#define MY_LIBWRAP_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef HAVE_LIBWRAP
#include <tcpd.h>
diff --git a/include/my_list.h b/include/my_list.h
index ff086e1725b..294be663d0e 100644
--- a/include/my_list.h
+++ b/include/my_list.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _list_h_
#define _list_h_
diff --git a/include/my_nosys.h b/include/my_nosys.h
index 93d70a6cfa6..97f36d00c57 100644
--- a/include/my_nosys.h
+++ b/include/my_nosys.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Header to remove use of my_functions in functions where we need speed and
diff --git a/include/my_rdtsc.h b/include/my_rdtsc.h
index 81bc1aafb58..38ab0de8040 100644
--- a/include/my_rdtsc.h
+++ b/include/my_rdtsc.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008, 2009 Sun Microsystems, Inc
+/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
rdtsc3 -- multi-platform timer code
diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h
index 8c2c97c68e5..df5741fa3d8 100644
--- a/include/my_stacktrace.h
+++ b/include/my_stacktrace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_stacktrace_h_
#define _my_stacktrace_h_
diff --git a/include/my_time.h b/include/my_time.h
index e747e9d55db..9a2e78ceefe 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2005 MySQL AB
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This is a private header of sql-common library, containing
diff --git a/include/my_tree.h b/include/my_tree.h
index 3524c82a2bc..3dd92712af2 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _tree_h
#define _tree_h
diff --git a/include/my_uctype.h b/include/my_uctype.h
index 580eb646e11..80ef01c079a 100644
--- a/include/my_uctype.h
+++ b/include/my_uctype.h
@@ -1,7 +1,8 @@
#ifndef MY_UCTYPE_INCLUDED
#define MY_UCTYPE_INCLUDED
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/myisam.h b/include/myisam.h
index 0fd87839057..9e843e176eb 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
- reserved
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file should be included when using myisam_funktions */
diff --git a/include/myisammrg.h b/include/myisammrg.h
index 3277510705b..84b2d637892 100644
--- a/include/myisammrg.h
+++ b/include/myisammrg.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000-2002, 2004, 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file should be included when using merge_isam_funktions */
diff --git a/include/myisampack.h b/include/myisampack.h
index 41b53f26a5f..a065de378d8 100644
--- a/include/myisampack.h
+++ b/include/myisampack.h
@@ -1,7 +1,8 @@
#ifndef MYISAMPACK_INCLUDED
#define MYISAMPACK_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000-2002, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Storing of values in high byte first order.
diff --git a/include/mysql.h b/include/mysql.h
index 2b1c90b0fd9..d06db7ed25d 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This file defines the client API to MySQL and also the ABI of the
diff --git a/include/mysql/client_plugin.h b/include/mysql/client_plugin.h
index eb1c74d7c0b..35b415fdaf0 100644
--- a/include/mysql/client_plugin.h
+++ b/include/mysql/client_plugin.h
@@ -1,5 +1,6 @@
#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 2e5e6b5c9b0..19601d85f94 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
Copyright (C) 2009-2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_plugin_h
#define _my_plugin_h
@@ -73,7 +73,7 @@ typedef struct st_mysql_xid MYSQL_XID;
*/
/* MySQL plugin interface version */
-#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102
+#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0103
/* MariaDB plugin interface version */
#define MARIA_PLUGIN_INTERFACE_VERSION 0x0101
@@ -151,7 +151,7 @@ MARIA_DECLARE_PLUGIN__(NAME, \
builtin_maria_ ## NAME ## _sizeof_struct_st_plugin, \
builtin_maria_ ## NAME ## _plugin)
-#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}
+#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
#define maria_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
/*
@@ -176,6 +176,14 @@ typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *)
/*
+ Constants for plugin flags.
+ */
+
+#define PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */
+#define PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */
+
+
+/*
declarations for server variables and command line options
*/
@@ -447,6 +455,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1; /* reserved for dependency checking */
+ unsigned long flags; /* flags for plugin */
};
/*
diff --git a/include/mysql/plugin_audit.h b/include/mysql/plugin_audit.h
index 5072ad2b44c..eee32a9e523 100644
--- a/include/mysql/plugin_audit.h
+++ b/include/mysql/plugin_audit.h
@@ -1,17 +1,18 @@
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; version 2 of
+ the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_audit_h
#define _my_audit_h
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index a435c7c64b2..0d248c5d39d 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -122,6 +122,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1;
+ unsigned long flags;
};
struct st_maria_plugin
{
diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h
index fcfd1bc6f0b..75e7fba5266 100644
--- a/include/mysql/plugin_auth.h
+++ b/include/mysql/plugin_auth.h
@@ -1,6 +1,6 @@
#ifndef MYSQL_PLUGIN_AUTH_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
- Copyright (C) 2010 Sun Microsystems, Inc.
+ Copyright (c) 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index 7a40ee5b9f7..f9df2bc94f8 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -122,6 +122,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1;
+ unsigned long flags;
};
struct st_maria_plugin
{
diff --git a/include/mysql/plugin_auth_common.h b/include/mysql/plugin_auth_common.h
index 2f6642abac1..820d299bf88 100644
--- a/include/mysql/plugin_auth_common.h
+++ b/include/mysql/plugin_auth_common.h
@@ -1,6 +1,6 @@
#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
- Copyright (C) 2010 Sun Microsystems, Inc.
+ Copyright (c) 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef _WIN32
#include <windows.h>
diff --git a/include/mysql/plugin_ftparser.h b/include/mysql/plugin_ftparser.h
index 37bc96b0e08..324fce7ae86 100644
--- a/include/mysql/plugin_ftparser.h
+++ b/include/mysql/plugin_ftparser.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_plugin_ftparser_h
#define _my_plugin_ftparser_h
diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp
index 527be747cb4..f552b93a953 100644
--- a/include/mysql/plugin_ftparser.h.pp
+++ b/include/mysql/plugin_ftparser.h.pp
@@ -122,6 +122,7 @@ struct st_mysql_plugin
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1;
+ unsigned long flags;
};
struct st_maria_plugin
{
diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h
index 4395ea17ab7..57b67f1416d 100644
--- a/include/mysql/service_my_snprintf.h
+++ b/include/mysql/service_my_snprintf.h
@@ -1,5 +1,5 @@
#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/include/mysql/service_thd_alloc.h b/include/mysql/service_thd_alloc.h
index 7061c2bd4d5..645fb310cbc 100644
--- a/include/mysql/service_thd_alloc.h
+++ b/include/mysql/service_thd_alloc.h
@@ -1,5 +1,5 @@
#ifndef MYSQL_SERVICE_THD_ALLOC_INCLUDED
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/include/mysql/service_thd_wait.h b/include/mysql/service_thd_wait.h
index f5d2a75f5fc..6b47a4ff21e 100644
--- a/include/mysql/service_thd_wait.h
+++ b/include/mysql/service_thd_wait.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef MYSQL_SERVICE_THD_WAIT_INCLUDED
#define MYSQL_SERVICE_THD_WAIT_INCLUDED
diff --git a/include/mysql/service_thread_scheduler.h b/include/mysql/service_thread_scheduler.h
index a4396b721bd..5a5e0e2f520 100644
--- a/include/mysql/service_thread_scheduler.h
+++ b/include/mysql/service_thread_scheduler.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SERVICE_THREAD_SCHEDULER_INCLUDED
diff --git a/include/mysql/services.h b/include/mysql/services.h
index bd029e55b78..eca0e88c8da 100644
--- a/include/mysql/services.h
+++ b/include/mysql/services.h
@@ -1,5 +1,5 @@
#ifndef MYSQL_SERVICES_INCLUDED
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef __cplusplus
extern "C" {
diff --git a/include/mysql/thread_pool_priv.h b/include/mysql/thread_pool_priv.h
index f56242fd74f..4060cf51733 100644
--- a/include/mysql/thread_pool_priv.h
+++ b/include/mysql/thread_pool_priv.h
@@ -1,6 +1,6 @@
#error don't use
/*
- Copyright (C) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef THREAD_POOL_PRIV_INCLUDED
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 1ffb6557117..57e84dc4e08 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
** Common definition between mysql server & client
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index 3b6f851bd6f..b96083d07db 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -1,7 +1,7 @@
#ifndef MYSQL_EMBED_INCLUDED
#define MYSQL_EMBED_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Defines that are unique to the embedded version of MySQL */
diff --git a/include/mysys_err.h b/include/mysys_err.h
index 1308c645d16..42c1bf3175a 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _mysys_err_h
#define _mysys_err_h
diff --git a/include/password.h b/include/password.h
index e75b09297a3..082f917e7c0 100644
--- a/include/password.h
+++ b/include/password.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/probes_mysql.d.base b/include/probes_mysql.d.base
index 958e3042dde..02eb9ec1a6b 100644
--- a/include/probes_mysql.d.base
+++ b/include/probes_mysql.d.base
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
The actual probe names in DTrace scripts will replace '__' by '-'. Thus
diff --git a/include/probes_mysql.h b/include/probes_mysql.h
index 13491c661fd..191860d0b94 100644
--- a/include/probes_mysql.h
+++ b/include/probes_mysql.h
@@ -1,3 +1,19 @@
+/* Copyright (c) 2008 Sun Microsystems, Inc.
+ Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
#ifndef PROBES_MYSQL_H
#define PROBES_MYSQL_H
diff --git a/include/rijndael.h b/include/rijndael.h
index 71df1c48dbf..474b3250dcb 100644
--- a/include/rijndael.h
+++ b/include/rijndael.h
@@ -1,7 +1,8 @@
#ifndef RIJNDAEL_INCLUDED
#define RIJNDAEL_INCLUDED
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/include/service_versions.h b/include/service_versions.h
index 135243593f9..ee50d4856e9 100644
--- a/include/service_versions.h
+++ b/include/service_versions.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef _WIN32
#define SERVICE_VERSION __declspec(dllexport) void *
diff --git a/include/sha1.h b/include/sha1.h
index d60d5e17c60..c3469333c27 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -1,7 +1,8 @@
#ifndef SHA1_INCLUDED
#define SHA1_INCLUDED
-/* Copyright (C) 2002, 2006 MySQL AB
+/* Copyright (c) 2002, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/sha2.h b/include/sha2.h
index e67a4100ff2..737658e9ced 100644
--- a/include/sha2.h
+++ b/include/sha2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef included_sha2_h
#define included_sha2_h
diff --git a/include/sql_common.h b/include/sql_common.h
index 2ea6c05d717..875d5d5361f 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -1,6 +1,7 @@
#ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED
-/* Copyright (C) 2003-2004, 2006 MySQL AB
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef __cplusplus
extern "C" {
diff --git a/include/sslopt-case.h b/include/sslopt-case.h
index 3b64a225fe2..2da5ff317e1 100644
--- a/include/sslopt-case.h
+++ b/include/sslopt-case.h
@@ -1,7 +1,7 @@
#ifndef SSLOPT_CASE_INCLUDED
#define SSLOPT_CASE_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
case OPT_SSL_KEY:
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index 5315b2e12b1..db99d1dfa26 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -1,7 +1,7 @@
#ifndef SSLOPT_LONGOPTS_INCLUDED
#define SSLOPT_LONGOPTS_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
diff --git a/include/sslopt-vars.h b/include/sslopt-vars.h
index d0eec3b6d74..01093feceaf 100644
--- a/include/sslopt-vars.h
+++ b/include/sslopt-vars.h
@@ -1,7 +1,7 @@
#ifndef SSLOPT_VARS_INCLUDED
#define SSLOPT_VARS_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
#ifdef SSL_VARS_NOT_STATIC
diff --git a/include/thr_alarm.h b/include/thr_alarm.h
index 15df74c1588..f4823b618f7 100644
--- a/include/thr_alarm.h
+++ b/include/thr_alarm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Prototypes when using thr_alarm library functions */
diff --git a/include/thr_lock.h b/include/thr_lock.h
index a744fab8aec..3f7a5ca988f 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* For use with thr_lock:s */
diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h
index b4a2828f4a8..26c2bb2b097 100644
--- a/include/welcome_copyright_notice.h
+++ b/include/welcome_copyright_notice.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _welcome_copyright_notice_h_
#define _welcome_copyright_notice_h_
@@ -21,7 +21,7 @@
program on start, or on help screen.
*/
#define ORACLE_WELCOME_COPYRIGHT_NOTICE(years) \
- "Copyright (c) " years ", Oracle and/or its affiliates. All rights reserved.\n" \
+ "Copyright (c) " years ", Oracle and/or its affiliates.\n" \
"2009-2011 Monty Program Ab\n" \
"\n" \
"This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n" \
diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h
index c5a08ce1fcc..ecc9a7773ca 100644
--- a/libmysql/client_settings.h
+++ b/libmysql/client_settings.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2005 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef CLIENT_SETTINGS_INCLUDED
#define CLIENT_SETTINGS_INCLUDED
@@ -22,6 +22,11 @@
extern uint mysql_port;
extern char * mysql_unix_port;
+/*
+ Note: CLIENT_CAPABILITIES is also defined in sql/client_settings.h.
+ When adding capabilities here, consider if they should be also added to
+ the server's version.
+*/
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
CLIENT_LONG_FLAG | \
CLIENT_TRANSACTIONS | \
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index a2d066b1eba..498ba6e9829 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Error messages for MySQL clients */
/* (Error messages for the daemon are in share/language/errmsg.sys) */
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index 455b4b3c8f1..55b7bf41cee 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
** Ask for a password from tty
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 36e6a80f2b2..1294bb0062b 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <my_sys.h>
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index 245dcb7f538..d263e5d5fe8 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "my_global.h" // HAVE_*
diff --git a/libmysqld/emb_qcache.h b/libmysqld/emb_qcache.h
index 71e5cdd6dac..8fd166df88d 100644
--- a/libmysqld/emb_qcache.h
+++ b/libmysqld/emb_qcache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005 MySQL AB
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_cache.h" /* Query_cache_block */
diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h
index c246693594b..c096954a460 100644
--- a/libmysqld/embedded_priv.h
+++ b/libmysqld/embedded_priv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2004, 2006 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Prototypes for the embedded version of MySQL */
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index a9495922f77..8d76698117a 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -23,9 +23,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT)
-# We never use "mysql_embedded", is more of a linktest, so we don't
-# use MYSQL_ADD_EXECUTABLE as that would install it and package it
-ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
+MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc)
TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver)
IF(UNIX)
diff --git a/libmysqld/examples/builder-sample/emb_sample.bpr b/libmysqld/examples/builder-sample/emb_sample.bpr
index 07b39a6832b..100e5b98dfd 100644
--- a/libmysqld/examples/builder-sample/emb_sample.bpr
+++ b/libmysqld/examples/builder-sample/emb_sample.bpr
@@ -1,3 +1,19 @@
+# Copyright (c) 2002 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
diff --git a/libmysqld/examples/builder-sample/emb_sample.cpp b/libmysqld/examples/builder-sample/emb_sample.cpp
index 5ad3bd69319..0c8f4fa0598 100644
--- a/libmysqld/examples/builder-sample/emb_sample.cpp
+++ b/libmysqld/examples/builder-sample/emb_sample.cpp
@@ -1,3 +1,19 @@
+// Copyright (c) 2002 MySQL AB
+// Use is subject to license terms.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
diff --git a/libmysqld/examples/builder-sample/emb_samples.cpp b/libmysqld/examples/builder-sample/emb_samples.cpp
index be3f1931af5..aab1385f6e6 100644
--- a/libmysqld/examples/builder-sample/emb_samples.cpp
+++ b/libmysqld/examples/builder-sample/emb_samples.cpp
@@ -1,3 +1,19 @@
+// Copyright (c) 2002, 2004, 2007 MySQL AB
+// Use is subject to license terms.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
diff --git a/libmysqld/examples/builder-sample/emb_samples.h b/libmysqld/examples/builder-sample/emb_samples.h
index 0562bc783cd..3024e75d533 100644
--- a/libmysqld/examples/builder-sample/emb_samples.h
+++ b/libmysqld/examples/builder-sample/emb_samples.h
@@ -1,3 +1,19 @@
+// Copyright (c) 2002 MySQL AB
+// Use is subject to license terms.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
//---------------------------------------------------------------------------
#ifndef emb_samplesH
#define emb_samplesH
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index f35e3cc9552..1ba54350883 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -1149,8 +1149,7 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
const char *sqlstate)
{
uint error;
- uchar converted_err[MYSQL_ERRMSG_SIZE];
- uint32 converted_err_len;
+ char converted_err[MYSQL_ERRMSG_SIZE];
MYSQL_DATA *data= thd->cur_data;
struct embedded_query_result *ei;
@@ -1165,12 +1164,12 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
ei= data->embedded_info;
ei->last_errno= sql_errno;
- converted_err_len= convert_error_message((char*)converted_err,
- sizeof(converted_err),
- thd->variables.character_set_results,
- err, strlen(err),
- system_charset_info, &error);
- strmake(ei->info, (const char*) converted_err, sizeof(ei->info)-1);
+ convert_error_message(converted_err, sizeof(converted_err),
+ thd->variables.character_set_results,
+ err, strlen(err),
+ system_charset_info, &error);
+ /* Converted error message is always null-terminated. */
+ strmake(ei->info, converted_err, sizeof(ei->info)-1);
strmov(ei->sqlstate, sqlstate);
ei->server_status= thd->server_status;
thd->cur_data= 0;
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index e875ff76201..36728cf573c 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <mysql.h>
diff --git a/libservices/HOWTO b/libservices/HOWTO
index b4960cb11dc..7edafa89268 100644
--- a/libservices/HOWTO
+++ b/libservices/HOWTO
@@ -1,3 +1,5 @@
+Copyright (c) 2009 Sun Microsystems, Inc.
+
How to create a new service
^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/libservices/my_snprintf_service.c b/libservices/my_snprintf_service.c
index 40d778e4b8d..8ac507394b0 100644
--- a/libservices/my_snprintf_service.c
+++ b/libservices/my_snprintf_service.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <service_versions.h>
SERVICE_VERSION my_snprintf_service= (void*)VERSION_my_snprintf;
diff --git a/libservices/my_thread_scheduler_service.c b/libservices/my_thread_scheduler_service.c
index dc8d40c6713..0bbad39dd0a 100644
--- a/libservices/my_thread_scheduler_service.c
+++ b/libservices/my_thread_scheduler_service.c
@@ -1,19 +1,18 @@
/*
- Copyright (C) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <service_versions.h>
diff --git a/libservices/thd_alloc_service.c b/libservices/thd_alloc_service.c
index 5d4d496774c..65e3fc490c8 100644
--- a/libservices/thd_alloc_service.c
+++ b/libservices/thd_alloc_service.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <service_versions.h>
SERVICE_VERSION *thd_alloc_service= (void*)VERSION_thd_alloc;
diff --git a/libservices/thd_wait_service.c b/libservices/thd_wait_service.c
index 3c87a2d0d1b..8cec4eecf77 100644
--- a/libservices/thd_wait_service.c
+++ b/libservices/thd_wait_service.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <service_versions.h>
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index f18b2ae341c..954e9c44311 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -132,3 +132,26 @@ ADD_CUSTOM_TARGET(test-bt-debug
COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
)
+# Process .in files with includes in collections/
+
+MACRO(PROCESS_COLLECTION_INCLUDE collin collection)
+ FILE(STRINGS ${collin} inlines)
+ FOREACH(line ${inlines})
+ IF(${line} MATCHES "#include .*")
+ STRING(REPLACE "#include " "collections/" incfile ${line})
+ FILE(READ ${incfile} contents)
+ FILE(APPEND ${collection} "${contents}")
+ ELSE()
+ FILE(APPEND ${collection} "${line}\n")
+ ENDIF()
+ ENDFOREACH()
+ENDMACRO()
+
+FILE(GLOB infiles "collections/*.in")
+FOREACH(collin ${infiles})
+ STRING(REPLACE ".in" "" collection ${collin})
+ # Only generate file once
+ IF(NOT EXISTS ${collection})
+ PROCESS_COLLECTION_INCLUDE(${collin} ${collection})
+ ENDIF()
+ENDFOREACH()
diff --git a/mysql-test/collections/README b/mysql-test/collections/README
index 9af84646a40..f64c089ee99 100644
--- a/mysql-test/collections/README
+++ b/mysql-test/collections/README
@@ -28,3 +28,11 @@ these steps:
5) The commands from the collection are run line by line via execv() or
similar system calls. They are not run as a shell script. Shell
expansions are not guaranteed to work and most likely won't.
+
+The directory may contain collections that are "super sets" of others,
+identified by a file name suffix ".in". These files may contain lines
+"#include <filename>", or lines with mysql-test-run.pl invocations.
+CMake will create a new file without the .in suffix where
+the include lines are replaced with the contents of the referred
+file. Filename is local to the collections directory, and includes do
+not nest.
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 6ef1a377b6c..b3623402065 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -8,16 +8,15 @@ funcs_1.charset_collation_1 # depends on compile-time decisions
main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
main.lock_multi_bug38499 # Bug#11755645 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.outfile_loaddata @solaris # Bug#11755168 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
-main.signal_demo3 @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
-main.sp @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
+main.signal_demo3 @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
+main.sp @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_timeout fails on OpenSolaris
-rpl.rpl_innodb_bug28430 # Bug#11754425
-rpl.rpl_bug37426 # WL#5867: skozlov: test case moved from unused bugs suite
rpl.rpl_heartbeat_basic # BUG#12403008 2011-04-27 sven fails sporadically
-rpl.rpl_show_slave_hosts # BUG#12416700 2011-05-02 sven fails sporadically
+rpl.rpl_innodb_bug28430 # Bug#11754425
+rpl.rpl_row_sp011 @solaris # Bug#11753919 2011-07-25 sven Several test cases fail on Solaris with error Thread stack overrun
-sys_vars.max_sp_recursion_depth_func @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
+sys_vars.max_sp_recursion_depth_func @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wait_timeout_func fails
# BUG #59055 : All ndb tests should be removed from the repository
diff --git a/mysql-test/collections/default.release b/mysql-test/collections/default.release.in
index 108e1032ca2..0e3ad30671b 100644
--- a/mysql-test/collections/default.release
+++ b/mysql-test/collections/default.release.in
@@ -1,3 +1,9 @@
+# This file contains the old default.release, the plan is to replace that
+# with something like the below (remove space after #):
+
+# include default.daily
+# include default.weekly
+
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-ndbcluster --skip-rpl --report-features --debug-server
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --skip-ndbcluster --report-features
perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --skip-ndbcluster --ps-protocol
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_duplicate.test b/mysql-test/extra/rpl_tests/rpl_insert_duplicate.test
deleted file mode 100644
index a81eeba3231..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_insert_duplicate.test
+++ /dev/null
@@ -1,59 +0,0 @@
-# BUG#59338 Inconsistency in binlog for statements that don't change any rows STATEMENT SBR
-# In SBR, if a statement does not fail, it is always written to the binary log,
-# regardless if rows are changed or not. If there is a failure, a statement is
-# only written to the binary log if a non-transactional (.e.g. MyIsam) engine
-# is updated. INSERT ON DUPLICATE KEY UPDATE was not following the rule above
-# and was not written to the binary log, if then engine was Innodb.
-#
-# In this test case, we check if INSERT ON DUPLICATE KEY UPDATE that does not
-# change anything is still written to the binary log.
-
-# Prepare environment
---connection master
-
-eval CREATE TABLE t1 (
- a INT UNSIGNED NOT NULL PRIMARY KEY
-) ENGINE=$engine_type;
-
-eval CREATE TABLE t2 (
- a INT UNSIGNED
-) ENGINE=$engine_type;
-
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-
-# An insert duplicate that does not update anything must be written to the binary
-# log in SBR and MIXED modes. We check this property by summing a before and after
-# the update and comparing the binlog positions. The sum should be the same at both
-# points and the statement should be in the binary log.
---let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
---let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
---let $statement_file=INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a
---eval $statement_file
-
---let $assert_cond= SUM(a) = 1 FROM t1
---let $assert_text= Sum of elements in t1 should be 1.
---source include/assert.inc
-
-if (`SELECT @@BINLOG_FORMAT = 'ROW'`)
-{
- --let $binlog_position_cmp= =
- --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
- --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
-}
-if (`SELECT @@BINLOG_FORMAT != 'ROW'`)
-{
- --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 1, 1\', Info, 1]\' LIKE \'%$statement_file\'
- --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
-}
---source include/assert.inc
-
-# Compare master and slave
---sync_slave_with_master
---let $diff_tables= master:test.t1 , slave:test.t1
---source include/diff_tables.inc
-
-# Clean up
---connection master
-drop table t1, t2;
---sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test
index 565ab4a67ad..32d861bd45a 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test
@@ -77,6 +77,7 @@ eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
insert into t1 values (10);
insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
+--disable_warnings ONCE
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
sync_slave_with_master;
@@ -113,8 +114,10 @@ set @@session.sql_auto_is_null=1;
eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
eval create table t2(a int) engine=$engine_type;
insert into t1 (a) values (null);
+--disable_warnings
insert into t2 (a) select a from t1 where a is null;
insert into t2 (a) select a from t1 where a is null;
+--enable_warnings
select * from t2;
sync_slave_with_master;
connection slave;
@@ -172,17 +175,15 @@ begin
end|
delimiter ;|
---disable_warnings
+--disable_warnings ONCE
insert into t1 (last_id) values (0);
---enable_warnings
drop trigger t1_bi;
# Check that nested call doesn't affect outer context.
select last_insert_id();
---disable_warnings
+--disable_warnings ONCE
select bug15728_insert();
---enable_warnings
select last_insert_id();
insert into t1 (last_id) values (bug15728());
# This should be exactly one greater than in the previous call.
@@ -190,9 +191,8 @@ select last_insert_id();
# BUG#20339 - stored procedure using LAST_INSERT_ID() does not
# replicate statement-based
---disable_warnings
+--disable_warnings ONCE
drop procedure if exists foo;
---enable_warnings
delimiter |;
create procedure foo()
begin
@@ -252,6 +252,7 @@ select * from t1 order by n;
# table's counter, the counter for next row is bigger than the
# after-value of the updated row.
connection master;
+--disable_warnings ONCE
insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000;
select * from t1 order by n;
sync_slave_with_master;
@@ -270,6 +271,7 @@ delete from t1 where b <> 100;
select * from t1 order by n;
connection master;
+--disable_warnings ONCE
insert into t1 values(null,100),(null,350) on duplicate key update n=2;
select * from t1 order by n;
sync_slave_with_master;
@@ -287,6 +289,7 @@ connection master;
# testcase with INSERT VALUES
eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b)) ENGINE=$engine_type;
+--disable_warnings ONCE
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
@@ -314,19 +317,23 @@ INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
# Updating table t1 based on values from table t2
+--disable_warnings
INSERT INTO t1 (field_1, field_2, field_3)
SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
+--enable_warnings
# Inserting new record into t2
INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
# Updating t1 again
+--disable_warnings
INSERT INTO t1 (field_1, field_2, field_3)
SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
+--enable_warnings
SELECT * FROM t1 ORDER BY id;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY id;
@@ -433,9 +440,8 @@ delimiter ;|
INSERT INTO t1 VALUES (NULL, -1);
CALL p1();
---disable_warnings
+--disable_warnings ONCE
SELECT f1();
---enable_warnings
INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
(NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
INSERT INTO t1 VALUES (NULL, f2());
@@ -504,16 +510,14 @@ insert into t2 (id) values(1),(2),(3);
delete from t2;
set sql_log_bin=1;
#inside SELECT, then inside INSERT
---disable_warnings
+--disable_warnings ONCE
select insid();
---enable_warnings
set sql_log_bin=0;
insert into t2 (id) values(5),(6),(7);
delete from t2 where id>=5;
set sql_log_bin=1;
---disable_warnings
+--disable_warnings ONCE
insert into t1 select insid();
---enable_warnings
select * from t1 order by id;
select * from t2 order by id;
@@ -537,6 +541,7 @@ begin
insert into t2 values(null,3);
end|
delimiter ;|
+--disable_warnings ONCE
call foo();
select * from t1 order by n;
select * from t2 order by id;
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
index 270dde7675c..f422ef35f8c 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
@@ -31,7 +31,7 @@ INSERT INTO t2 VALUES (3, 5);
INSERT INTO t2 VALUES (4, 3);
INSERT INTO t2 VALUES (5, 4);
INSERT INTO t2 VALUES (6, 6);
-
+--disable_warnings ONCE
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
--let $assert_cond= COUNT(*) = 6 FROM t1
--let $assert_text= Count of elements in t1 should be 6.
@@ -51,25 +51,70 @@ INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
--let $statement_file=INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a
+--disable_warnings ONCE
--eval $statement_file
--let $assert_cond= COUNT(*) = 6 FROM t1
--let $assert_text= Count of elements in t1 should be 6.
--source include/assert.inc
-if (`SELECT @@BINLOG_FORMAT = 'ROW'`)
+if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`)
{
--let $binlog_position_cmp= =
--let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
--let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
}
-if (`SELECT @@BINLOG_FORMAT != 'ROW'`)
+if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`)
{
--let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 2, 1\', Info, 1]\' LIKE \'%$statement_file\'
--let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
}
+
+--source include/assert.inc
+
+# An insert duplicate that does not update anything must be written to the binary
+# log in SBR and MIXED modes. We check this property by summing a before and after
+# the update and comparing the binlog positions. The sum should be the same at both
+# points and the statement should be in the binary log.
+--disable_warnings
+DROP TABLE t1;
+DROP TABLE t2;
+--enable_warnings
+eval CREATE TABLE t1 (
+ a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a INT UNSIGNED
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
+--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
+--let $statement_file=INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a
+--disable_warnings ONCE
+--eval $statement_file
+
+--let $assert_cond= SUM(a) = 1 FROM t1
+--let $assert_text= Sum of elements in t1 should be 1.
+--source include/assert.inc
+
+if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`)
+{
+ --let $binlog_position_cmp= =
+ --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`)
+{
+ --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 1, 1\', Info, 1]\' LIKE \'%$statement_file\'
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
--source include/assert.inc
+
# Clean up
--connection master
drop table t1, t2;
diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
index 89a9a4e8e3b..17d949a7790 100644
--- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
@@ -80,5 +80,31 @@ reset slave;
source include/check_slave_no_error.inc;
change master to master_user='root';
---let $rpl_only_running_threads= 1
+
+#
+# BUG#11809016 - NO WAY TO DISCOVER AN INSTANCE IS NO LONGER A SLAVE FOLLOWING MYSQL BUG#28796
+#
+
+reset slave;
+--source include/start_slave.inc
+
+--source include/stop_slave.inc
+--let $_slave_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
+--let $_slave_master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
+--let $_slave_master_port= query_get_value(SHOW SLAVE STATUS, Master_Port, 1)
+
+reset slave all;
+--error ER_BAD_SLAVE
+start slave;
+
+--let $_show_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
+if ($_show_master_host != No such row)
+{
+ die;
+}
+
+--replace_result $_slave_master_host MASTER_HOST $_slave_master_user MASTER_USER $_slave_master_port MASTER_PORT
+--eval CHANGE MASTER TO MASTER_HOST= '$_slave_master_host', MASTER_USER= '$_slave_master_user', MASTER_PORT= $_slave_master_port
+--source include/start_slave.inc
+
--source include/rpl_end.inc
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index 9df1571a849..fdb9ef1f563 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -521,10 +521,34 @@ commit;
call p_verify_status_increment(2, 2, 2, 2);
--echo # 15. Read-write statement: UPDATE IGNORE, change 0 rows.
--echo #
+--disable_warnings
update ignore t1 set a=2 where a=1;
-call p_verify_status_increment(2, 2, 1, 0);
-commit;
-call p_verify_status_increment(2, 2, 1, 0);
+--enable_warnings
+if (`select @@binlog_format = 'STATEMENT'`)
+{
+ --disable_query_log
+ call p_verify_status_increment(2, 2, 1, 0);
+ --enable_query_log
+}
+if (`select @@binlog_format != 'STATEMENT'`)
+{
+ --disable_query_log
+ call p_verify_status_increment(1, 0, 1, 0);
+ --enable_query_log
+}
+commit;
+if (`select @@binlog_format = 'STATEMENT'`)
+{
+ --disable_query_log
+ call p_verify_status_increment(2, 2, 1, 0);
+ --enable_query_log
+}
+if (`select @@binlog_format != 'STATEMENT'`)
+{
+ --disable_query_log
+ call p_verify_status_increment(1, 0, 1, 0);
+ --enable_query_log
+}
--echo #
--echo # Create a stored function that modifies a
--echo # non-transactional table. Demonstrate that changes in
@@ -603,7 +627,9 @@ call p_verify_status_increment(2, 0, 1, 0);
--echo # 21. Read-write statement: UPDATE, change 0 (transactional) rows.
--echo #
+--disable_warnings
update t1 set a=2 where a=f1()+10;
+--enable_warnings
call p_verify_status_increment(2, 0, 1, 0);
commit;
call p_verify_status_increment(2, 0, 1, 0);
@@ -703,7 +729,9 @@ call p_verify_status_increment(4, 4, 4, 4);
--echo #
insert into t2 select a from t1;
commit;
+--disable_warnings
replace into t2 select a from t1;
+--enable_warnings
commit;
call p_verify_status_increment(8, 8, 8, 8);
#
diff --git a/mysql-test/include/daemon_example_bad_format.ini b/mysql-test/include/daemon_example_bad_format.ini
new file mode 100644
index 00000000000..8f880ef0ba0
--- /dev/null
+++ b/mysql-test/include/daemon_example_bad_format.ini
@@ -0,0 +1,8 @@
+#
+# Plugin configuration file. Place the following on a separate line:
+#
+# library binary file name (without .so or .dll)
+# component_name
+# [component_name] - additional components in plugin
+#
+libdaemon_example
diff --git a/mysql-test/include/daemon_example_bad_soname.ini b/mysql-test/include/daemon_example_bad_soname.ini
new file mode 100644
index 00000000000..5f42b5a6214
--- /dev/null
+++ b/mysql-test/include/daemon_example_bad_soname.ini
@@ -0,0 +1,9 @@
+#
+# Plugin configuration file. Place the following on a separate line:
+#
+# library binary file name (without .so or .dll)
+# component_name
+# [component_name] - additional components in plugin
+#
+libdaemon_BADNAME
+daemon_BADNAME
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
index a4f3b14fd54..ef7e9f60dd7 100644
--- a/mysql-test/include/default_my.cnf
+++ b/mysql-test/include/default_my.cnf
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Use default setting for mysqld processes
!include default_mysqld.cnf
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 3a8c4c100f2..26587d885c1 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Default values that applies to all MySQL Servers
[mysqld]
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index fcd5eebc269..c9708f988de 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -1,3 +1,18 @@
+-- Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; version 2 of the License.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software Foundation,
+-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
delimiter ||;
use mtr||
@@ -12,11 +27,9 @@ BEGIN
-- Dump all global variables except those
-- that are supposed to change
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE variable_name != 'timestamp'
+ WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max')
AND variable_name not like "Last_IO_Err*"
- AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND
- variable_name != 'INNODB_FILE_FORMAT_CHECK'
- ORDER BY variable_name;
+ ORDER BY VARIABLE_NAME;
-- Dump all databases, there should be none
-- except those that was created during bootstrap
@@ -61,3 +74,13 @@ BEGIN
mysql.user;
END||
+
+--
+-- Procedure used by test case used to force all
+-- servers to restart after testcase and thus skipping
+-- check test case after test
+--
+CREATE DEFINER=root@localhost PROCEDURE force_restart()
+BEGIN
+ SELECT 1 INTO OUTFILE 'force_restart';
+END||
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 57cd04d81a1..ce1563fc993 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -1,3 +1,18 @@
+-- Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; version 2 of the License.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software Foundation,
+-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
delimiter ||;
use mtr||
diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc
index 3b8fdd482fc..84a6c8091a9 100644
--- a/mysql-test/include/mysqld--help.inc
+++ b/mysql-test/include/mysqld--help.inc
@@ -26,7 +26,7 @@ perl;
# And substitute the content some environment variables with their
# names:
- @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR/;
+ @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR/;
$re1=join('|', @skipvars, @plugins);
$re2=join('|', @plugins);
diff --git a/mysql-test/include/plugin.defs b/mysql-test/include/plugin.defs
index e07c603c8e5..6fbe4f68328 100644
--- a/mysql-test/include/plugin.defs
+++ b/mysql-test/include/plugin.defs
@@ -39,3 +39,4 @@ ha_archive storage/archive ARCHIVE_PLUGIN
ha_blackhole storage/blackhole BLACKHOLE_PLUGIN
ha_federated storage/federated FEDERATED_PLUGIN
mypluglib plugin/fulltext SIMPLE_PARSER
+libdaemon_example plugin/daemon_example DAEMONEXAMPLE
diff --git a/mysql-test/include/set_binlog_format_mixed.sql b/mysql-test/include/set_binlog_format_mixed.sql
index 836992d1080..65c779ef141 100644
--- a/mysql-test/include/set_binlog_format_mixed.sql
+++ b/mysql-test/include/set_binlog_format_mixed.sql
@@ -1,2 +1,18 @@
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
SET GLOBAL BINLOG_FORMAT=MIXED;
SET SESSION BINLOG_FORMAT=MIXED;
diff --git a/mysql-test/include/set_binlog_format_row.sql b/mysql-test/include/set_binlog_format_row.sql
index 49f34c8ccd1..0400ed48be9 100644
--- a/mysql-test/include/set_binlog_format_row.sql
+++ b/mysql-test/include/set_binlog_format_row.sql
@@ -1,2 +1,18 @@
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
SET GLOBAL BINLOG_FORMAT=ROW;
SET SESSION BINLOG_FORMAT=ROW;
diff --git a/mysql-test/include/set_binlog_format_statement.sql b/mysql-test/include/set_binlog_format_statement.sql
index ed286e7e3cc..b582230e648 100644
--- a/mysql-test/include/set_binlog_format_statement.sql
+++ b/mysql-test/include/set_binlog_format_statement.sql
@@ -1,2 +1,18 @@
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
SET GLOBAL BINLOG_FORMAT=STATEMENT;
SET SESSION BINLOG_FORMAT=STATEMENT;
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm
index bf6629754a1..23f29b53ff3 100644
--- a/mysql-test/lib/My/Config.pm
+++ b/mysql-test/lib/My/Config.pm
@@ -1,5 +1,20 @@
# -*- cperl -*-
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
package My::Config::Option;
use strict;
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index 02fd556a047..1bc9977cf4a 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm
index b0c4a1337d8..419a0e7f39f 100644
--- a/mysql-test/lib/My/CoreDump.pm
+++ b/mysql-test/lib/My/CoreDump.pm
@@ -81,7 +81,7 @@ sub _gdb {
return if $? >> 8;
return unless $gdb_output;
- resfile_print <<EOF, $gdb_output, "\n";
+ resfile_print <<EOF . $gdb_output . "\n";
Output from gdb follows. The first stack trace is from the failing thread.
The following stack traces are from all threads (so the failing one is
duplicated).
@@ -245,7 +245,7 @@ sub _cdb {
$cdb_output=~ s/^Child\-SP RetAddr Call Site//gm;
$cdb_output=~ s/\+0x([0-9a-fA-F]+)//gm;
- resfile_print <<EOF, $cdb_output, "\n";
+ resfile_print <<EOF . $cdb_output . "\n";
Output from cdb follows. Faulting thread is printed twice,with and without function parameters
Search for STACK_TEXT to see the stack trace of
the faulting thread. Callstacks of other threads are printed after it.
diff --git a/mysql-test/lib/My/File/Path.pm b/mysql-test/lib/My/File/Path.pm
index 14fb43e8d98..1b7982d6b36 100644
--- a/mysql-test/lib/My/File/Path.pm
+++ b/mysql-test/lib/My/File/Path.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm
index ec937eb90b4..bd153becaf7 100644
--- a/mysql-test/lib/My/Find.pm
+++ b/mysql-test/lib/My/Find.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2004, 2011, Oracle and/or its affiliates.
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/Handles.pm b/mysql-test/lib/My/Handles.pm
index 66ee22b403f..d120eb7b1d4 100644
--- a/mysql-test/lib/My/Handles.pm
+++ b/mysql-test/lib/My/Handles.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm
index dcd934084e2..55d1010aad8 100644
--- a/mysql-test/lib/My/Options.pm
+++ b/mysql-test/lib/My/Options.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm
index cbe8f929d71..483bf0bd4f3 100644
--- a/mysql-test/lib/My/Platform.pm
+++ b/mysql-test/lib/My/Platform.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index 1f00065fae2..e7917f8fb16 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2008, 2011, Oracle and/or its affiliates.
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates.
# Copyright (c) 2009, 2011 Monty Program Ab
#
# This program is free software; you can redistribute it and/or
diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm
index c0c70e48082..0e8c191c440 100644
--- a/mysql-test/lib/My/SafeProcess/Base.pm
+++ b/mysql-test/lib/My/SafeProcess/Base.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
index 72fe874e621..2ac29c61bc7 100644
--- a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.pl b/mysql-test/lib/My/SafeProcess/safe_process.pl
index 54b0073f8df..1b3c0aa9a5f 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.pl
+++ b/mysql-test/lib/My/SafeProcess/safe_process.pl
@@ -1,6 +1,21 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use warnings;
diff --git a/mysql-test/lib/My/SafeProcess/safe_process_win.cc b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
index 7e0ae68b4de..87a14481e25 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process_win.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
index b8569e415e8..28660f44bae 100644
--- a/mysql-test/lib/My/SysInfo.pm
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2008 MySQL AB
+# Copyright (c) 2008 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index bf85bd91047..2d8f111f054 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -339,17 +339,41 @@ sub collect_one_suite
for my $skip (@disabled_collection)
{
if ( open(DISABLED, $skip ) )
- {
- while ( <DISABLED> )
- {
- chomp;
- if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
- {
- $disabled{$1}= $2 if not exists $disabled{$1};
- }
- }
- close DISABLED;
- }
+ {
+ # $^O on Windows considered not generic enough
+ my $plat= (IS_WINDOWS) ? 'windows' : $^O;
+
+ while ( <DISABLED> )
+ {
+ chomp;
+ #diasble the test case if platform matches
+ if ( /\@/ )
+ {
+ if ( /\@$plat/ )
+ {
+ /^\s*(\S+)\s*\@$plat.*:\s*(.*?)\s*$/ ;
+ $disabled{$1}= $2 if not exists $disabled{$1};
+ }
+ elsif ( /\@!(\S*)/ )
+ {
+ if ( $1 ne $plat)
+ {
+ /^\s*(\S+)\s*\@!.*:\s*(.*?)\s*$/ ;
+ $disabled{$1}= $2 if not exists $disabled{$1};
+ }
+ }
+ }
+ elsif ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
+ {
+ chomp;
+ if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
+ {
+ $disabled{$1}= $2 if not exists $disabled{$1};
+ }
+ }
+ }
+ close DISABLED;
+ }
}
# Read suite.opt file
diff --git a/mysql-test/lib/mtr_gprof.pl b/mysql-test/lib/mtr_gprof.pl
index a5e05b28723..15aad17a3d4 100644
--- a/mysql-test/lib/mtr_gprof.pl
+++ b/mysql-test/lib/mtr_gprof.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl
index 6a6b3a3d028..8c2803f0427 100644
--- a/mysql-test/lib/mtr_io.pl
+++ b/mysql-test/lib/mtr_io.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2007 MySQL AB, 2008 Sun Microsystems, Inc.
+# Copyright (c) 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl
index ab4214791d0..6ab607e6439 100644
--- a/mysql-test/lib/mtr_stress.pl
+++ b/mysql-test/lib/mtr_stress.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_unique.pm b/mysql-test/lib/mtr_unique.pm
index 506af448266..8d719786283 100644
--- a/mysql-test/lib/mtr_unique.pm
+++ b/mysql-test/lib/mtr_unique.pm
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2006, 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/t/Base.t b/mysql-test/lib/t/Base.t
index 6ca7657d421..b540944f3a1 100644
--- a/mysql-test/lib/t/Base.t
+++ b/mysql-test/lib/t/Base.t
@@ -1,4 +1,21 @@
# -*- cperl -*-
+
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/Find.t b/mysql-test/lib/t/Find.t
index 90489ba06dd..d609fd86dd9 100644
--- a/mysql-test/lib/t/Find.t
+++ b/mysql-test/lib/t/Find.t
@@ -1,4 +1,21 @@
# -*- cperl -*-
+
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/Options.t b/mysql-test/lib/t/Options.t
index 3824c838627..c832b885cb7 100644
--- a/mysql-test/lib/t/Options.t
+++ b/mysql-test/lib/t/Options.t
@@ -1,5 +1,20 @@
-
# -*- cperl -*-
+
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/Platform.t b/mysql-test/lib/t/Platform.t
index a8cb7751925..c78c22ddb5a 100644
--- a/mysql-test/lib/t/Platform.t
+++ b/mysql-test/lib/t/Platform.t
@@ -1,4 +1,21 @@
# -*- cperl -*-
+
+# Copyright (c) 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use Test::More qw(no_plan);
use strict;
diff --git a/mysql-test/lib/t/SafeProcess.t b/mysql-test/lib/t/SafeProcess.t
index d4a62ff8cca..0fab69b9088 100644
--- a/mysql-test/lib/t/SafeProcess.t
+++ b/mysql-test/lib/t/SafeProcess.t
@@ -1,5 +1,21 @@
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use FindBin;
use IO::File;
diff --git a/mysql-test/lib/t/SafeProcessStress.pl b/mysql-test/lib/t/SafeProcessStress.pl
index 0f7a59d67f0..a5dbeecfb4b 100755
--- a/mysql-test/lib/t/SafeProcessStress.pl
+++ b/mysql-test/lib/t/SafeProcessStress.pl
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007, 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use FindBin;
use My::SafeProcess;
diff --git a/mysql-test/lib/t/copytree.t b/mysql-test/lib/t/copytree.t
index 15e4d1a7b1b..cdb99b851c4 100644
--- a/mysql-test/lib/t/copytree.t
+++ b/mysql-test/lib/t/copytree.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use My::File::Path;
diff --git a/mysql-test/lib/t/dummyd.pl b/mysql-test/lib/t/dummyd.pl
index 07336e3c2d2..fae747354d7 100644
--- a/mysql-test/lib/t/dummyd.pl
+++ b/mysql-test/lib/t/dummyd.pl
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use Getopt::Long;
use IO::File;
diff --git a/mysql-test/lib/t/rmtree.t b/mysql-test/lib/t/rmtree.t
index 08c9077d001..8c9863a1edd 100644
--- a/mysql-test/lib/t/rmtree.t
+++ b/mysql-test/lib/t/rmtree.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use My::File::Path;
diff --git a/mysql-test/lib/t/testMyConfig.t b/mysql-test/lib/t/testMyConfig.t
index da08cb8b4d1..f79e8776676 100755
--- a/mysql-test/lib/t/testMyConfig.t
+++ b/mysql-test/lib/t/testMyConfig.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use warnings;
use File::Temp qw / tempdir /;
diff --git a/mysql-test/lib/t/testMyConfigFactory.t b/mysql-test/lib/t/testMyConfigFactory.t
index e3ab5d54b5b..9f43bed3d98 100755
--- a/mysql-test/lib/t/testMyConfigFactory.t
+++ b/mysql-test/lib/t/testMyConfigFactory.t
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use warnings;
diff --git a/mysql-test/lib/t/test_child.pl b/mysql-test/lib/t/test_child.pl
index 99f4e68003d..38d9f906738 100755
--- a/mysql-test/lib/t/test_child.pl
+++ b/mysql-test/lib/t/test_child.pl
@@ -1,6 +1,22 @@
#!/usr/bin/perl
# -*- cperl -*-
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
use strict;
use Getopt::Long;
diff --git a/mysql-test/lib/v1/My/Config.pm b/mysql-test/lib/v1/My/Config.pm
index 5491e341ddc..cc4c34b2d62 100644
--- a/mysql-test/lib/v1/My/Config.pm
+++ b/mysql-test/lib/v1/My/Config.pm
@@ -1,5 +1,21 @@
# -*- cperl -*-
+# Copyright (c) 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
package My::Config::Option;
use strict;
diff --git a/mysql-test/lib/v1/mtr_cases.pl b/mysql-test/lib/v1/mtr_cases.pl
index 288e8c22b44..baeab24f519 100644
--- a/mysql-test/lib/v1/mtr_cases.pl
+++ b/mysql-test/lib/v1/mtr_cases.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2005-2006 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_gcov.pl b/mysql-test/lib/v1/mtr_gcov.pl
index a2de1fcbdff..56942be72a8 100644
--- a/mysql-test/lib/v1/mtr_gcov.pl
+++ b/mysql-test/lib/v1/mtr_gcov.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004, 2006 MySQL AB
+# Copyright (c) 2004, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_gprof.pl b/mysql-test/lib/v1/mtr_gprof.pl
index f6615301dd7..04c6eced28a 100644
--- a/mysql-test/lib/v1/mtr_gprof.pl
+++ b/mysql-test/lib/v1/mtr_gprof.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004 MySQL AB
+# Copyright (c) 2004 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_im.pl b/mysql-test/lib/v1/mtr_im.pl
index c8e332498d7..c34acc9c82f 100644
--- a/mysql-test/lib/v1/mtr_im.pl
+++ b/mysql-test/lib/v1/mtr_im.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_io.pl b/mysql-test/lib/v1/mtr_io.pl
index 952b8f1f4ba..5769240bf7f 100644
--- a/mysql-test/lib/v1/mtr_io.pl
+++ b/mysql-test/lib/v1/mtr_io.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_match.pl b/mysql-test/lib/v1/mtr_match.pl
index 96aa43f4fa2..5cc74efb8c9 100644
--- a/mysql-test/lib/v1/mtr_match.pl
+++ b/mysql-test/lib/v1/mtr_match.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_misc.pl b/mysql-test/lib/v1/mtr_misc.pl
index da2395a8a95..07b50e865ab 100644
--- a/mysql-test/lib/v1/mtr_misc.pl
+++ b/mysql-test/lib/v1/mtr_misc.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_process.pl b/mysql-test/lib/v1/mtr_process.pl
index 33a39d1f0b6..f86f9e5dec0 100644
--- a/mysql-test/lib/v1/mtr_process.pl
+++ b/mysql-test/lib/v1/mtr_process.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004-2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl
index dde093ff674..7166eb523f2 100644
--- a/mysql-test/lib/v1/mtr_report.pl
+++ b/mysql-test/lib/v1/mtr_report.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_stress.pl b/mysql-test/lib/v1/mtr_stress.pl
index 40800c9729b..7f92c417271 100644
--- a/mysql-test/lib/v1/mtr_stress.pl
+++ b/mysql-test/lib/v1/mtr_stress.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_timer.pl b/mysql-test/lib/v1/mtr_timer.pl
index 326fbea74ec..4fc68afa364 100644
--- a/mysql-test/lib/v1/mtr_timer.pl
+++ b/mysql-test/lib/v1/mtr_timer.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2005-2006 MySQL AB
+# Copyright (c) 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mtr_unique.pl b/mysql-test/lib/v1/mtr_unique.pl
index a668fc097c7..4e4e720e689 100644
--- a/mysql-test/lib/v1/mtr_unique.pl
+++ b/mysql-test/lib/v1/mtr_unique.pl
@@ -1,5 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006 MySQL AB, 2008 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index df91d887c23..b50cdb47a47 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -1,7 +1,21 @@
#!/usr/bin/perl
# -*- cperl -*-
-#
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
##############################################################################
#
# mysql-test-run.pl
diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl
index 143ea78e739..860be1c1251 100755
--- a/mysql-test/mysql-stress-test.pl
+++ b/mysql-test/mysql-stress-test.pl
@@ -222,9 +222,9 @@ GetOptions("server-host=s", "server-logs-dir=s", "server-port=s",
"test-duration=i", "test-suffix=s", "check-tests-file",
"verbose", "log-error-details", "cleanup", "mysqltest=s",
# OBN: (changing 'abort-on-error' to numberic for WL-4626/4685)
- "abort-on-error=i" => \$opt_abort_on_error, "help") || usage();
+ "abort-on-error=i" => \$opt_abort_on_error, "help") || usage(1);
-usage() if ($opt_help);
+usage(0) if ($opt_help);
#$opt_abort_on_error=1;
@@ -1115,6 +1115,7 @@ sub sig_TERM_handler
sub usage
{
+ my $retcode= shift;
print <<EOF;
The MySQL Stress suite Ver $stress_suite_version
@@ -1218,7 +1219,7 @@ perl mysql-stress-test.pl \
--cleanup \
EOF
-exit(0);
+exit($retcode);
}
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 6bbbceb6017..77bc0c42b71 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -186,9 +186,11 @@ my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
our $exe_mysql;
+our $exe_mysql_plugin;
our $exe_mysqladmin;
our $exe_mysqltest;
our $exe_libtool;
+our $exe_mysql_embedded;
our $opt_big_test= 0;
our $opt_staging_run= 0;
@@ -198,6 +200,8 @@ our @opt_combinations;
our @opt_extra_mysqld_opt;
our @opt_mysqld_envs;
+my $opt_stress;
+
my $opt_compress;
my $opt_ssl;
my $opt_skip_ssl;
@@ -237,10 +241,13 @@ our %gprof_dirs;
our $glob_debugger= 0;
our $opt_gdb;
our $opt_client_gdb;
+my $opt_boot_gdb;
our $opt_dbx;
our $opt_client_dbx;
+my $opt_boot_dbx;
our $opt_ddd;
our $opt_client_ddd;
+my $opt_boot_ddd;
our $opt_manual_gdb;
our $opt_manual_dbx;
our $opt_manual_ddd;
@@ -404,6 +411,7 @@ sub main {
}
}
}
+ mtr_report("Using suites: $opt_suites") unless @opt_cases;
print "vardir: $opt_vardir\n";
initialize_servers();
@@ -469,8 +477,8 @@ sub main {
}
$ENV{MTR_PARALLEL} = $opt_parallel;
- if ($opt_parallel > 1 && $opt_start_exit) {
- mtr_warning("Parallel and --start-and-exit cannot be combined\n" .
+ if ($opt_parallel > 1 && ($opt_start_exit || $opt_stress)) {
+ mtr_warning("Parallel cannot be used with --start-and-exit or --stress\n" .
"Setting parallel to 1");
$opt_parallel= 1;
}
@@ -693,8 +701,9 @@ sub run_test_server ($$$) {
my $core_file= $File::Find::name;
my $core_name= basename($core_file);
- if ($core_name =~ /^core/ or # Starting with core
- (IS_WINDOWS and $core_name =~ /\.dmp$/)){
+ # Name beginning with core, not ending in .gz
+ if (($core_name =~ /^core/ and $core_name !~ /\.gz$/)
+ or (IS_WINDOWS and $core_name =~ /\.dmp$/)){
# Ending with .dmp
mtr_report(" - found '$core_name'",
"($num_saved_cores/$opt_max_save_core)");
@@ -1167,14 +1176,17 @@ sub command_line_setup {
'gdb' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
+ 'boot-gdb' => \$opt_boot_gdb,
'manual-debug' => \$opt_manual_debug,
'ddd' => \$opt_ddd,
'client-ddd' => \$opt_client_ddd,
'manual-ddd' => \$opt_manual_ddd,
+ 'boot-ddd' => \$opt_boot_ddd,
'dbx' => \$opt_dbx,
'client-dbx' => \$opt_client_dbx,
'manual-dbx' => \$opt_manual_dbx,
'debugger=s' => \$opt_debugger,
+ 'boot-dbx' => \$opt_boot_dbx,
'client-debugger=s' => \$opt_client_debugger,
'strace' => \$opt_strace,
'strace-client:s' => \$opt_strace_client,
@@ -1247,6 +1259,7 @@ sub command_line_setup {
'default-myisam!' => \&collect_option,
'report-times' => \$opt_report_times,
'result-file' => \$opt_resfile,
+ 'stress=s' => \$opt_stress,
'help|h' => \$opt_usage,
# list-options is internal, not listed in help
@@ -1690,6 +1703,21 @@ sub command_line_setup {
}
# --------------------------------------------------------------------------
+ # Gather stress-test options and modify behavior
+ # --------------------------------------------------------------------------
+
+ if ($opt_stress)
+ {
+ $opt_stress=~ s/,/ /g;
+ $opt_user_args= 1;
+ mtr_error("--stress cannot be combined with named ordinary suites or tests")
+ if $opt_suites || @opt_cases;
+ $opt_suites="stress";
+ @opt_cases= ("wrapper");
+ $ENV{MST_OPTIONS}= $opt_stress;
+ }
+
+ # --------------------------------------------------------------------------
# Check timeout arguments
# --------------------------------------------------------------------------
@@ -2025,6 +2053,9 @@ sub executable_setup () {
# Look for the client binaries
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
+ $exe_mysql_plugin= mtr_exe_exists("$path_client_bindir/mysql_plugin");
+
+ $exe_mysql_embedded= mtr_exe_maybe_exists("$basedir/libmysqld/examples/mysql_embedded");
if ( ! $opt_skip_ndbcluster )
{
@@ -2243,8 +2274,10 @@ sub find_plugin($$)
my $lib_plugin=
mtr_file_exists(vs_config_dirs($location,$plugin_filename),
"$basedir/lib/plugin/".$plugin_filename,
+ "$basedir/lib64/plugin/".$plugin_filename,
"$basedir/$location/.libs/".$plugin_filename,
"$basedir/lib/mysql/plugin/".$plugin_filename,
+ "$basedir/lib64/mysql/plugin/".$plugin_filename,
);
return $lib_plugin;
}
@@ -2354,12 +2387,6 @@ sub environment_setup {
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
- # Used for guessing default plugin dir, we can't really know for sure
- $ENV{'MYSQL_LIBDIR'}= "$basedir/lib";
- # Override if this does not exist, but lib64 does (best effort)
- if (! -d "$basedir/lib" && -d "$basedir/lib64") {
- $ENV{'MYSQL_LIBDIR'}= "$basedir/lib64";
- }
$ENV{'MYSQL_BINDIR'}= "$bindir";
$ENV{'MYSQL_SHAREDIR'}= $path_language;
$ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir;
@@ -2427,6 +2454,14 @@ sub environment_setup {
$ENV{'MYSQLADMIN'}= client_arguments("mysqladmin");
$ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
$ENV{'EXE_MYSQL'}= $exe_mysql;
+ $ENV{'MYSQL_PLUGIN'}= $exe_mysql_plugin;
+ $ENV{'MYSQL_EMBEDDED'}= $exe_mysql_embedded;
+
+ my $exe_mysqld= find_mysqld($basedir);
+ $ENV{'MYSQLD'}= $exe_mysqld;
+ my $extra_opts= join (" ", @opt_extra_mysqld_opt);
+ $ENV{'MYSQLD_CMD'}= "$exe_mysqld --defaults-group-suffix=.1 ".
+ "--defaults-file=$path_config_file $extra_opts";
# ----------------------------------------------------
# bug25714 executable may _not_ exist in
@@ -3475,6 +3510,19 @@ sub mysql_install_db {
# ----------------------------------------------------------------------
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
+ if ($opt_boot_gdb) {
+ gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(),
+ $bootstrap_sql_file);
+ }
+ if ($opt_boot_dbx) {
+ dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(),
+ $bootstrap_sql_file);
+ }
+ if ($opt_boot_ddd) {
+ ddd_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(),
+ $bootstrap_sql_file);
+ }
+
my $path_sql= my_find_file($install_basedir,
["mysql", "sql/share", "share/mariadb",
"share/mysql", "share", "scripts"],
@@ -4577,6 +4625,11 @@ sub extract_server_log ($$) {
else
{
push(@lines, $line);
+ if (scalar(@lines) > 1000000) {
+ $Ferr = undef;
+ mtr_warning("Too much log from test, bailing out from extracting");
+ return ();
+ }
}
}
else
@@ -5906,16 +5959,19 @@ sub gdb_arguments {
my $args= shift;
my $exe= shift;
my $type= shift;
+ my $input= shift;
- # Write $args to gdb init file
- my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args;
my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
unlink($gdb_init_file);
+ # Put $args into a single string
+ my $str= join(" ", @$$args);
+ $input = $input ? "< $input" : "";
+
# write init file for mysqld or client
- mtr_tofile($gdb_init_file, "set args $str\n");
+ mtr_tofile($gdb_init_file, "set args $str $input\n");
if ( $opt_manual_gdb )
{
@@ -5954,16 +6010,19 @@ sub ddd_arguments {
my $args= shift;
my $exe= shift;
my $type= shift;
+ my $input= shift;
- # Write $args to ddd init file
- my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args;
my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
unlink($gdb_init_file);
+ # Put $args into a single string
+ my $str= join(" ", @$$args);
+ $input = $input ? "< $input" : "";
+
# write init file for mysqld or client
- mtr_tofile($gdb_init_file, "file $$exe\nset args $str\n");
+ mtr_tofile($gdb_init_file, "file $$exe\nset args $str $input\n");
if ( $opt_manual_ddd )
{
@@ -5999,14 +6058,16 @@ sub dbx_arguments {
my $args= shift;
my $exe= shift;
my $type= shift;
+ my $input= shift;
# Put $args into a single string
my $str= join " ", @$$args;
+ my $runline= $input ? "run $str < $input" : "run $str";
if ( $opt_manual_dbx ) {
print "\nTo start dbx for $type, type in another window:\n";
print "cd $glob_mysql_test_dir; dbx -c \"stop in main; " .
- "run $str\" $$exe\n";
+ "$runline\" $$exe\n";
# Indicate the exe should not be started
$$exe= undef;
@@ -6025,7 +6086,7 @@ sub dbx_arguments {
mtr_add_arg($$args, "dbx");
mtr_add_arg($$args, "-c");
- mtr_add_arg($$args, "stop in main; run $str");
+ mtr_add_arg($$args, "stop in main; $runline");
mtr_add_arg($$args, "$$exe");
$$exe= "xterm";
@@ -6319,11 +6380,15 @@ Options to run test on running server
Options for debugging the product
+ boot-dbx Start bootstrap server in dbx
+ boot-ddd Start bootstrap server in ddd
+ boot-gdb Start bootstrap server in gdb
+ client-dbx Start mysqltest client in dbx
client-ddd Start mysqltest client in ddd
client-debugger=NAME Start mysqltest in the selected debugger
client-gdb Start mysqltest client in gdb
- client-dbx Start mysqltest client in dbx
- ddd Start mysqld in ddd
+ dbx Start the mysqld(s) in dbx
+ ddd Start the mysqld(s) in ddd
debug Dump trace output for all servers and client programs
debug-common Same as debug, but sets 'd' debug flags to
"query,info,error,enter,exit"
@@ -6331,7 +6396,6 @@ Options for debugging the product
tracing
debugger=NAME Start mysqld in the selected debugger
gdb Start the mysqld(s) in gdb
- dbx Start the mysqld(s) in dbx
manual-debug Let user manually start mysqld in debugger, before
running test(s)
manual-gdb Let user manually start mysqld in gdb, before running
@@ -6446,6 +6510,8 @@ Misc options
engine to InnoDB.
report-times Report how much time has been spent on different
phases of test execution.
+ stress=ARGS Run stress test, providing options to
+ mysql-stress-test.pl. Options are separated by comma.
Some options that control enabling a feature for normal test runs,
can be turned off by prepending 'no' to the option, e.g. --notimer.
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 723855867f3..b62da05b4a2 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1252,6 +1252,35 @@ DROP TABLE t1;
CREATE TABLE t1 (a TEXT, id INT, b INT);
ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
DROP TABLE t1;
+#
+# Test for bug #12652385 - "61493: REORDERING COLUMNS TO POSITION
+# FIRST CAN CAUSE DATA TO BE CORRUPTED".
+#
+drop table if exists t1;
+# Use MyISAM engine as the fact that InnoDB doesn't support
+# in-place ALTER TABLE in cases when columns are being renamed
+# hides some bugs.
+create table t1 (i int, j int) engine=myisam;
+insert into t1 value (1, 2);
+# First, test for original problem described in the bug report.
+select * from t1;
+i j
+1 2
+# Change of column order by the below ALTER TABLE statement should
+# affect both column names and column contents.
+alter table t1 modify column j int first;
+select * from t1;
+j i
+2 1
+# Now test for similar problem with the same root.
+# The below ALTER TABLE should change not only the name but
+# also the value for the last column of the table.
+alter table t1 drop column i, add column k int default 0;
+select * from t1;
+j k
+2 0
+# Clean-up.
+drop table t1;
End of 5.1 tests
CREATE TABLE t1(c CHAR(10),
i INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY);
diff --git a/mysql-test/r/auth_rpl.result b/mysql-test/r/auth_rpl.result
new file mode 100644
index 00000000000..70626b02b2b
--- /dev/null
+++ b/mysql-test/r/auth_rpl.result
@@ -0,0 +1,24 @@
+include/master-slave.inc
+[connection master]
+[connection slave]
+include/stop_slave.inc
+[connection master]
+CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
+GRANT REPLICATION SLAVE ON *.* TO plug_user;
+FLUSH PRIVILEGES;
+[connection slave]
+CHANGE MASTER TO
+MASTER_USER= 'plug_user',
+MASTER_PASSWORD= 'plug_user';
+include/start_slave.inc
+# Slave in-sync with master now.
+SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
+user plugin authentication_string
+plug_user test_plugin_server plug_user
+# Cleanup (on slave).
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_USER='root';
+DROP USER 'plug_user';
+# Cleanup (on master).
+DROP USER 'plug_user';
+include/rpl_end.inc
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index fb1552b6c28..3e3d75f66e4 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -549,11 +549,9 @@ SUCCESS
# 15. Read-write statement: UPDATE IGNORE, change 0 rows.
#
update ignore t1 set a=2 where a=1;
-call p_verify_status_increment(2, 2, 1, 0);
SUCCESS
commit;
-call p_verify_status_increment(2, 2, 1, 0);
SUCCESS
#
diff --git a/mysql-test/r/ctype_errors.result b/mysql-test/r/ctype_errors.result
index d8218e40e6f..b3632454eb1 100644
--- a/mysql-test/r/ctype_errors.result
+++ b/mysql-test/r/ctype_errors.result
@@ -29,4 +29,14 @@ SET lc_messages=cs_CZ;
SET NAMES UTF8;
USE nonexistant;
ERROR 42000: Nezn-Bámá databáze 'nonexistant'
-End of 5.4 tests
+#
+# Bug#12736295: Buffer overflow for variable converted_err
+# with non-latin1 server error message
+#
+# Connection con1
+SET lc_messages=ru_RU;
+SET NAMES latin1;
+SELECT '01234567890123456789012345678901234\';
+ERROR 42000: \0423 \0432\0430\0441 \043E\0448\0438\0431\043A\0430 \0432 \0437\0430\043F\0440\043E\0441\0435. \0418\0437\0443\0447\0438\0442\0435 \0434\043E\043A\0443\043C\0435\043D\0442\0430\0446\0438\044E \043F\043E \0438\0441\043F\043E\043B\044C\0437\0443\0435\043C\043E\0439 \0432\0435\0440\0441\0438\0438 MySQL \043D\0430 \043F\0440\0435\0434\043C\0435\0442 \043A\043E\0440\0440\0435\043A\0442\043D\043E\0433\043E \0441\0438\043D\0442\0430\043A\0441\0438\0441\0430 \043E\043A\043E\043B\043E ''012345678901234567890123456
+# Connection default
+End of 5.5 tests
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
index 8b63da168ce..a9878b25c29 100644
--- a/mysql-test/r/ctype_utf16.result
+++ b/mysql-test/r/ctype_utf16.result
@@ -1118,5 +1118,14 @@ CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END
b
DROP TABLE t1;
#
+# Bug#12340997
+# DATE_ADD/DATE_SUB WITH INTERVAL CRASHES IN GET_INTERVAL_VALUE()
+#
+SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second));
+space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second))
+NULL
+Warnings:
+Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result
index fd5a4199217..a9f056b2e44 100644
--- a/mysql-test/r/ctype_utf32_uca.result
+++ b/mysql-test/r/ctype_utf32_uca.result
@@ -2415,5 +2415,25 @@ HEX(s1)
00000061
DROP TABLE t1;
#
+# Bug #12319710 : INVALID MEMORY READ AND/OR CRASH IN
+# MY_UCA_CHARCMP WITH UTF32
+#
+SET collation_connection=utf32_unicode_ci;
+CREATE TABLE t1 (a TEXT CHARACTER SET utf32 COLLATE utf32_turkish_ci NOT NULL);
+INSERT INTO t1 VALUES ('a'), ('b');
+CREATE TABLE t2 (b VARBINARY(5) NOT NULL);
+#insert chars outside of BMP
+INSERT INTO t2 VALUEs (0x082837),(0x082837);
+#test for read-out-of-bounds with non-BMP chars as a LIKE pattern
+SELECT * FROM t1,t2 WHERE a LIKE b;
+a b
+#test the original statement
+SELECT 1 FROM t1 AS t1_0 NATURAL LEFT OUTER JOIN t2 AS t2_0
+RIGHT JOIN t1 AS t1_1 ON t1_0.a LIKE t2_0.b;
+1
+1
+1
+DROP TABLE t1,t2;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/execution_constants.result b/mysql-test/r/execution_constants.result
index 293c88dc506..86eed447b83 100644
--- a/mysql-test/r/execution_constants.result
+++ b/mysql-test/r/execution_constants.result
@@ -7,6 +7,6 @@ PRIMARY KEY (`ID_MEMBER`,`ID_BOARD`),
KEY `logTime` (`logTime`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_bulgarian_ci;
INSERT INTO `t_bug21476` VALUES (2,2,1154870939,0),(1,2,1154870957,0),(2,183,1154941362,0),(2,84,1154904301,0),(1,84,1154905867,0),(2,13,1154947484,10271),(3,84,1154880549,0),(1,6,1154892183,0),(2,25,1154947581,10271),(3,25,1154904760,0),(1,25,1154947373,10271),(1,179,1154899992,0),(2,179,1154899410,0),(5,25,1154901666,0),(2,329,1154902026,0),(3,329,1154902040,0),(1,329,1154902058,0),(1,13,1154930841,0),(3,85,1154904987,0),(1,183,1154929665,0),(3,13,1154931268,0),(1,85,1154936888,0),(1,169,1154937959,0),(2,169,1154941717,0),(3,183,1154939810,0),(3,169,1154941734,0);
-Assertion: mysql_errno 1436 == 1436
+Assertion: mysql_errname ER_STACK_OVERRUN_NEED_MORE == ER_STACK_OVERRUN_NEED_MORE
DROP TABLE `t_bug21476`;
End of 5.0 tests.
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 81c122f2c76..048efb039f3 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -182,9 +182,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 SUBQUERY t system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` where 0
-SHOW WARNINGS;
-Level Code Message
-Note 1003 select 1 AS `1` from `test`.`t1` where 0
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
End of 5.0 tests.
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index 246cd40fd26..340a0863790 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -466,3 +466,26 @@ ALTER TABLE t1 COMMENT 'test';
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES;
DROP TABLE t1;
+#
+# Test for bug #12641342 - "61401: UPDATE PERFORMANCE DEGRADES
+# GRADUALLY IF A TRIGGER EXISTS".
+#
+# One of side-effects of this bug was that a transaction which
+# involved DML statements requiring prelocking blocked concurrent
+# FLUSH TABLES WITH READ LOCK for the whole its duration, while
+# correct behavior in this case is to block FTWRL only for duration
+# of individual DML statements.
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (id INT PRIMARY KEY, value INT);
+INSERT INTO t1 VALUES (1, 1);
+CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW SET @var = "a";
+BEGIN;
+UPDATE t1 SET value= value + 1 WHERE id = 1;
+# Switching to connection 'con1'.
+# The below FLUSH TABLES WITH READ LOCK should succeed and
+# should not be blocked by the transaction in default connection.
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+# Switching to connection 'default'.
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 4a61a16bbec..fff6e86862c 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -527,7 +527,7 @@ select "123456789012345678901234567890.123456789012345678901234567890" div 1 as
ERROR 22003: BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
SHOW WARNINGS;
Level Code Message
-Warning 1916 Got overflow when converting '123456789012345678901234567890.123456789012345678901234567890000000' to INT. Value truncated.
+Warning 1916 Got overflow when converting '123456789012345678901234567890' to INT. Value truncated.
Error 1690 BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
#
# Bug#57810 case/when/then : Assertion failed: length || !scale
@@ -727,3 +727,32 @@ select (1.175494351E-37 div 1.7976931348623157E+308);
0
Warnings:
Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated.
+#
+# Bug#12537160 ASSERTION FAILED:
+# STOP0 <= &TO->BUF[TO->LEN] WITH LARGE NUMBER.
+#
+select 999999999999999999999999999999999999999999999999999999999999999999999999999999999 % 0.1 as foo;
+foo
+0.0
+select 999999999999999999999999999999999999999999999999999999999999999999999999999999999 % 0.0 as foo;
+foo
+NULL
+#
+# Bug#12711164 - 61676:
+# RESULT OF DIV WITH DECIMAL AND INTEGER DOES NOT MAKE SENSE
+#
+select 5 div 2;
+5 div 2
+2
+select 5.0 div 2.0;
+5.0 div 2.0
+2
+select 5.0 div 2;
+5.0 div 2
+2
+select 5 div 2.0;
+5 div 2.0
+2
+select 5.9 div 2, 1.23456789e3 DIV 2, 1.23456789e9 DIV 2, 1.23456789e19 DIV 2;
+5.9 div 2 1.23456789e3 DIV 2 1.23456789e9 DIV 2 1.23456789e19 DIV 2
+2 617 617283945 6172839450000000000
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 62429ae1bce..4d512601216 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -2786,5 +2786,40 @@ format(123,2,'no_NO')
123,00
DROP TABLE t1;
#
+# Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
+#
+SELECT (rpad(1.0,2048,1)) IS NOT FALSE;
+(rpad(1.0,2048,1)) IS NOT FALSE
+1
+SELECT ((+0) IN
+((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
+(32767.1)));
+((+0) IN
+((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
+(32767.1)))
+0
+SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1));
+((rpad(1.0,2048,1)) = ('4(') ^ (0.1))
+0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '4('
+SELECT
+pow((rpad(10.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
+ERROR 22003: DOUBLE value is out of range in 'pow(rpad(10.0,2048,1),0x07ffffffffff)'
+SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../'));
+((rpad(1.0,2048,1)) + (0) ^ ('../'))
+1.011111111111111
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '../'
+SELECT stddev_samp(rpad(1.0,2048,1));
+stddev_samp(rpad(1.0,2048,1))
+NULL
+SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
+((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)))
+1
+SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
+((0xf3) * (rpad(1.0,2048,1)) << (0xcc))
+0
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 8c6aadb15fb..c50fbfc7fe0 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1426,6 +1426,12 @@ NULL
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1)
NULL
+#
+# Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
+#
+DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
+Warnings:
+Warning 1292 Truncated incorrect date value: '0000-00-00'
End of 5.1 tests
#
# Bug#57039: constant subtime expression returns incorrect result.
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 03ced4653cb..40007dd3a05 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1076,4 +1076,21 @@ SPATIAL INDEX i1 (col1, col2)
);
ERROR HY000: Incorrect arguments to SPATIAL INDEX
DROP TABLE t0, t1, t2;
+#
+# Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
+#
+CREATE TABLE g1
+(a geometry NOT NULL, UNIQUE KEY i (a(151))) engine=myisam;
+INSERT INTO g1 VALUES (geomfromtext('point(1 1)'));
+INSERT INTO g1 VALUES (geomfromtext('point(1 2)'));
+FLUSH TABLES;
+SELECT 1 FROM g1
+FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
+;
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\xF0?'
+Warning 1441 Datetime function: datetime field overflow
+Warning 1292 Incorrect datetime value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\x00@'
+DROP TABLE g1;
End of 5.5 tests
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index faa9d039d7b..c531c856f8b 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1671,7 +1671,7 @@ c (SELECT a FROM t1 WHERE b = c)
SELECT b c, (SELECT a FROM t1 WHERE b = c)
FROM t1
HAVING b = 10;
-ERROR 42000: non-grouping field 'b' is used in HAVING clause
+ERROR 42000: Non-grouping field 'b' is used in HAVING clause
SELECT MAX(b) c, (SELECT a FROM t1 WHERE b = c)
FROM t1
HAVING b = 10;
@@ -1904,6 +1904,38 @@ a AVG(t1.b) t11c t12c
1 4.0000 6 6
2 2.0000 7 7
DROP TABLE t1;
+#
+# Bug#11765254 (58200): Assertion failed: param.sort_length when grouping
+# by functions
+#
+SET SQL_BIG_TABLES=1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0),(0);
+SELECT 1 FROM t1 GROUP BY IF(`a`,'','');
+1
+1
+SELECT 1 FROM t1 GROUP BY TRIM(LEADING RAND() FROM '');
+1
+1
+SELECT 1 FROM t1 GROUP BY SUBSTRING('',SLEEP(0),'');
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: ''
+SELECT 1 FROM t1 GROUP BY SUBSTRING(SYSDATE() FROM 'K' FOR 'jxW<');
+1
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'K'
+Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
+Warning 1292 Truncated incorrect INTEGER value: 'K'
+Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
+Warning 1292 Truncated incorrect INTEGER value: 'K'
+Warning 1292 Truncated incorrect INTEGER value: 'jxW<'
+DROP TABLE t1;
+SET SQL_BIG_TABLES=0;
# End of 5.1 tests
#
# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 68e4c12f278..1c9c8016ea6 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -419,7 +419,7 @@ select f1 from t1 group by f1 having max(f1)=f1;
f1
set session sql_mode='ONLY_FULL_GROUP_BY';
select f1 from t1 having max(f1)=f1;
-ERROR 42000: non-grouping field 'f1' is used in HAVING clause
+ERROR 42000: Non-grouping field 'f1' is used in HAVING clause
select f1 from t1 group by f1 having max(f1)=f1;
f1
set session sql_mode='';
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index ed8ada1b4cc..f058c9f9c72 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -715,8 +715,8 @@ create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
show table status like 't_';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL # NULL NULL latin1_swedish_ci NULL
drop table t1, t2;
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index d75c668c819..170cc855e29 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1814,5 +1814,119 @@ unlock tables;
drop table t1;
drop view v1;
#
+# Test for bug #12828477 - "MDL SUBSYSTEM CREATES BIG OVERHEAD FOR
+# CERTAIN QUERIES TO INFORMATION_SCHEMA".
+#
+# Check that metadata locks which are acquired during the process
+# of opening tables/.FRMs/.TRG files while filling I_S table are
+# not kept to the end of statement. Keeping the locks has caused
+# performance problems in cases when big number of tables (.FRMs
+# or .TRG files) were scanned as cost of new lock acquisition has
+# increased linearly.
+drop database if exists mysqltest;
+create database mysqltest;
+use mysqltest;
+create table t0 (i int);
+create table t1 (j int);
+create table t2 (k int);
+#
+# Test that we don't keep locks in case when we to fill
+# I_S table we perform full-blown table open.
+#
+# Acquire lock on 't2' so upcoming RENAME is
+# blocked.
+lock tables t2 read;
+#
+# Switching to connection 'con12828477_1'.
+#
+# The below RENAME should wait on 't2' while
+# keeping X lock on 't1'.
+rename table t1 to t3, t2 to t1, t3 to t2;
+#
+# Switching to connection 'con12828477_2'.
+#
+# Wait while the above RENAME is blocked.
+# Issue query to I_S which will open 't0' and get
+# blocked on 't1' because of RENAME.
+select table_name, auto_increment from information_schema.tables where table_schema='mysqltest';
+#
+# Switching to connection 'con12828477_3'.
+#
+# Wait while the above SELECT is blocked.
+#
+# Check that it holds no lock on 't0' so it can be renamed.
+rename table t0 to t4;
+#
+# Switching to connection 'default'.
+#
+#
+# Unblock the first RENAME.
+unlock tables;
+#
+# Switching to connection 'con12828477_1'.
+#
+# Reap the first RENAME
+#
+# Switching to connection 'con12828477_2'.
+#
+# Reap SELECT to I_S.
+table_name auto_increment
+t0 NULL
+t1 NULL
+t2 NULL
+#
+# Switching to connection 'default'.
+#
+#
+# Now test that we don't keep locks in case when we to fill
+# I_S table we read .FRM or .TRG file only (this was the case
+# for which problem existed).
+#
+rename table t4 to t0;
+# Acquire lock on 't2' so upcoming RENAME is
+# blocked.
+lock tables t2 read;
+#
+# Switching to connection 'con12828477_1'.
+#
+# The below RENAME should wait on 't2' while
+# keeping X lock on 't1'.
+rename table t1 to t3, t2 to t1, t3 to t2;
+#
+# Switching to connection 'con12828477_2'.
+#
+# Wait while the above RENAME is blocked.
+# Issue query to I_S which will open 't0' and get
+# blocked on 't1' because of RENAME.
+select event_object_table, trigger_name from information_schema.triggers where event_object_schema='mysqltest';
+#
+# Switching to connection 'con12828477_3'.
+#
+# Wait while the above SELECT is blocked.
+#
+# Check that it holds no lock on 't0' so it can be renamed.
+rename table t0 to t4;
+#
+# Switching to connection 'default'.
+#
+#
+# Unblock the first RENAME.
+unlock tables;
+#
+# Switching to connection 'con12828477_1'.
+#
+# Reap the first RENAME
+#
+# Switching to connection 'con12828477_2'.
+#
+# Reap SELECT to I_S.
+event_object_table trigger_name
+#
+# Switching to connection 'default'.
+#
+#
+# Clean-up.
+drop database mysqltest;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 0e1a598bcab..622640a897c 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -904,7 +904,8 @@ SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
-test.tm1 check Error Table 'test.t1' doesn't exist
+test.tm1 check Error Table 'test.t1' is differently defined or of non-MyISAM type or doesn't exist
+test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
CREATE TABLE t1(a INT);
@@ -912,7 +913,7 @@ SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
-test.tm1 check Error Table 'test.t2' doesn't exist
+test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
CREATE TABLE t2(a BLOB);
@@ -920,7 +921,7 @@ SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
-test.tm1 check Warning Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
+test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
ALTER TABLE t2 MODIFY a INT;
@@ -3618,7 +3619,7 @@ test.t1 analyze Error Unable to open underlying table which is differently defin
test.t1 analyze error Corrupt
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Error Table 'test.t_not_exists' doesn't exist
+test.t1 check Error Table 'test.t_not_exists' is differently defined or of non-MyISAM type or doesn't exist
test.t1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.t1 check error Corrupt
CHECKSUM TABLE t1;
@@ -3634,7 +3635,7 @@ test.t1 optimize Error Unable to open underlying table which is differently defi
test.t1 optimize error Corrupt
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair Error Table 'test.t_not_exists' doesn't exist
+test.t1 repair Error Table 'test.t_not_exists' is differently defined or of non-MyISAM type or doesn't exist
test.t1 repair Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.t1 repair error Corrupt
REPAIR TABLE t1 USE_FRM;
@@ -3660,4 +3661,37 @@ ALTER TABLE t1 engine=myisam;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES;
DROP TABLE m1, t1;
-End of 6.0 tests
+#
+# Test for bug #11754210 - "45777: CHECK TABLE DOESN'T SHOW ALL
+# PROBLEMS FOR MERGE TABLE COMPLIANCE IN 5.1"
+#
+drop tables if exists t1, t2, t3, t4, m1;
+create table t1(id int) engine=myisam;
+create view t3 as select 1 as id;
+create table t4(id int) engine=memory;
+create table m1(id int) engine=merge union=(t1,t2,t3,t4);
+select * from m1;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+# The below CHECK and REPAIR TABLE statements should
+# report all problems with underlying tables:
+# - absence of 't2',
+# - missing base table for 't3',
+# - wrong engine of 't4'.
+check table m1;
+Table Op Msg_type Msg_text
+test.m1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
+test.m1 check Error Table 'test.t3' is differently defined or of non-MyISAM type or doesn't exist
+test.m1 check Error Table 'test.t4' is differently defined or of non-MyISAM type or doesn't exist
+test.m1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+test.m1 check error Corrupt
+repair table m1;
+Table Op Msg_type Msg_text
+test.m1 repair Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
+test.m1 repair Error Table 'test.t3' is differently defined or of non-MyISAM type or doesn't exist
+test.m1 repair Error Table 'test.t4' is differently defined or of non-MyISAM type or doesn't exist
+test.m1 repair Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+test.m1 repair error Corrupt
+# Clean-up.
+drop tables m1, t1, t4;
+drop view t3;
+End of 5.5 tests
diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result
index 91700701139..56f61ccdf47 100644
--- a/mysql-test/r/myisampack.result
+++ b/mysql-test/r/myisampack.result
@@ -118,3 +118,35 @@ Aborted: file is not compressed
DROP TABLE t1,t2,t3;
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
+#
+# BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
+#
+CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
+INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
+FLUSH TABLE t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
+a
+aaaa
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
+a
+aaaa
+DROP TABLE t1;
+# Test table with key_reflength > rec_reflength
+CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
+# Populating a table, so it's index file exceeds 65K
+# Populating a table, so index file has second level fulltext tree
+FLUSH TABLE t1;
+# Compressing table
+# Fixing index (repair by sort)
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+FLUSH TABLE t1;
+# Fixing index (repair with keycache)
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
diff --git a/mysql-test/r/mysql_plugin.result b/mysql-test/r/mysql_plugin.result
new file mode 100644
index 00000000000..949f3748236
--- /dev/null
+++ b/mysql-test/r/mysql_plugin.result
@@ -0,0 +1,110 @@
+#
+# Ensure the plugin isn't loaded.
+#
+SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name;
+name dl
+#
+# Enable the plugin...
+#
+#
+# Ensure the plugin is now loaded.
+#
+SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name;
+name dl
+daemon_example libdaemon_example.so
+#
+# Disable the plugin...
+#
+#
+# Ensure the plugin isn't loaded.
+#
+SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name;
+name dl
+#
+# Attempt to load non-existant plugin
+#
+ERROR: Cannot read plugin config file NOT_THERE_AT_ALL. File does not exist.
+#
+# Attempt to use non-existant plugin.ini file
+#
+ERROR: Cannot read plugin config file daemon_example. File does not exist.
+#
+# Attempt to omit the plugin
+#
+ERROR: No plugin specified.
+#
+# Attempt to omit DISABLE|ENABLE
+#
+ERROR: missing operation. Please specify either '<plugin> ENABLE' or '<plugin> DISABLE'.
+#
+# Attempt to use bad paths - datadir
+#
+ERROR: Cannot access datadir at '/data_not_there/'.
+#
+# Attempt to use bad paths - basedir
+#
+ERROR: Cannot access basedir at '/basedir_not_there/'.
+#
+# Attempt to use bad paths - plugin_dir
+#
+ERROR: Cannot read plugin config file daemon_example. File does not exist.
+#
+# Attempt to use bad paths - mysqld
+#
+ERROR: Cannot access mysqld path '/mysqld_not_there/'.
+#
+# Attempt to use bad paths - my_print_defaults
+#
+ERROR: Cannot access my-print-defaults path '/my_print_defaults_not_there/'.
+#
+# Missing library
+#
+ERROR: The plugin library is missing or in a different location.
+#
+# Bad format for config file
+#
+ERROR: Cannot read plugin config file daemon_example. Bad format in plugin configuration file.
+#
+# Missing base_dir option
+#
+ERROR: Missing --basedir option.
+#
+# Missing data_dir option
+#
+ERROR: Missing --datadir option.
+#
+# Missing plugin_dir option
+#
+ERROR: Missing --plugin_dir option.
+#
+# Show the help.
+#
+mysql_plugin Ver V.V.VV Distrib XX.XX.XX
+Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+Enable or disable plugins.
+
+Usage: mysql_plugin [options] <plugin> ENABLE|DISABLE
+
+Options:
+ -?, --help Display this help and exit.
+ -b, --basedir=name The basedir for the server.
+ -d, --datadir=name The datadir for the server.
+ -p, --plugin-dir=name
+ The plugin dir for the server.
+ -i, --plugin-ini=name
+ Read plugin information from configuration file specified
+ instead of from <plugin-dir>/<plugin_name>.ini.
+ -n, --no-defaults Do not read values from configuration file.
+ -P, --print-defaults
+ Show default values from configuration file.
+ -m, --mysqld=name Path to mysqld executable. Example: /sbin/temp1/mysql/bin
+ -f, --my-print-defaults=name
+ Path to my_print_defaults executable. Example:
+ /source/temp11/extra
+ -v, --verbose More verbose output; you can use this multiple times to
+ get even more verbose output.
+ -V, --version Output version information and exit.
+
+
+mysql_plugin Ver V.V.VV Distrib XX.XX.XX
diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result
index b9bdee3211b..342126fba84 100644
--- a/mysql-test/r/mysqld--help-notwin.result
+++ b/mysql-test/r/mysqld--help-notwin.result
@@ -44,9 +44,6 @@ The following options may be given as the first argument:
Type of BINLOG_CHECKSUM_ALG. Include checksum for log
events in the binary log. Possible values are NONE and
CRC32; default is NONE.
- --binlog-dbug-fsync-sleep=#
- Extra sleep (in microseconds) to add to binlog fsync(),
- for debugging
--binlog-direct-non-transactional-updates
Causes updates to non-transactional engines using
statement format to be written directly to binary log.
@@ -864,7 +861,6 @@ bind-address (No default value)
binlog-annotate-rows-events FALSE
binlog-cache-size 32768
binlog-checksum NONE
-binlog-dbug-fsync-sleep 0
binlog-direct-non-transactional-updates FALSE
binlog-format STATEMENT
binlog-optimize-thread-scheduling TRUE
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 6af460db37a..f91ea83da4b 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -1,7 +1,6 @@
+-1 before test
+<No error> before test
SET GLOBAL max_connections = 1000;
-select 0 as "before_use_test" ;
-before_use_test
-0
select otto from (select 1 as otto) as t1;
otto
1
@@ -25,27 +24,32 @@ mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' fai
select otto from (select 1 as otto) as t1;
otto
1
+
select 0 as "after_successful_stmt_errno" ;
after_successful_stmt_errno
0
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+ER_PARSE_ERROR
select 1064 as "after_wrong_syntax_errno" ;
after_wrong_syntax_errno
1064
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+ER_PARSE_ERROR
select 1064 as "after_let_var_equal_value" ;
after_let_var_equal_value
1064
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
set @my_var= 'abc' ;
+
select 0 as "after_set_var_equal_value" ;
after_set_var_equal_value
0
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+ER_PARSE_ERROR
select 1064 as "after_disable_warnings_command" ;
after_disable_warnings_command
1064
@@ -53,6 +57,7 @@ drop table if exists t1 ;
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
drop table if exists t1 ;
+
select 0 as "after_disable_warnings" ;
after_disable_warnings
0
@@ -60,6 +65,7 @@ garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
+ER_NO_SUCH_TABLE
select 1146 as "after_minus_masked" ;
after_minus_masked
1146
@@ -67,6 +73,7 @@ garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
+ER_NO_SUCH_TABLE
select 1146 as "after_!_masked" ;
after_!_masked
1146
@@ -79,6 +86,7 @@ garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
prepare stmt from "select 3 from t1" ;
ERROR 42S02: Table 'test.t1' doesn't exist
+ER_NO_SUCH_TABLE
select 1146 as "after_failing_prepare" ;
after_failing_prepare
1146
@@ -86,6 +94,7 @@ create table t1 ( f1 char(10));
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
prepare stmt from "select 3 from t1" ;
+
select 0 as "after_successful_prepare" ;
after_successful_prepare
0
@@ -93,6 +102,7 @@ garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
execute stmt;
3
+
select 0 as "after_successful_execute" ;
after_successful_execute
0
@@ -101,6 +111,7 @@ garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
execute stmt;
ERROR 42S02: Table 'test.t1' doesn't exist
+ER_NO_SUCH_TABLE
select 1146 as "after_failing_execute" ;
after_failing_execute
1146
@@ -108,12 +119,14 @@ garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
execute __stmt_;
ERROR HY000: Unknown prepared statement handler (__stmt_) given to EXECUTE
+ER_UNKNOWN_STMT_HANDLER
select 1243 as "after_failing_execute" ;
after_failing_execute
1243
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
deallocate prepare stmt;
+
select 0 as "after_successful_deallocate" ;
after_successful_deallocate
0
@@ -121,11 +134,13 @@ garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
deallocate prepare __stmt_;
ERROR HY000: Unknown prepared statement handler (__stmt_) given to DEALLOCATE PREPARE
+ER_UNKNOWN_STMT_HANDLER
select 1243 as "after_failing_deallocate" ;
after_failing_deallocate
1243
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+ER_PARSE_ERROR
select 1064 as "after_--disable_abort_on_error" ;
after_--disable_abort_on_error
1064
@@ -135,13 +150,19 @@ select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
+ER_NO_SUCH_TABLE
select 1146 as "after_!errno_masked_error" ;
after_!errno_masked_error
1146
select 3 from t1;
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1000...
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+ is empty
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nonsense' at line 1
+ is empty
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+ER_PARSE_ERROR
select 1064 as "after_--enable_abort_on_error" ;
after_--enable_abort_on_error
1064
@@ -149,6 +170,28 @@ select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 3 from t1;
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1064...
+garbage;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
+select 2;
+select 3;
+3
+3
+select 5;
+ERROR 42S02: Table 'test.t1' doesn't exist
+select 7;
+7
+7
+mysqltest: At line 1: End of line junk detected: "OCNE"
+connect con1,localhost,root,,;
+select 5 from t1;
+lower
+case
+name
+abc
+xyz
+ is empty
+ is empty
+"Yes it's empty"
hello
hello
;;;;;;;;
@@ -321,7 +364,7 @@ insert into t1 values ('$dollar');
$dollar
`select 42`
drop table t1;
-mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1
+mysqltest: At line 1: query 'let $var2= `failing query`' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
@@ -859,7 +902,7 @@ mysqltest: At line 1: Could not find column 'column_not_exists' in the result of
mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
value= No such row
-mysqltest: At line 1: Error running query 'SHOW COLNS FROM t1': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLNS FROM t1' at line 1
+mysqltest: At line 1: query 'let $value= query_get_value(SHOW COLNS FROM t1, Field, 1)' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLNS FROM t1' at line 1
Field Type Null Key Default Extra
a int(11) YES -><- NULL
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index cf5c9386790..5372ec1ec66 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -1718,6 +1718,13 @@ a 1
3 1
2 1
DROP TABLE t1;
+#
+# Bug#11765255 58201:
+# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+#
+select 1 order by max(1) + min(1);
+1
+1
End of 5.1 tests
#
# Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result
index aa0944e96b5..43838170501 100644
--- a/mysql-test/r/partition_innodb_plugin.result
+++ b/mysql-test/r/partition_innodb_plugin.result
@@ -2,7 +2,6 @@ call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB
#
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
#
-SET @old_innodb_file_format_max = @@global.innodb_file_format_max;
SET @old_innodb_file_format = @@global.innodb_file_format;
SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
@@ -70,7 +69,6 @@ DROP TABLE t1;
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
-SET @@global.innodb_file_format_max = @old_innodb_file_format_max;
SET NAMES utf8;
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
ENGINE=InnoDB
diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result
index 5a22e47107f..40e974f90eb 100644
--- a/mysql-test/r/plugin_auth.result
+++ b/mysql-test/r/plugin_auth.result
@@ -395,4 +395,39 @@ ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME
NO authentication_string
NO plugin
+#
+# Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN
+# .-> USING PASSWORD: NO
+#
+# shoud contain "using password=yes"
+ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: YES)
+# shoud contain "using password=no"
+ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: NO)
+#
+# Bug #12610784: SET PASSWORD INCORRECTLY KEEP AN OLD EMPTY PASSWORD
+#
+CREATE USER bug12610784@localhost;
+SET PASSWORD FOR bug12610784@localhost = PASSWORD('secret');
+ERROR 28000: Access denied for user 'bug12610784'@'localhost' (using password: NO)
+DROP USER bug12610784@localhost;
+#
+# Bug #12818542: PAM: ADDING PASSWORD FOR AN ACCOUNT DISABLES PAM
+# AUTHENTICATION SETTINGS
+#
+CREATE USER bug12818542@localhost
+IDENTIFIED WITH 'test_plugin_server' AS 'bug12818542_dest';
+CREATE USER bug12818542_dest@localhost
+IDENTIFIED BY 'bug12818542_dest_passwd';
+GRANT PROXY ON bug12818542_dest@localhost TO bug12818542@localhost;
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+bug12818542@localhost bug12818542_dest@localhost
+SET PASSWORD = PASSWORD('bruhaha');
+Warnings:
+Note 1699 SET PASSWORD has no significance for users authenticating via plugins
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+bug12818542@localhost bug12818542_dest@localhost
+DROP USER bug12818542@localhost;
+DROP USER bug12818542_dest@localhost;
End of 5.5 tests
diff --git a/mysql-test/r/secure_file_priv_win.result b/mysql-test/r/secure_file_priv_win.result
new file mode 100644
index 00000000000..d6636aad5d4
--- /dev/null
+++ b/mysql-test/r/secure_file_priv_win.result
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (c1 longtext);
+INSERT INTO t1 values ('a');
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR/B11764517.tmp';
+show global variables like 'secure_file_priv';
+Variable_name Value
+secure_file_priv MYSQL_TMP_DIR/
+SELECT load_file('MYSQL_TMP_DIR\\B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR_UCASE/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR_LCASE/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517.tmp') AS x;
+x
+NULL
+LOAD DATA INFILE 'MYSQL_TMP_DIR\\B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR_UCASE/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE "MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517.tmp" into table t1;
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517-2.tmp';
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR\\B11764517-2.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR/B11764517-3.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR_UCASE/B11764517-4.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR_LCASE/B11764517-5.tmp';
+DROP TABLE t1;
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result
index 542c18dcec5..d8a5857aeb8 100644
--- a/mysql-test/r/select_safe.result
+++ b/mysql-test/r/select_safe.result
@@ -30,7 +30,7 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
delete from t1 where a+0=1;
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
update t1 set b="a" limit 1;
update t1 set b="a" where b="b" limit 2;
delete from t1 where b="test" limit 1;
@@ -42,7 +42,7 @@ SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
2 0
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
SELECT * from t1 order by a;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
SET SQL_BIG_SELECTS=1;
SELECT * from t1 order by a;
a b
@@ -52,7 +52,7 @@ a b
5 a
SET MAX_JOIN_SIZE=2;
SELECT * from t1;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
SET MAX_JOIN_SIZE=DEFAULT;
SELECT * from t1;
a b
@@ -82,12 +82,12 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
set local max_join_size=8;
select * from (select * from t1) x;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
set local max_join_size=1;
select * from (select a.a as aa, b.a as ba from t1 a, t1 b) x;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
set local max_join_size=1;
select * from (select 1 union select 2 union select 3) x;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
drop table t1;
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index e2b92e443ee..b0a812c7b18 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -460,57 +460,57 @@ insert into t2 values (1),(2);
insert into t3 values (1,1),(2,2);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t3 MEMORY 10 Fixed 2 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
insert into t1 values (3),(4);
insert into t2 values (3),(4);
insert into t3 values (3,3),(4,4);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t3 MEMORY 10 Fixed 4 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t3 MEMORY 10 Fixed 5 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
delete from t1 where a=3;
delete from t2 where b=3;
delete from t3 where a=3;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+t3 MEMORY 10 Fixed 4 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
truncate table t1;
truncate table t2;
truncate table t3;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t3 MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
+t3 MEMORY 10 Fixed 1 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
delete from t1 where a=5;
delete from t2 where b=5;
delete from t3 where a=5;
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
-t2 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
-t3 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
+t1 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+t2 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
+t3 MEMORY 10 Fixed 0 # # # # # NULL # NULL NULL latin1_swedish_ci NULL
drop table t1, t2, t3;
create database mysqltest;
show create database mysqltest;
@@ -662,7 +662,7 @@ DROP TABLE t1;
flush tables;
SHOW TABLE STATUS like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
+t1 NULL NULL NULL NULL # # # # NULL NULL # NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
Warnings:
Warning 1033 Incorrect information in file: './test/t1.frm'
show create table t1;
@@ -1334,7 +1334,7 @@ CREATE DATABASE `ä`;
CREATE TABLE `ä`.`ä` (a int) ENGINE=Memory;
SHOW TABLE STATUS FROM `ä` LIKE 'ä';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-ä MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+ä MEMORY 10 Fixed 0 # # # # 0 NULL # NULL NULL latin1_swedish_ci NULL
DROP DATABASE `ä`;
show columns from `#mysql50#????????`;
Got one of the listed errors
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 4e97429c48f..0da4ed34e89 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1717,6 +1717,22 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug#12428824 - PARSER STACK OVERFLOW AND CRASH IN SP_ADD_USED_ROUTINE
+# WITH OBSCURE QUERY
+#
+SELECT very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+ERROR 42000: Identifier name 'very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
+CALL very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+ERROR 42000: Identifier name 'very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
+SELECT very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_func();
+ERROR 42000: Incorrect database name 'very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222'
+CALL very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_proc();
+ERROR 42000: Incorrect database name 'very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222'
+SELECT db_name.very_long_fn_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
+ERROR 42000: Identifier name 'very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
+CALL db_name.very_long_pr_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
+ERROR 42000: Identifier name 'very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
End of 5.1 tests
#
# Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index c09579b13eb..88908b05f46 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -592,3 +592,28 @@ ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' fo
# Connection 'default'.
drop user bug57061_user@localhost;
drop database mysqltest_db;
+#
+# Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE
+# DEFINITION OF ANY ROUTINE.
+#
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SELECT 1;
+CREATE USER user2@localhost IDENTIFIED BY '';
+GRANT SELECT(db) ON mysql.proc TO user2@localhost;
+# Connection con2 as user2
+# The statement below before disclosed info from body_utf8 column.
+SHOW CREATE PROCEDURE db1.p1;
+ERROR 42000: PROCEDURE p1 does not exist
+# Check that SHOW works with SELECT grant on whole table
+# Connection default
+GRANT SELECT ON mysql.proc TO user2@localhost;
+# Connection con2
+# This should work
+SHOW CREATE PROCEDURE db1.p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+# Connection default
+DROP USER user2@localhost;
+DROP DATABASE db1;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 0fcda087f0d..142c154bdac 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -7159,6 +7159,40 @@ init_connect
SET @@GLOBAL.init_connect= @old_init_connect;
DROP PROCEDURE p2;
DROP PROCEDURE p5;
+#
+# Bug#11840395 (formerly known as bug#60347):
+# The string "versiondata" seems
+# to be 'leaking' into the schema name space
+#
+DROP DATABASE IF EXISTS mixedCaseDbName;
+CREATE DATABASE mixedCaseDbName;
+CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end|
+CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin return 'IT WORKS'; end
+|
+call mixedCaseDbName.tryMyProc();
+select mixedCaseDbName.tryMyFunc();
+mixedCaseDbName.tryMyFunc()
+IT WORKS
+DROP DATABASE mixedCaseDbName;
+#
+# Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
+#
+CREATE TABLE t1 (a INT, b INT, KEY(b));
+CREATE TABLE t2 (c INT, d INT, KEY(c));
+INSERT INTO t1 VALUES (1,1),(1,1),(1,2);
+INSERT INTO t2 VALUES (1,1),(1,2);
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+DECLARE a int;
+-- SQL statement inside
+SELECT 1 INTO a;
+RETURN a;
+END $
+SELECT COUNT(DISTINCT d) FROM t1, t2 WHERE a = c AND b = f1();
+COUNT(DISTINCT d)
+2
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
@@ -7498,4 +7532,76 @@ CALL p1();
DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
+
+# --
+# -- Bug#12652769 - 61470: case operator in stored routine retains old
+# -- value of input parameter
+# ---
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf8);
+INSERT INTO t1 VALUES ('a');
+CREATE PROCEDURE p1(dt DATETIME, i INT)
+BEGIN
+SELECT
+CASE
+WHEN i = 1 THEN 2
+ELSE dt
+END AS x1;
+SELECT
+CASE _latin1'a'
+ WHEN _utf8'a' THEN 'A'
+ END AS x2;
+SELECT
+CASE _utf8'a'
+ WHEN _latin1'a' THEN _utf8'A'
+ END AS x3;
+SELECT
+CASE s1
+WHEN _latin1'a' THEN _latin1'b'
+ ELSE _latin1'c'
+ END AS x4
+FROM t1;
+END|
+
+CALL p1('2011-04-03 05:14:10', 1);
+x1
+2
+x2
+A
+x3
+A
+x4
+b
+CALL p1('2011-04-03 05:14:11', 2);
+x1
+2011-04-03 05:14:11
+x2
+A
+x3
+A
+x4
+b
+CALL p1('2011-04-03 05:14:12', 2);
+x1
+2011-04-03 05:14:12
+x2
+A
+x3
+A
+x4
+b
+CALL p1('2011-04-03 05:14:13', 2);
+x1
+2011-04-03 05:14:13
+x2
+A
+x3
+A
+x4
+b
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
# End of 5.5 test
diff --git a/mysql-test/r/sp_sync.result b/mysql-test/r/sp_sync.result
index 174b3c60745..ba90b009ce4 100644
--- a/mysql-test/r/sp_sync.result
+++ b/mysql-test/r/sp_sync.result
@@ -1,4 +1,4 @@
-Tests of syncronization of stored procedure execution.
+Tests of synchronization of stored procedure execution.
SET DEBUG_SYNC= 'RESET';
#
# Bug #30977 Concurrent statement using stored function and
@@ -92,4 +92,16 @@ COUNT(f1(a))
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP TABLES t0, t1;
-SET DEBUG_SYNC= 'RESET';
+#
+# test for bug#11756013
+#
+DROP SCHEMA IF EXISTS s1;
+CREATE SCHEMA s1;
+CREATE PROCEDURE s1.p1() BEGIN END;
+SET DEBUG_SYNC='before_db_dir_check SIGNAL check_db WAIT_FOR dropped_schema';
+CALL s1.p1;
+SET DEBUG_SYNC='now WAIT_FOR check_db';
+DROP SCHEMA s1;
+SET DEBUG_SYNC='now SIGNAL dropped_schema';
+ERROR 42000: Unknown database 's1'
+SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index 4163725a196..b91dc898f12 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -558,6 +558,52 @@ f1 bug13575(f1)
3 ccc
drop function bug13575|
drop table t3|
+SELECT @@GLOBAL.storage_engine INTO @old_engine|
+SET @@GLOBAL.storage_engine=InnoDB|
+SET @@SESSION.storage_engine=InnoDB|
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine InnoDB
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine InnoDB
+CREATE PROCEDURE bug11758414()
+BEGIN
+SET @@GLOBAL.storage_engine="MyISAM";
+SET @@SESSION.storage_engine="MyISAM";
+# show defaults at execution time / that setting them worked
+SHOW GLOBAL VARIABLES LIKE 'storage_engine';
+SHOW SESSION VARIABLES LIKE 'storage_engine';
+CREATE TABLE t1 (id int);
+CREATE TABLE t2 (id int) ENGINE=InnoDB;
+# show we're heeding the default (at run-time, not parse-time!)
+ SHOW CREATE TABLE t1;
+ # show that we didn't break explicit override with ENGINE=...
+SHOW CREATE TABLE t2;
+END;
+|
+CALL bug11758414|
+Variable_name Value
+storage_engine MyISAM
+Variable_name Value
+storage_engine MyISAM
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine MyISAM
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+Variable_name Value
+storage_engine MyISAM
+DROP PROCEDURE bug11758414|
+DROP TABLE t1, t2|
+SET @@GLOBAL.storage_engine=@old_engine|
#
# End of 5.1 tests
#
diff --git a/mysql-test/r/type_datetime_hires.result b/mysql-test/r/type_datetime_hires.result
index ffbd5c42546..ba1fe4adedb 100644
--- a/mysql-test/r/type_datetime_hires.result
+++ b/mysql-test/r/type_datetime_hires.result
@@ -28,7 +28,7 @@ a DIV 1
0
20101211002003
20101211010203
-20101211030406
+20101211030405
20101211154711
select group_concat(distinct a) from t1;
group_concat(distinct a)
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 79fd21ebe20..f41c2e7688b 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -431,4 +431,19 @@ SELECT f1 FROM t1;
f1
-1.79769313486231e308
DROP TABLE t1;
+#
+# Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
+#
+# Ignoring output from misc. float operations
+select format(-1.7976931348623157E+307,256) as foo;
+select least(-1.1111111111111111111111111,
+- group_concat(1.7976931348623157E+308)) as foo;
+select concat((truncate((-1.7976931348623157E+307),(0x1e))),
+(99999999999999999999999999999999999999999999999999999999999999999)) into @a;
End of 5.0 tests
+#
+# Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
+#
+select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
+foo
+0
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 38ce18e3dd6..047cfbe5342 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1934,3 +1934,14 @@ f1
0.000000000000000000000000
DROP TABLE IF EXISTS t1;
End of 5.1 tests
+#
+# BUG#12911710 - VALGRIND FAILURE IN
+# ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
+#
+CREATE TABLE t1(d1 DECIMAL(60,0) NOT NULL,
+d2 DECIMAL(60,0) NOT NULL);
+INSERT INTO t1 (d1, d2) VALUES(0.0, 0.0);
+SELECT d1 * d2 FROM t1;
+d1 * d2
+0
+DROP TABLE t1;
diff --git a/mysql-test/r/type_time_hires.result b/mysql-test/r/type_time_hires.result
index d54aebbd555..bf54434a04c 100644
--- a/mysql-test/r/type_time_hires.result
+++ b/mysql-test/r/type_time_hires.result
@@ -36,7 +36,7 @@ a DIV 1
0
2003
10203
-30406
+30405
154711
select group_concat(distinct a) from t1;
group_concat(distinct a)
diff --git a/mysql-test/r/type_timestamp_hires.result b/mysql-test/r/type_timestamp_hires.result
index f5009cd2342..3f1e05f4870 100644
--- a/mysql-test/r/type_timestamp_hires.result
+++ b/mysql-test/r/type_timestamp_hires.result
@@ -28,7 +28,7 @@ a DIV 1
0
20101211002003
20101211010203
-20101211030406
+20101211030405
20101211154711
select group_concat(distinct a) from t1;
group_concat(distinct a)
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index ddb706c2c7d..ae637467ad8 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1659,6 +1659,63 @@ a
7
8
drop table t1;
+#
+# Bug#11765255 58201:
+# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+#
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+select 4
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+foo
+1
+prepare stmt1 from 'select 1 as foo
+union
+select 2
+union
+select 3
+union
+select 4
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+';
+execute stmt1;
+foo
+1
+execute stmt1;
+foo
+1
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+(select 4)
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+foo
+1
+prepare stmt1 from 'select 1 as foo
+union
+select 2
+union
+select 3
+union
+(select 4)
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+';
+execute stmt1;
+foo
+1
+execute stmt1;
+foo
+1
+deallocate prepare stmt1;
End of 5.1 tests
#
# Bug#57986 ORDER BY clause is not used after a UNION,
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index 447f2d4e460..999178a0d52 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -1144,5 +1144,23 @@ SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0)
NULL
#
+# Bug#12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
+#
+SELECT UPDATEXML('','(a)/a','');
+UPDATEXML('','(a)/a','')
+
+SELECT UPDATEXML('<a><a>x</a></a>','(a)/a','<b />');
+UPDATEXML('<a><a>x</a></a>','(a)/a','<b />')
+<a><b /></a>
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />');
+UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />')
+<a><c><a>x</a></c></a>
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />');
+UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />')
+<a><c><b /></c></a>
+SELECT ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b');
+ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b')
+aa bb
+#
# End of 5.5 tests
#
diff --git a/mysql-test/std_data/bug11747416_32228_binlog.000001 b/mysql-test/std_data/bug11747416_32228_binlog.000001
new file mode 100644
index 00000000000..2596b5b0237
--- /dev/null
+++ b/mysql-test/std_data/bug11747416_32228_binlog.000001
Binary files differ
diff --git a/mysql-test/std_data/bug57108.cnf b/mysql-test/std_data/bug57108.cnf
deleted file mode 100644
index 5fd8c485cf0..00000000000
--- a/mysql-test/std_data/bug57108.cnf
+++ /dev/null
@@ -1,95 +0,0 @@
-[mysqld]
-open-files-limit=1024
-character-set-server=latin1
-connect-timeout=4711
-log-bin-trust-function-creators=1
-key_buffer_size=1M
-sort_buffer=256K
-max_heap_table_size=1M
-loose-innodb_data_file_path=ibdata1:10M:autoextend
-loose-innodb_buffer_pool_size=8M
-loose-innodb_write_io_threads=2
-loose-innodb_read_io_threads=2
-loose-innodb_log_buffer_size=1M
-loose-innodb_log_file_size=5M
-loose-innodb_additional_mem_pool_size=1M
-loose-innodb_log_files_in_group=2
-slave-net-timeout=120
-log-bin=mysqld-bin
-loose-enable-performance-schema
-loose-performance-schema-max-mutex-instances=10000
-loose-performance-schema-max-rwlock-instances=10000
-loose-performance-schema-max-table-instances=500
-loose-performance-schema-max-table-handles=1000
-binlog-direct-non-transactional-updates
-
-[mysql]
-default-character-set=latin1
-
-[mysqlshow]
-default-character-set=latin1
-
-[mysqlimport]
-default-character-set=latin1
-
-[mysqlcheck]
-default-character-set=latin1
-
-[mysql_upgrade]
-default-character-set=latin1
-tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp
-
-[mysqld.1]
-#!run-master-sh
-log-bin=master-bin
-loose-enable-performance-schema
-basedir=/home/bzr/bugs/b57108-5.5-bugteam
-tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1
-character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
-lc-messages-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/
-datadir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/data
-pid-file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/run/mysqld.1.pid
-#host=localhost
-port=13000
-socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
-#log-error=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/log/mysqld.1.err
-general_log=1
-general_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld.log
-slow_query_log=1
-slow_query_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld-slow.log
-#user=root
-#password=
-server-id=1
-secure-file-priv=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var
-ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
-ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-cert.pem
-ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-key.pem
-
-[mysqlbinlog]
-disable-force-if-open
-character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
-
-[ENV]
-MASTER_MYPORT=13000
-MASTER_MYSOCK=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
-
-[client]
-password=
-user=root
-port=13000
-host=localhost
-socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
-
-[mysqltest]
-ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
-ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-cert.pem
-ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-key.pem
-skip-ssl=1
-
-[client.1]
-password=
-user=root
-port=13000
-host=localhost
-socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
-
diff --git a/mysql-test/std_data/latin1.xml b/mysql-test/std_data/latin1.xml
index 458b1c34da1..5884416c30e 100644
--- a/mysql-test/std_data/latin1.xml
+++ b/mysql-test/std_data/latin1.xml
@@ -3,7 +3,8 @@
<charsets>
<copyright>
- Copyright (C) 2009 Sun Microsystems, Inc
+ Copyright (c) 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</copyright>
<charset name="latin1">
diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
index 7e79186e7bc..e76f6b494f9 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
@@ -99,6 +99,8 @@ alter table t1 drop b;
create table t3 like t1;
insert into t1 select * from t3;
replace into t1 select * from t3;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
select * from t1;
a
select * from t2;
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index e8449f0cd11..17ad4c6e5b1 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -2352,6 +2352,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
UPDATE t1 SET a=1 LIMIT 1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
@@ -2368,6 +2369,7 @@ END|
CALL p1();
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
@@ -2650,4 +2652,40 @@ a
13:46:40
1970-01-12 13:46:40
DROP TABLE t1;
+CREATE TABLE filler_table (a INT, b INT);
+INSERT INTO filler_table values (1,1),(1,2);
+CREATE TABLE insert_table (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE replace_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO replace_table values (1,1),(2,2);
+CREATE TABLE update_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO update_table values (1,1),(2,2);
+INSERT IGNORE INTO insert_table SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
+TRUNCATE TABLE insert_table;
+INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
+TRUNCATE TABLE insert_table;
+REPLACE INTO replace_table SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
+UPDATE IGNORE update_table SET a=2;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
+CREATE TABLE create_ignore_test (a INT, b INT, PRIMARY KEY(b)) IGNORE SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.
+CREATE TABLE create_replace_test (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
+CREATE TEMPORARY TABLE temp1 (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.
+DROP TABLE filler_table;
+DROP TABLE insert_table;
+DROP TABLE update_table;
+DROP TABLE replace_table;
+DROP TABLE create_ignore_test;
+DROP TABLE create_replace_test;
"End of tests"
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index 9fbdc9fc2c8..c64b9197b51 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -12,6 +12,11 @@
# - insert into two autoinc columns;
# - statements using UDF's.
# - statements reading from log tables in the mysql database.
+# - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
+# - REPLACE ... SELECT
+# - CREATE TABLE [IGNORE/REPLACE] SELECT
+# - INSERT IGNORE...SELECT
+# - UPDATE IGNORE
#
# Note that statements that use stored functions, stored procedures,
# triggers, views, or prepared statements that invoke unsafe
@@ -79,6 +84,7 @@
# BUG#45785: LIMIT in SP does not cause RBL if binlog_format=MIXED
# BUG#47995: Mark user functions as unsafe
# BUG#49222: Mark RAND() unsafe
+# BUG#11758262: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE...SEL,CREATE...[IGN|REPL] SEL
#
# ==== Related test cases ====
#
@@ -700,5 +706,47 @@ INSERT INTO t1 VALUES
SELECT * FROM t1;
DROP TABLE t1;
+#
+#BUG#11758262-50439: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE..
+#The following statement may be unsafe when logged in statement format.
+#INSERT IGNORE...SELECT
+#INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
+#REPLACE ... SELECT
+#UPDATE IGNORE
+#CREATE TABLE... IGNORE SELECT
+#CREATE TABLE... REPLACE SELECT
+
+#setup tables
+CREATE TABLE filler_table (a INT, b INT);
+INSERT INTO filler_table values (1,1),(1,2);
+CREATE TABLE insert_table (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE replace_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO replace_table values (1,1),(2,2);
+CREATE TABLE update_table (a INT, b INT, PRIMARY KEY(a));
+INSERT INTO update_table values (1,1),(2,2);
+
+#INSERT IGNORE... SELECT
+INSERT IGNORE INTO insert_table SELECT * FROM filler_table;
+TRUNCATE TABLE insert_table;
+#INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
+INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1;
+TRUNCATE TABLE insert_table;
+#REPLACE...SELECT
+REPLACE INTO replace_table SELECT * FROM filler_table;
+#UPDATE IGNORE
+UPDATE IGNORE update_table SET a=2;
+#CREATE TABLE [IGNORE/REPLACE] SELECT
+CREATE TABLE create_ignore_test (a INT, b INT, PRIMARY KEY(b)) IGNORE SELECT * FROM filler_table;
+CREATE TABLE create_replace_test (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+#temporary tables should not throw the warning.
+CREATE TEMPORARY TABLE temp1 (a INT, b INT, PRIMARY KEY(b)) REPLACE SELECT * FROM filler_table;
+
+###clean up
+DROP TABLE filler_table;
+DROP TABLE insert_table;
+DROP TABLE update_table;
+DROP TABLE replace_table;
+DROP TABLE create_ignore_test;
+DROP TABLE create_replace_test;
--echo "End of tests"
diff --git a/mysql-test/suite/federated/my.cnf b/mysql-test/suite/federated/my.cnf
index 88344ae59ae..ec27e189179 100644
--- a/mysql-test/suite/federated/my.cnf
+++ b/mysql-test/suite/federated/my.cnf
@@ -3,7 +3,7 @@
!include include/default_client.cnf
[mysqld.1]
-log-bin= master-bin
+#log-bin= master-bin
[mysqld.2]
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index 7d7062c9161..a33099661aa 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -1,3 +1,121 @@
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+SET @r=REPEAT('a',500);
+CREATE TABLE t12637786(a INT,
+v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t12637786(a,v1);
+INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t12637786 SET a=1000;
+DELETE FROM t12637786;
+create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+engine=innodb row_format=dynamic;
+SET @r = repeat('a', 767);
+insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+create index ndx_a on t12963823 (a(500));
+create index ndx_b on t12963823 (b(500));
+create index ndx_c on t12963823 (c(500));
+create index ndx_d on t12963823 (d(500));
+create index ndx_e on t12963823 (e(500));
+create index ndx_f on t12963823 (f(500));
+create index ndx_k on t12963823 (k(500));
+create index ndx_l on t12963823 (l(500));
+SET @r = repeat('b', 500);
+update t12963823 set a=@r,b=@r,c=@r,d=@r;
+update t12963823 set e=@r,f=@r,g=@r,h=@r;
+update t12963823 set i=@r,j=@r,k=@r,l=@r;
+update t12963823 set m=@r,n=@r,o=@r,p=@r;
+alter table t12963823 drop index ndx_a;
+alter table t12963823 drop index ndx_b;
+create index ndx_g on t12963823 (g(500));
+create index ndx_h on t12963823 (h(500));
+create index ndx_i on t12963823 (i(500));
+create index ndx_j on t12963823 (j(500));
+create index ndx_m on t12963823 (m(500));
+create index ndx_n on t12963823 (n(500));
+create index ndx_o on t12963823 (o(500));
+create index ndx_p on t12963823 (p(500));
+show create table t12963823;
+Table Create Table
+t12963823 CREATE TABLE `t12963823` (
+ `a` blob,
+ `b` blob,
+ `c` blob,
+ `d` blob,
+ `e` blob,
+ `f` blob,
+ `g` blob,
+ `h` blob,
+ `i` blob,
+ `j` blob,
+ `k` blob,
+ `l` blob,
+ `m` blob,
+ `n` blob,
+ `o` blob,
+ `p` blob,
+ KEY `ndx_c` (`c`(500)),
+ KEY `ndx_d` (`d`(500)),
+ KEY `ndx_e` (`e`(500)),
+ KEY `ndx_f` (`f`(500)),
+ KEY `ndx_k` (`k`(500)),
+ KEY `ndx_l` (`l`(500)),
+ KEY `ndx_g` (`g`(500)),
+ KEY `ndx_h` (`h`(500)),
+ KEY `ndx_i` (`i`(500)),
+ KEY `ndx_j` (`j`(500)),
+ KEY `ndx_m` (`m`(500)),
+ KEY `ndx_n` (`n`(500)),
+ KEY `ndx_o` (`o`(500)),
+ KEY `ndx_p` (`p`(500))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+set global innodb_file_per_table=0;
+set global innodb_file_format=Antelope;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
commit;
@@ -918,6 +1036,15 @@ ERROR HY000: Too big row
alter table t1 row_format=compact;
create index t1u on t1 (u(767));
drop table t1;
+CREATE TABLE bug12547647(
+a INT NOT NULL, b BLOB NOT NULL, c TEXT,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
+COMMIT;
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+ERROR HY000: Undo log record is too big.
+DROP TABLE bug12547647;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
set global innodb_file_format_max=Antelope;
@@ -1085,3 +1212,9 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
+SELECT SLEEP(10);
+SLEEP(10)
+0
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE t12637786;
+DROP TABLE t12963823;
diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result
index a63ddff15ce..94f3bc71af1 100644
--- a/mysql-test/suite/innodb/r/innodb-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-zip.result
@@ -63,42 +63,42 @@ row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t0 Compact
-test t00 Compact
-test t1 Compact
-test t10 Dynamic
-test t11 Compressed
-test t12 Compressed
-test t13 Compressed
-test t14 Compact
-test t2 Redundant
-test t3 Compact
-test t4 Compact
-test t5 Redundant
-test t6 Redundant
-test t7 Redundant
-test t8 Compact
-test t9 Compact
+table_schema table_name row_format data_length index_length
+test t0 Compact 16384 0
+test t00 Compact 16384 0
+test t1 Compact 16384 0
+test t10 Dynamic 16384 0
+test t11 Compressed 1024 0
+test t12 Compressed 1024 0
+test t13 Compressed 8192 0
+test t14 Compact 16384 0
+test t2 Redundant 16384 0
+test t3 Compact 16384 0
+test t4 Compact 16384 0
+test t5 Redundant 16384 0
+test t6 Redundant 16384 0
+test t7 Redundant 16384 0
+test t8 Compact 16384 0
+test t9 Compact 16384 0
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Dynamic
+table_schema table_name row_format data_length index_length
+test t1 Dynamic 16384 0
alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
+table_schema table_name row_format data_length index_length
+test t1 Compact 16384 0
alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Redundant
+table_schema table_name row_format data_length index_length
+test t1 Redundant 16384 0
drop table t1;
create table t1(a int not null, b text, index(b(10))) engine=innodb
key_block_size=1;
@@ -115,11 +115,11 @@ rollback;
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t2 Compact
+table_schema table_name row_format data_length index_length
+test t1 Compressed 2048 1024
+test t2 Compact 16384 0
drop table t1,t2;
SET SESSION innodb_strict_mode = off;
CREATE TABLE t1(
@@ -207,19 +207,19 @@ create table t8 (id int primary key) engine = innodb row_format = compressed;
create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
-test t10 Compact
-test t11 Redundant
-test t3 Compressed
-test t4 Compressed
-test t5 Compressed
-test t6 Compressed
-test t7 Compressed
-test t8 Compressed
-test t9 Dynamic
+table_schema table_name row_format data_length index_length
+test t1 Compact 16384 0
+test t10 Compact 16384 0
+test t11 Redundant 16384 0
+test t3 Compressed 1024 0
+test t4 Compressed 2048 0
+test t5 Compressed 4096 0
+test t6 Compressed 8192 0
+test t7 Compressed 16384 0
+test t8 Compressed 8192 0
+test t9 Dynamic 16384 0
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb
key_block_size = 8 row_format = compressed;
@@ -246,11 +246,11 @@ Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t5 Compressed
+table_schema table_name row_format data_length index_length
+test t1 Compressed 8192 0
+test t5 Compressed 8192 0
drop table t1, t5;
create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant;
@@ -276,9 +276,9 @@ Level Code Message
Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
+table_schema table_name row_format data_length index_length
set global innodb_file_per_table = off;
create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
@@ -324,11 +324,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
+table_schema table_name row_format data_length index_length
+test t8 Compact 16384 0
+test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table = on;
set global innodb_file_format = `0`;
@@ -376,11 +376,11 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1005 Can't create table 'test.t7' (errno: 1478)
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
+table_schema table_name row_format data_length index_length
+test t8 Compact 16384 0
+test t9 Redundant 16384 0
drop table t8, t9;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb/r/innodb_bug52745.result
index d746fb427b5..74db8b0c20a 100644
--- a/mysql-test/suite/innodb/r/innodb_bug52745.result
+++ b/mysql-test/suite/innodb/r/innodb_bug52745.result
@@ -126,5 +126,4 @@ Warning 1265 Data truncated for column 'col79' at row 1
Warning 1264 Out of range value for column 'col84' at row 1
DROP TABLE bug52745;
SET GLOBAL innodb_file_format=Antelope;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_file_per_table=0;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb/r/innodb_bug53591.result
index 9d296ffdb83..cf226464a4b 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53591.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53591.result
@@ -11,5 +11,4 @@ Error 139 Too big row
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
DROP TABLE bug53591;
SET GLOBAL innodb_file_format=Antelope;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_file_per_table=0;
diff --git a/mysql-test/suite/innodb/r/innodb_bug59733.result b/mysql-test/suite/innodb/r/innodb_bug59733.result
new file mode 100644
index 00000000000..c962cdfd677
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug59733.result
@@ -0,0 +1,18 @@
+CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
+INSERT INTO bug59733 VALUES(0,'x');
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+CREATE INDEX b ON bug59733 (b);
+DELETE FROM bug59733 WHERE (a%100)=0;
+DROP INDEX b ON bug59733;
+CREATE INDEX b ON bug59733 (b);
+DROP TABLE bug59733;
diff --git a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
new file mode 100644
index 00000000000..c88e1ed2504
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
@@ -0,0 +1,81 @@
+set names utf8;
+CREATE TABLE corrupt_bit_test_Ä(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(100),
+c INT,
+z INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO corrupt_bit_test_Ä VALUES(0,'x',1, 1);
+CREATE UNIQUE INDEX idxÄ ON corrupt_bit_test_Ä(c, b);
+CREATE UNIQUE INDEX idxÄ“ ON corrupt_bit_test_Ä(z, b);
+SELECT * FROM corrupt_bit_test_Ä;
+a b c z
+1 x 1 1
+select @@unique_checks;
+@@unique_checks
+0
+select @@innodb_change_buffering_debug;
+@@innodb_change_buffering_debug
+1
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_Ä;
+select count(*) from corrupt_bit_test_Ä;
+count(*)
+1024
+CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c);
+INSERT INTO corrupt_bit_test_Ä VALUES(13000,'x',1,1);
+CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z);
+check table corrupt_bit_test_Ä;
+Table Op Msg_type Msg_text
+test.corrupt_bit_test_Ä check Warning InnoDB: The B-tree of index "idxÄ" is corrupted.
+test.corrupt_bit_test_Ä check Warning InnoDB: The B-tree of index "idxÄ“" is corrupted.
+test.corrupt_bit_test_Ä check error Corrupt
+select c from corrupt_bit_test_Ä;
+ERROR HY000: Incorrect key file for table 'corrupt_bit_test_Ä'; try to repair it
+select z from corrupt_bit_test_Ä;
+ERROR HY000: Incorrect key file for table 'corrupt_bit_test_Ä'; try to repair it
+show warnings;
+Level Code Message
+Warning 179 InnoDB: Index "idxÄ“" for table "test"."corrupt_bit_test_Ä" is marked as corrupted
+Error 1034 Incorrect key file for table 'corrupt_bit_test_Ä'; try to repair it
+insert into corrupt_bit_test_Ä values (10001, "a", 20001, 20001);
+select * from corrupt_bit_test_Ä use index(primary) where a = 10001;
+a b c z
+10001 a 20001 20001
+begin;
+insert into corrupt_bit_test_Ä values (10002, "a", 20002, 20002);
+delete from corrupt_bit_test_Ä where a = 10001;
+insert into corrupt_bit_test_Ä values (10001, "a", 20001, 20001);
+rollback;
+drop index idxÄ on corrupt_bit_test_Ä;
+check table corrupt_bit_test_Ä;
+Table Op Msg_type Msg_text
+test.corrupt_bit_test_Ä check Warning InnoDB: Index "idxÄ“" is marked as corrupted
+test.corrupt_bit_test_Ä check error Corrupt
+set names utf8;
+select z from corrupt_bit_test_Ä;
+ERROR HY000: Incorrect key file for table 'corrupt_bit_test_Ä'; try to repair it
+drop index idxÄ“ on corrupt_bit_test_Ä;
+select z from corrupt_bit_test_Ä limit 10;
+z
+20001
+1
+1
+2
+11
+12
+21
+22
+31
+32
+drop table corrupt_bit_test_Ä;
+SET GLOBAL innodb_change_buffering_debug = 0;
diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result
index 70cfc9e4f47..82b4c6fab60 100644
--- a/mysql-test/suite/innodb/r/innodb_file_format.result
+++ b/mysql-test/suite/innodb/r/innodb_file_format.result
@@ -47,4 +47,3 @@ set global innodb_file_format_max=antelope;
set global innodb_file_format_check=off;
ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
SET GLOBAL innodb_file_format=Antelope;
-SET GLOBAL innodb_file_format_max=Antelope;
diff --git a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
index b8f8fcfc749..f966574506a 100644
--- a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
+++ b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
@@ -181,5 +181,4 @@ create index idx2 on worklog5743(a(767));
drop table worklog5743;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=0;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
index 73d75241a10..3ab3b28d6b5 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
@@ -1350,5 +1350,4 @@ Warning 1071 Specified key was too long; max key length is 767 bytes
DROP TABLE worklog5743;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=0;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
index 09756954b92..abd4c243912 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
@@ -87,5 +87,4 @@ col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
DROP TABLE worklog5743;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=0;
-SET GLOBAL innodb_file_format_max=Antelope;
SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def
index 8cae44a3607..2080a009fb6 100644
--- a/mysql-test/suite/innodb/t/disabled.def
+++ b/mysql-test/suite/innodb/t/disabled.def
@@ -10,3 +10,5 @@
#
##############################################################################
+innodb-index : the fix is not in XtraDB yet
+innodb_corrupt_bit : the fix is not in XtraDB yet
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
index 6bcc901a878..7c9b7017464 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
@@ -1,8 +1,6 @@
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
-
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -33,10 +31,3 @@ SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
DROP TABLE t1;
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index 4ca761b45ce..87ca1425630 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -1,8 +1,6 @@
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
-
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -638,9 +636,3 @@ INSERT INTO t1 VALUES (18446744073709551615);
-- source include/restart_mysqld.inc
SHOW CREATE TABLE t1;
DROP TABLE t1;
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
diff --git a/mysql-test/suite/innodb/t/innodb-create-options.test b/mysql-test/suite/innodb/t/innodb-create-options.test
index 367a2f87dec..83155897349 100644
--- a/mysql-test/suite/innodb/t/innodb-create-options.test
+++ b/mysql-test/suite/innodb/t/innodb-create-options.test
@@ -60,7 +60,6 @@ SET storage_engine=InnoDB;
--disable_query_log
# These values can change during the test
LET $innodb_file_format_orig=`select @@innodb_file_format`;
-LET $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
LET $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
--enable_query_log
@@ -567,7 +566,6 @@ DROP TABLE IF EXISTS t1;
--disable_query_log
EVAL SET GLOBAL innodb_file_format=$innodb_file_format_orig;
-EVAL SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
EVAL SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
EVAL SET SESSION innodb_strict_mode=$innodb_strict_mode_orig;
--enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 86189f1426d..2402c74fe53 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -1,7 +1,126 @@
let $MYSQLD_DATADIR= `select @@datadir`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
+let $per_table=`select @@innodb_file_per_table`;
+let $format=`select @@innodb_file_format`;
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+
+# Bug #12429576 - Test an assertion failure on purge.
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+
+# This would trigger the failure (Bug #12429576)
+# if purge gets a chance to run before DROP TABLE t1_purge, ....
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+# Instead of doing a --sleep 10, wait until the rest of the tests in
+# this file complete before dropping the tables. By then, the purge thread
+# will have delt with the updates above.
+
+# Bug#12637786 - Bad assert by purge thread for records with external data
+# used in secondary indexes.
+SET @r=REPEAT('a',500);
+CREATE TABLE t12637786(a INT,
+ v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+ v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+ v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+ v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+ v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+ v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t12637786(a,v1);
+INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t12637786 SET a=1000;
+DELETE FROM t12637786;
+# We need to activate the purge thread at this point to make sure it does not
+# assert and is able to clean up the old versions of secondary index entries.
+# But instead of doing a --sleep 10, wait until the rest of the tests in
+# this file complete before dropping the table. By then, the purge thread
+# will have delt with the updates above.
+
+# Bug#12963823 - Test that the purge thread does not crash when
+# the number of indexes has changed since the UNDO record was logged.
+create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+ i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+ engine=innodb row_format=dynamic;
+SET @r = repeat('a', 767);
+insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+create index ndx_a on t12963823 (a(500));
+create index ndx_b on t12963823 (b(500));
+create index ndx_c on t12963823 (c(500));
+create index ndx_d on t12963823 (d(500));
+create index ndx_e on t12963823 (e(500));
+create index ndx_f on t12963823 (f(500));
+create index ndx_k on t12963823 (k(500));
+create index ndx_l on t12963823 (l(500));
+
+SET @r = repeat('b', 500);
+update t12963823 set a=@r,b=@r,c=@r,d=@r;
+update t12963823 set e=@r,f=@r,g=@r,h=@r;
+update t12963823 set i=@r,j=@r,k=@r,l=@r;
+update t12963823 set m=@r,n=@r,o=@r,p=@r;
+alter table t12963823 drop index ndx_a;
+alter table t12963823 drop index ndx_b;
+create index ndx_g on t12963823 (g(500));
+create index ndx_h on t12963823 (h(500));
+create index ndx_i on t12963823 (i(500));
+create index ndx_j on t12963823 (j(500));
+create index ndx_m on t12963823 (m(500));
+create index ndx_n on t12963823 (n(500));
+create index ndx_o on t12963823 (o(500));
+create index ndx_p on t12963823 (p(500));
+show create table t12963823;
+# We need to activate the purge thread at this point to see if it crashes
+# but instead of doing a --sleep 10, wait until the rest of the tests in
+# this file complete before dropping the table. By then, the purge thread
+# will have delt with the updates above.
+
+
+eval set global innodb_file_per_table=$per_table;
+eval set global innodb_file_format=$format;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
@@ -356,8 +475,6 @@ explain select * from t1 where b like 'adfd%';
# end disabled45225_1
drop table t1;
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
set global innodb_file_per_table=on;
set global innodb_file_format='Barracuda';
# Test creating a table that could lead to undo log overflow.
@@ -400,6 +517,20 @@ alter table t1 row_format=compact;
create index t1u on t1 (u(767));
drop table t1;
+
+# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
+CREATE TABLE bug12547647(
+a INT NOT NULL, b BLOB NOT NULL, c TEXT,
+PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7751));
+COMMIT;
+# The following used to cause infinite undo log allocation.
+--error ER_UNDO_RECORD_TOO_BIG
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+DROP TABLE bug12547647;
+
eval set global innodb_file_per_table=$per_table;
eval set global innodb_file_format=$format;
eval set global innodb_file_format_max=$format;
@@ -543,10 +674,8 @@ DROP TABLE t1;
#
#DROP TABLE t1;
# end disabled45225_2
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
+#this delay is needed because 45225_2 is disabled, to allow the purge to run
+SELECT SLEEP(10);
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE t12637786;
+DROP TABLE t12963823;
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test
index e28b0862166..6561feffdd4 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-zip.test
@@ -1,7 +1,6 @@
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
set session innodb_strict_mode=0;
@@ -38,19 +37,19 @@ create table t13(a int primary key) engine=innodb
row_format=compressed;
create table t14(a int primary key) engine=innodb key_block_size=9;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1;
@@ -83,7 +82,7 @@ connection default;
disconnect a;
disconnect b;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1,t2;
@@ -194,7 +193,7 @@ create table t9 (id int primary key) engine = innodb row_format = dynamic;
create table t10(id int primary key) engine = innodb row_format = compact;
create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
@@ -220,7 +219,7 @@ show warnings;
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t1, t5;
@@ -240,7 +239,7 @@ create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
show warnings;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
#test valid values with innodb_file_per_table unset
@@ -270,7 +269,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;
@@ -302,7 +301,7 @@ show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
FROM information_schema.tables WHERE engine='innodb';
drop table t8, t9;
@@ -339,5 +338,4 @@ drop table normal_table, zip_table;
-- disable_query_log
eval set global innodb_file_format=$format;
eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format_max=$innodb_file_format_max_orig;
eval set session innodb_strict_mode=$innodb_strict_mode_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug36172.test b/mysql-test/suite/innodb/t/innodb_bug36172.test
index 9269d54032d..30be4873df0 100644
--- a/mysql-test/suite/innodb/t/innodb_bug36172.test
+++ b/mysql-test/suite/innodb/t/innodb_bug36172.test
@@ -14,7 +14,6 @@ SET storage_engine=InnoDB;
-- disable_result_log
let $file_format=`select @@innodb_file_format`;
-let $file_format_max=`select @@innodb_file_format_max`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
@@ -27,5 +26,4 @@ INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.90
CHECK TABLE table0 EXTENDED;
DROP TABLE table0;
EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb_bug47167-master.opt b/mysql-test/suite/innodb/t/innodb_bug47167-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug47167-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/innodb/t/innodb_bug52745.test b/mysql-test/suite/innodb/t/innodb_bug52745.test
index 25adf5c064a..252de1e2794 100644
--- a/mysql-test/suite/innodb/t/innodb_bug52745.test
+++ b/mysql-test/suite/innodb/t/innodb_bug52745.test
@@ -1,6 +1,5 @@
let $file_format=`select @@innodb_file_format`;
-let $file_format_max=`select @@innodb_file_format_max`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
SET GLOBAL innodb_file_per_table=on;
@@ -104,5 +103,4 @@ SHOW WARNINGS;
DROP TABLE bug52745;
EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53591.test b/mysql-test/suite/innodb/t/innodb_bug53591.test
index cac39c10d30..3261779a825 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53591.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53591.test
@@ -1,6 +1,5 @@
let $file_format=`select @@innodb_file_format`;
-let $file_format_max=`select @@innodb_file_format_max`;
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_format='Barracuda';
@@ -17,5 +16,4 @@ SHOW WARNINGS;
DROP TABLE bug53591;
EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56680.test b/mysql-test/suite/innodb/t/innodb_bug56680.test
index 19ab5cfff21..1fcf55add60 100644
--- a/mysql-test/suite/innodb/t/innodb_bug56680.test
+++ b/mysql-test/suite/innodb/t/innodb_bug56680.test
@@ -5,7 +5,6 @@
SET @tx_isolation_orig = @@tx_isolation;
SET @innodb_file_per_table_orig = @@innodb_file_per_table;
SET @innodb_file_format_orig = @@innodb_file_format;
-SET @innodb_file_format_max_orig = @@innodb_file_format_max;
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
@@ -135,6 +134,5 @@ DROP TABLE bug56680;
SET GLOBAL tx_isolation = @tx_isolation_orig;
SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
SET GLOBAL innodb_file_format = @innodb_file_format_orig;
-SET GLOBAL innodb_file_format_max = @innodb_file_format_max_orig;
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug59733.test b/mysql-test/suite/innodb/t/innodb_bug59733.test
new file mode 100644
index 00000000000..0b1bff51932
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug59733.test
@@ -0,0 +1,53 @@
+#
+# Bug #59733 Possible deadlock when buffered changes are to be discarded
+# in buf_page_create
+#
+-- source include/have_innodb.inc
+
+-- disable_query_log
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 1;
+-- enable_query_log
+
+CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
+
+# Create enough rows for the table, so that the insert buffer will be
+# used. There must be multiple index pages, because changes to the
+# root page are never buffered.
+
+INSERT INTO bug59733 VALUES(0,'x');
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+INSERT INTO bug59733 SELECT 0,b FROM bug59733;
+
+# Create the secondary index for which changes will be buffered.
+CREATE INDEX b ON bug59733 (b);
+
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+DELETE FROM bug59733 WHERE (a%100)=0;
+
+# Drop the index in order to get free pages with orphaned buffered changes.
+DROP INDEX b ON bug59733;
+
+# Create the index and attempt to reuse pages for which buffered changes exist.
+CREATE INDEX b ON bug59733 (b);
+
+DROP TABLE bug59733;
+
+-- disable_query_log
+-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
new file mode 100644
index 00000000000..34991362f98
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
@@ -0,0 +1,120 @@
+#
+# Test for persistent corrupt bit for corrupted index and table
+#
+-- source include/have_innodb.inc
+
+# This test needs debug server
+--source include/have_debug.inc
+
+-- disable_query_log
+# This test setup is extracted from bug56680.test:
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 1;
+
+# Turn off Unique Check to create corrupted index with dup key
+SET UNIQUE_CHECKS=0;
+
+-- enable_query_log
+
+set names utf8;
+
+CREATE TABLE corrupt_bit_test_Ä(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b CHAR(100),
+ c INT,
+ z INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO corrupt_bit_test_Ä VALUES(0,'x',1, 1);
+
+# This is the first unique index we intend to corrupt
+CREATE UNIQUE INDEX idxÄ ON corrupt_bit_test_Ä(c, b);
+
+# This is the second unique index we intend to corrupt
+CREATE UNIQUE INDEX idxÄ“ ON corrupt_bit_test_Ä(z, b);
+
+SELECT * FROM corrupt_bit_test_Ä;
+
+select @@unique_checks;
+select @@innodb_change_buffering_debug;
+
+# Create enough rows for the table, so that the insert buffer will be
+# used for modifying the secondary index page. There must be multiple
+# index pages, because changes to the root page are never buffered.
+
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_Ä;
+INSERT INTO corrupt_bit_test_Ä SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_Ä;
+
+select count(*) from corrupt_bit_test_Ä;
+
+CREATE INDEX idx3 ON corrupt_bit_test_Ä(b, c);
+
+# Create a dup key error on index "idxÄ“" and "idxÄ" by inserting a dup value
+INSERT INTO corrupt_bit_test_Ä VALUES(13000,'x',1,1);
+
+# creating an index should succeed even if other secondary indexes are corrupted
+CREATE INDEX idx4 ON corrupt_bit_test_Ä(b, z);
+
+# Check table will find the unique indexes corrupted
+# with dup key
+check table corrupt_bit_test_Ä;
+
+# This selection intend to use the corrupted index. Expect to fail
+-- error ER_NOT_KEYFILE
+select c from corrupt_bit_test_Ä;
+
+-- error ER_NOT_KEYFILE
+select z from corrupt_bit_test_Ä;
+
+show warnings;
+
+# Since corrupted index is a secondary index, we only disable such
+# index and allow other DML to proceed
+insert into corrupt_bit_test_Ä values (10001, "a", 20001, 20001);
+
+# This does not use the corrupted index, expect to succeed
+select * from corrupt_bit_test_Ä use index(primary) where a = 10001;
+
+# Some more DMLs
+begin;
+insert into corrupt_bit_test_Ä values (10002, "a", 20002, 20002);
+delete from corrupt_bit_test_Ä where a = 10001;
+insert into corrupt_bit_test_Ä values (10001, "a", 20001, 20001);
+rollback;
+
+# Drop one corrupted index before reboot
+drop index idxÄ on corrupt_bit_test_Ä;
+
+check table corrupt_bit_test_Ä;
+
+set names utf8;
+
+-- error ER_NOT_KEYFILE
+select z from corrupt_bit_test_Ä;
+
+# Drop the corrupted index
+drop index idxÄ“ on corrupt_bit_test_Ä;
+
+# Now select back to normal
+select z from corrupt_bit_test_Ä limit 10;
+
+# Drop table
+drop table corrupt_bit_test_Ä;
+
+-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 0;
diff --git a/mysql-test/suite/innodb/t/innodb_file_format-master.opt b/mysql-test/suite/innodb/t/innodb_file_format-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_file_format-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test
index 5c80ef89ba4..115d8323050 100644
--- a/mysql-test/suite/innodb/t/innodb_file_format.test
+++ b/mysql-test/suite/innodb/t/innodb_file_format.test
@@ -1,7 +1,6 @@
-- source include/not_embedded.inc
let $innodb_file_format_orig=`select @@innodb_file_format`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
select @@innodb_file_format;
select @@innodb_file_format_check;
@@ -38,4 +37,3 @@ set global innodb_file_format_max=antelope;
set global innodb_file_format_check=off;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test b/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
index b43ff033903..2ae0237488c 100644
--- a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
+++ b/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
@@ -2,7 +2,6 @@
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
set global innodb_file_format="Barracuda";
@@ -265,5 +264,4 @@ drop table worklog5743;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
index 2ec048a0614..c702b59e81f 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
@@ -17,7 +17,6 @@
# Save innodb variables
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
# Set Innodb file format as feature works for Barracuda file format
@@ -1334,5 +1333,4 @@ DROP TABLE worklog5743;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
index eb9f3e454a2..1f54a9b253d 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
@@ -17,7 +17,6 @@
# Save innodb variables
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
# Set Innodb file format as feature works for Barracuda file format
@@ -121,6 +120,5 @@ DROP TABLE worklog5743;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
-eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/percona/disabled.def b/mysql-test/suite/percona/disabled.def
index 1dafa2e2daa..b0dc0a2a84d 100644
--- a/mysql-test/suite/percona/disabled.def
+++ b/mysql-test/suite/percona/disabled.def
@@ -15,7 +15,8 @@ percona_sql_no_fcache: Feature not merged into MariaDB
percona_status_wait_query_cache_mutex: Feature not merged into MariaDB
percona_slave_innodb_stats: Feature not merged into MariaDB
percona_query_response_time-replication: Feature not merged into MariaDB
-percona_server_variables: Feature not merged into MariaDB
+percona_server_variables_debug: Feature not merged into MariaDB
+percona_server_variables_release: Feature not merged into MariaDB
percona_slow_query_log-log_slow_verbosity: InnoDB filtering information not fully merged into MariaDB
percona_innodb_buffer_pool_shm: Requires big shmmax not default on many systems
percona_log_warnings_suppress: Feature not merged into MariaDB
diff --git a/mysql-test/suite/percona/percona_server_variables_release.test b/mysql-test/suite/percona/percona_server_variables_release.test
index f61446aeb02..b145843ab22 100644
--- a/mysql-test/suite/percona/percona_server_variables_release.test
+++ b/mysql-test/suite/percona/percona_server_variables_release.test
@@ -1,2 +1,2 @@
--source include/have_nodebug.inc
---source include/percona_server_variables.inc
+--source percona_server_variables.inc
diff --git a/mysql-test/suite/perfschema/include/cleanup_helper.inc b/mysql-test/suite/perfschema/include/cleanup_helper.inc
index b7e37849f78..7ea97ba6e92 100644
--- a/mysql-test/suite/perfschema/include/cleanup_helper.inc
+++ b/mysql-test/suite/perfschema/include/cleanup_helper.inc
@@ -1,25 +1,32 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2 of
+# the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
update performance_schema.setup_instruments set enabled='YES';
+connection con1;
disconnect con1;
+--source include/wait_until_disconnected.inc
+connection con2;
disconnect con2;
+--source include/wait_until_disconnected.inc
+connection con3;
disconnect con3;
+--source include/wait_until_disconnected.inc
connection default;
diff --git a/mysql-test/suite/perfschema/include/privilege.inc b/mysql-test/suite/perfschema/include/privilege.inc
index f29ef65f519..0de948d369b 100644
--- a/mysql-test/suite/perfschema/include/privilege.inc
+++ b/mysql-test/suite/perfschema/include/privilege.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc
index f6e549ea44e..e48bbba4d40 100644
--- a/mysql-test/suite/perfschema/include/start_server_common.inc
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2009 Sun Microsystems, Inc
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
index 3620e80002f..d8dc750bd39 100644
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,14 +11,16 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Routine to be called by pfs_upgrade.test
# $out_file and $err_file must be set within pfs_upgrade.test.
#
+--source include/count_sessions.inc
--error 1
--exec $MYSQL_UPGRADE --skip-verbose --force > $out_file 2> $err_file
+--source include/wait_until_count_sessions.inc
# Verify that mysql_upgrade complained about the performance_schema
--cat_file $err_file
diff --git a/mysql-test/suite/perfschema/r/all_instances.result b/mysql-test/suite/perfschema/r/all_instances.result
index 59b7232dc15..356ffda13c1 100644
--- a/mysql-test/suite/perfschema/r/all_instances.result
+++ b/mysql-test/suite/perfschema/r/all_instances.result
@@ -1,5 +1,5 @@
use performance_schema;
-select name from mutex_instances group by name;
+select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex|LOCK_des_key_file)$' group by name;
name
wait/synch/mutex/archive/archive_mutex
wait/synch/mutex/aria/LOCK_trn_list
@@ -32,7 +32,6 @@ wait/synch/mutex/mysys/THR_LOCK_open
wait/synch/mutex/mysys/THR_LOCK_threads
wait/synch/mutex/mysys/TMPDIR_mutex
wait/synch/mutex/sql/Cversion_lock
-wait/synch/mutex/sql/DEBUG_SYNC::mutex
wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state
wait/synch/mutex/sql/hash_filo::lock
wait/synch/mutex/sql/LOCK_active_mi
@@ -43,7 +42,6 @@ wait/synch/mutex/sql/LOCK_crypt
wait/synch/mutex/sql/LOCK_delayed_create
wait/synch/mutex/sql/LOCK_delayed_insert
wait/synch/mutex/sql/LOCK_delayed_status
-wait/synch/mutex/sql/LOCK_des_key_file
wait/synch/mutex/sql/LOCK_error_log
wait/synch/mutex/sql/LOCK_error_messages
wait/synch/mutex/sql/LOCK_event_queue
@@ -100,7 +98,7 @@ wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for
wait/synch/rwlock/sql/MDL_lock::rwlock
wait/synch/rwlock/sql/THR_LOCK_servers
wait/synch/rwlock/sql/THR_LOCK_udf
-select name from cond_instances group by name;
+select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
name
wait/synch/cond/aria/SERVICE_THREAD_CONTROL::COND_control
wait/synch/cond/aria/TRANSLOG_BUFFER::prev_sent_to_disk_cond
@@ -117,7 +115,6 @@ wait/synch/cond/sql/COND_rpl_status
wait/synch/cond/sql/COND_server_started
wait/synch/cond/sql/COND_thread_cache
wait/synch/cond/sql/COND_thread_count
-wait/synch/cond/sql/DEBUG_SYNC::cond
wait/synch/cond/sql/Event_scheduler::COND_state
wait/synch/cond/sql/Master_info::data_cond
wait/synch/cond/sql/Master_info::start_cond
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index e2f8270b1f0..0a7d0a5b2be 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -52,10 +52,11 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
-wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect no slave relay log"
@@ -68,9 +69,10 @@ EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_W
wait/io/file/sql/relaylog 0 0 0 0
wait/io/file/sql/relaylog_index 0 0 0 0
select * from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
"============ Performance schema on slave ============"
select * from performance_schema.file_summary_by_instance
@@ -123,10 +125,11 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR
wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
-wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
"Expect a slave relay log"
@@ -162,8 +165,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
-where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
EVENT_NAME COUNT_STAR
-wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond MANY
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/r/selects.result b/mysql-test/suite/perfschema/r/selects.result
index a3d0931cf4c..4c59cc3338e 100644
--- a/mysql-test/suite/perfschema/r/selects.result
+++ b/mysql-test/suite/perfschema/r/selects.result
@@ -62,6 +62,7 @@ SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
+ON COMPLETION PRESERVE
DO INSERT INTO t_event
SELECT DISTINCT EVENT_ID
FROM performance_schema.events_waits_current
@@ -106,5 +107,6 @@ EVENT_ID
[EVENT_ID]
DROP PROCEDURE t_ps_proc;
DROP FUNCTION t_ps_func;
+DROP EVENT t_ps_event;
DROP TABLE t1;
DROP TABLE t_event;
diff --git a/mysql-test/suite/perfschema/t/all_instances.test b/mysql-test/suite/perfschema/t/all_instances.test
index eb011b2d5c7..5fe1a347a2d 100644
--- a/mysql-test/suite/perfschema/t/all_instances.test
+++ b/mysql-test/suite/perfschema/t/all_instances.test
@@ -15,8 +15,8 @@ use performance_schema;
# "where" filters out instances that can be conditionally compiled out
#
-select name from mutex_instances group by name;
+select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex|LOCK_des_key_file)$' group by name;
select name from rwlock_instances group by name;
-select name from cond_instances group by name;
+select name from cond_instances where name not rlike '/(DEBUG_SYNC::cond)$' group by name;
select event_name from file_instances group by event_name;
select name from threads group by name;
diff --git a/mysql-test/suite/perfschema/t/cnf_option.cnf b/mysql-test/suite/perfschema/t/cnf_option.cnf
index 2892908fbb6..2be42791fb6 100644
--- a/mysql-test/suite/perfschema/t/cnf_option.cnf
+++ b/mysql-test/suite/perfschema/t/cnf_option.cnf
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Tests for PERFORMANCE_SCHEMA
# Check server start options, read from a .cnf file
diff --git a/mysql-test/suite/perfschema/t/disabled.def b/mysql-test/suite/perfschema/t/disabled.def
index 56bcf811ff6..c9f3b9a97e0 100644
--- a/mysql-test/suite/perfschema/t/disabled.def
+++ b/mysql-test/suite/perfschema/t/disabled.def
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
#
diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test
index 68ba57dd502..e2798e9b707 100644
--- a/mysql-test/suite/perfschema/t/relaylog.test
+++ b/mysql-test/suite/perfschema/t/relaylog.test
@@ -41,6 +41,8 @@ drop table test.t1;
# To ensure robustness:
# - log file rotation is limited to file .000001 and .000002
# - statistics are normalized to "NONE" or "MANY"
+# - statistics on ::update_cond conditions are not collected,
+# since this is too much dependent on execution.
#
connection master;
@@ -84,7 +86,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+ where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
-- echo "Expect no slave relay log"
@@ -95,7 +99,9 @@ select * from performance_schema.file_summary_by_event_name
where event_name like "%relaylog%" order by event_name;
select * from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+ where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
sync_slave_with_master;
-- echo "============ Performance schema on slave ============"
@@ -142,7 +148,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+ where event_name like "%MYSQL_BIN_LOG%"
+ and event_name not like "%MYSQL_BIN_LOG::update_cond"
+ order by event_name;
-- echo "Expect a slave relay log"
@@ -173,7 +181,9 @@ select
EVENT_NAME,
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
from performance_schema.events_waits_summary_global_by_event_name
- where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+ where event_name like "%MYSQL_RELAY_LOG%"
+ and event_name not like "%MYSQL_RELAY_LOG::update_cond"
+ order by event_name;
--source include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/t/selects.test b/mysql-test/suite/perfschema/t/selects.test
index e8fd0827c53..e4541d6c6fc 100644
--- a/mysql-test/suite/perfschema/t/selects.test
+++ b/mysql-test/suite/perfschema/t/selects.test
@@ -1,4 +1,4 @@
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -97,6 +97,7 @@ SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
+ON COMPLETION PRESERVE
DO INSERT INTO t_event
SELECT DISTINCT EVENT_ID
FROM performance_schema.events_waits_current
@@ -168,7 +169,7 @@ delimiter ;|
SELECT t_ps_func(connection_id()) = @p_id;
# We might reach this point too early which means the event scheduler has not
-# execute our "t_ps_event". Therefore we poll till the record was inserted
+# executed our "t_ps_event". Therefore we poll till the record was inserted
# and run our test statement afterwards.
let $wait_timeout= 20;
let $wait_condition= SELECT COUNT(*) = 1 FROM t_event;
@@ -179,5 +180,6 @@ SELECT * FROM t_event;
# Clean up
DROP PROCEDURE t_ps_proc;
DROP FUNCTION t_ps_func;
+DROP EVENT t_ps_event;
DROP TABLE t1;
DROP TABLE t_event;
diff --git a/mysql-test/suite/perfschema_stress/README b/mysql-test/suite/perfschema_stress/README
index 53f6f1daf35..d28287f9735 100644
--- a/mysql-test/suite/perfschema_stress/README
+++ b/mysql-test/suite/perfschema_stress/README
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
WL#4818 - Stress testing of PERFORMANCE_SCHEMA
diff --git a/mysql-test/suite/perfschema_stress/include/settings.inc b/mysql-test/suite/perfschema_stress/include/settings.inc
index fb886a86df2..224cb54a8aa 100644
--- a/mysql-test/suite/perfschema_stress/include/settings.inc
+++ b/mysql-test/suite/perfschema_stress/include/settings.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
let $num_stress_rows= 5000;
let $default_engine_type= myisam;
diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result
new file mode 100644
index 00000000000..1bee6f2ec1a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+include/rpl_stop_server.inc [server_number=1]
+include/rpl_start_server.inc [server_number=1]
+show binlog events;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+stop slave;
+reset slave;
+start slave;
+include/wait_for_slave_param.inc [Last_IO_Errno]
+Last_IO_Errno = '1236'
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from 'master-bin.000001' at 316, the last byte read was read from 'master-bin.000001' at 335.''
+reset master;
+stop slave;
+reset slave;
+drop table t;
+End of the tests
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
index 7b483c7a9e9..b6b1210f05f 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */;
set @@global.debug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the last event was read from 'master-bin.000010' at 245, the last byte read was read from 'master-bin.000010' at 245.''
select count(*) as zero from t1;
zero
0
diff --git a/mysql-test/suite/rpl/r/rpl_insert_duplicate.result b/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
deleted file mode 100644
index 61ebbaaa5a9..00000000000
--- a/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
+++ /dev/null
@@ -1,29 +0,0 @@
-include/master-slave.inc
-[connection master]
-CREATE TABLE t1 (
-a INT UNSIGNED NOT NULL PRIMARY KEY
-) ENGINE=innodb;
-CREATE TABLE t2 (
-a INT UNSIGNED
-) ENGINE=innodb;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
-include/assert.inc [Sum of elements in t1 should be 1.]
-include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
-include/diff_tables.inc [master:test.t1 , slave:test.t1]
-drop table t1, t2;
-CREATE TABLE t1 (
-a INT UNSIGNED NOT NULL PRIMARY KEY
-) ENGINE=myisam;
-CREATE TABLE t2 (
-a INT UNSIGNED
-) ENGINE=myisam;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
-include/assert.inc [Sum of elements in t1 should be 1.]
-include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
-include/diff_tables.inc [master:test.t1 , slave:test.t1]
-drop table t1, t2;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
index 04b64359126..1598b3c059f 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
@@ -26,6 +26,19 @@ include/diff_tables.inc [master:test.t1 , slave:test.t1]
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
include/assert.inc [Count of elements in t1 should be 6.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+DROP TABLE t1;
+DROP TABLE t2;
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=innodb;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=innodb;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
drop table t1, t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
@@ -52,5 +65,18 @@ include/diff_tables.inc [master:test.t1 , slave:test.t1]
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
include/assert.inc [Count of elements in t1 should be 6.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+DROP TABLE t1;
+DROP TABLE t2;
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=myisam;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=myisam;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
drop table t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_select.result b/mysql-test/suite/rpl/r/rpl_insert_select.result
deleted file mode 100644
index d98ae2538fa..00000000000
--- a/mysql-test/suite/rpl/r/rpl_insert_select.result
+++ /dev/null
@@ -1,14 +0,0 @@
-include/master-slave.inc
-[connection master]
-create table t1 (n int not null primary key);
-insert into t1 values (1);
-create table t2 (n int);
-insert into t2 values (1);
-insert ignore into t1 select * from t2;
-insert into t1 values (2);
-select * from t1;
-n
-1
-2
-drop table t1,t2;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index 43f5c082dea..7857ba95209 100644
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
include/master-slave.inc
[connection master]
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
@@ -42,12 +43,16 @@ SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
INSERT INTO t1 (field_1, field_2, field_3)
SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
SELECT * FROM t1;
id field_1 field_2 field_3
1 1 a 1a
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 58d0e202110..29b11f4b950 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -11,7 +11,7 @@ include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS;
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at 247, the last byte read was read from 'master-bin.000001' at 266.''
include/stop_slave_sql.inc
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
index 23238d9c97b..a1874ed1595 100644
--- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
+++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
@@ -5,7 +5,7 @@ CREATE TABLE t1(c1 INT);
FLUSH LOGS;
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the last event was read from 'master-bin.000002' at 375, the last byte read was read from 'master-bin.000002' at 375.''
CREATE TABLE t2(c1 INT);
FLUSH LOGS;
CREATE TABLE t3(c1 INT);
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 6190f458367..be2f551f9c2 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -37,7 +37,7 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at 601, the last byte read was read from 'master-bin.000001' at 620.''
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
diff --git a/mysql-test/suite/rpl/r/rpl_row_corruption.result b/mysql-test/suite/rpl/r/rpl_row_corruption.result
new file mode 100644
index 00000000000..7fd47a20f03
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_corruption.result
@@ -0,0 +1,49 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004 (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004 VALUES (2);
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
+include/wait_for_slave_sql_error.inc [errno=1593 ]
+include/stop_slave.inc
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+DROP TABLE t1_11753004, t2_11753004;
+include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004_ign (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004_ign VALUES (2);
+UPDATE t1_11753004, t2_11753004_ign SET t1_11753004.c1=3, t2_11753004_ign.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004_ign.c1=2;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+ERROR HY000: Fatal error: Found table map event mapping table id 0 which was already mapped but with different settings.
+DROP TABLE t1,t2;
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+DROP TABLE t1_11753004;
+DROP TABLE t2_11753004_ign;
+SET GLOBAL debug= @save_debug;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index 7dc94bab481..41fe0b1a9f3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
+reset slave;
+include/start_slave.inc
+include/stop_slave.inc
+reset slave all;
+start slave;
+ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
+include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index aa8bc63a432..b1473c937a1 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
+reset slave;
+include/start_slave.inc
+include/stop_slave.inc
+reset slave all;
+start slave;
+ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
+include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
new file mode 100644
index 00000000000..71445be55e6
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test
@@ -0,0 +1,64 @@
+#
+# Bug#11747416 : 32228 A disk full makes binary log corrupt.
+#
+#
+# The test demonstrates reading from binlog error propagation to slave
+# and reporting there.
+# Conditions for the bug include a crash at time of the last event to
+# the binlog was written partly. With the fixes the event is not sent out
+# any longer, but rather the dump thread sends out a sound error message.
+#
+# Crash is not simulated. A binlog with partly written event in its end is installed
+# and replication is started from it.
+#
+
+--source include/master-slave.inc
+--source include/have_binlog_format_mixed.inc
+
+call mtr.add_suppression("Error in Log_event::read_log_event()");
+
+--connection master
+--let $datadir= `SELECT @@datadir`
+
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
+--remove_file $datadir/master-bin.000001
+--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
+--source include/wait_until_connected_again.inc
+
+# evidence of the partial binlog
+--error ER_ERROR_WHEN_EXECUTING_COMMAND
+show binlog events;
+
+--connection slave
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
+stop slave;
+reset slave;
+start slave;
+
+# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+--let $slave_param=Last_IO_Errno
+--let $slave_param_value=1236
+--source include/wait_for_slave_param.inc
+
+--let $status_items= Last_IO_Errno, Last_IO_Error
+--source include/show_slave_status.inc
+
+#
+# Cleanup
+#
+
+--connection master
+reset master;
+
+--connection slave
+stop slave;
+reset slave;
+drop table t; # table was created from binlog. it does not exist on master.
+
+--echo End of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_insert_duplicate.test b/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
deleted file mode 100644
index 7dd38a696ae..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
+++ /dev/null
@@ -1,14 +0,0 @@
-#########################################
-# Wrapper for rpl_insert_duplicate.test #
-#########################################
--- source include/master-slave.inc
--- source include/have_innodb.inc
-#-- source include/have_binlog_format_mixed_or_statement.inc
-
-let $engine_type=innodb;
--- source extra/rpl_tests/rpl_insert_duplicate.test
-
-let $engine_type=myisam;
--- source extra/rpl_tests/rpl_insert_duplicate.test
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_select.test b/mysql-test/suite/rpl/t/rpl_insert_select.test
deleted file mode 100644
index 23bc7ecd167..00000000000
--- a/mysql-test/suite/rpl/t/rpl_insert_select.test
+++ /dev/null
@@ -1,20 +0,0 @@
-# Testcase for BUG#10456 - INSERT INTO ... SELECT violating a primary key
-# breaks replication
-
--- source include/master-slave.inc
-connection master;
-
-create table t1 (n int not null primary key);
-insert into t1 values (1);
-create table t2 (n int);
-insert into t2 values (1);
-insert ignore into t1 select * from t2;
-insert into t1 values (2);
-sync_slave_with_master;
-connection slave;
-select * from t1;
-
-connection master;
-drop table t1,t2;
-sync_slave_with_master;
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
index db182d477a1..87c492e7f22 100644
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
@@ -3,14 +3,15 @@
# (assuming the bug is fixed in the slave, slave cannot of course
# imitate the bug, so it has to stop).
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+
source include/have_debug.inc;
# because of pretend_version_50034_in_binlog the test can't run with checksum
source include/have_binlog_checksum_off.inc;
source include/master-slave.inc;
# Currently only statement-based-specific bugs are here
--- source include/have_binlog_format_mixed_or_statement.inc
-
+-- source include/have_binlog_format_statement.inc
#
# This is to test that slave properly detects if
diff --git a/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt b/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt
new file mode 100644
index 00000000000..da199510eb3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt
@@ -0,0 +1 @@
+--replicate-ignore-table=test.t2_11753004_ign
diff --git a/mysql-test/suite/rpl/t/rpl_row_corruption.test b/mysql-test/suite/rpl/t/rpl_row_corruption.test
new file mode 100644
index 00000000000..a7650c615a3
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption.test
@@ -0,0 +1,115 @@
+#
+--source include/master-slave.inc
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+
+# BUG#11753004: 44360: REPLICATION FAILED
+
+## assert that we get an error when checking the
+## identifiers at the slave (instead of a crash or
+## different table being updated)
+
+--let $t1= t1_11753004
+--let $t2= t2_11753004
+--let $t2_ign= t2_11753004_ign
+
+## test #1: assert that we get an error raised when multiple
+## tables in the same RBR statement are mapped with the
+## same identifier
+
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2 (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2 VALUES (2)
+
+--sync_slave_with_master
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+
+# stop the slave and inject corruption
+--source include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+# both tables get mapped to 0 (in a way, simulating scenario
+# originated by BUG#56226)
+--eval UPDATE $t1, $t2 SET $t1.c1=3, $t2.c1=4 WHERE $t1.c1=1 OR $t2.c1=2
+--connection slave
+
+# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
+--let $slave_sql_errno=1593
+--source include/wait_for_slave_sql_error.inc
+--source include/stop_slave.inc
+
+# clean up
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+--source include/rpl_reset.inc
+--eval DROP TABLE $t1, $t2
+--sync_slave_with_master
+
+## test #2: assert that ignored tables that may have been mapped
+## with the same identifier are skipped, thus no error
+## is raised.
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--source include/rpl_reset.inc
+--connection master
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2_ign (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2_ign VALUES (2)
+--eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2
+
+# must not raise error as second table is filtered
+--sync_slave_with_master
+
+
+## test #3: check that BINLOG statements will also raise an
+## error if containing table map events mapping different
+## tables to same table identifier.
+
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# FD event
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+
+#110708 12:21:44 server id 1 end_log_pos 774 Table_map: `test`.`t1` mapped to number 66
+# at 774
+#110708 12:21:44 server id 1 end_log_pos 815 Table_map: `test`.`t2` mapped to number 67
+# at 815
+#110708 12:21:44 server id 1 end_log_pos 855 Update_rows: table id 66
+# at 855
+#110708 12:21:44 server id 1 end_log_pos 895 Update_rows: table id 67 flags: STMT_END_F
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--error ER_SLAVE_FATAL_ERROR
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+
+
+# clean up
+DROP TABLE t1,t2;
+--connection slave
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--connection master
+--eval DROP TABLE $t1
+--eval DROP TABLE $t2_ign
+--sync_slave_with_master
+SET GLOBAL debug= @save_debug;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/stress/t/wrapper.test b/mysql-test/suite/stress/t/wrapper.test
new file mode 100644
index 00000000000..4d2dd808a4c
--- /dev/null
+++ b/mysql-test/suite/stress/t/wrapper.test
@@ -0,0 +1,29 @@
+#
+# This is a wrapper "pseudo" test for mtr --stress execution.
+# It should not be run directly (will be skipped)
+# Do not create a result file!
+#
+
+if (!$MST_OPTIONS) {
+ skip Only to be run with mtr --stress;
+}
+
+# echo Running MST with options $MST_OPTIONS;
+
+perl;
+ my ($mtest)= split " ", $ENV{MYSQL_TEST};
+ open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mtest.inc") or die;
+ print FILE "let \$MYSQLTEST_BIN= $mtest;\n";
+ close FILE;
+EOF
+
+--source $MYSQL_TMP_DIR/mtest.inc
+--remove_file $MYSQL_TMP_DIR/mtest.inc
+
+exec perl mysql-stress-test.pl --mysqltest=$MYSQLTEST_BIN
+ --server-port=$MASTER_MYPORT --server-socket=$MASTER_MYSOCK
+ --server-user=root --cleanup
+ --server-logs-dir=$MYSQLTEST_VARDIR/log
+ --stress-basedir=$MYSQLTEST_VARDIR
+ $MST_OPTIONS
+;
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
index c59e1b802f4..9167585f1d6 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_format_check_basic.result
@@ -1,59 +1,80 @@
-SET @start_global_value = @@global.innodb_file_format_max;
+SET @start_global_value = @@global.innodb_file_format_check;
SELECT @start_global_value;
@start_global_value
-Antelope
-Valid values are 'Antelope' and 'Barracuda'
-select @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
-@@global.innodb_file_format_max in ('Antelope', 'Barracuda')
-1
-select @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Antelope
-select @@session.innodb_file_format_max;
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable
-show global variables like 'innodb_file_format_max';
+1
+Valid values are 'ON' and 'OFF'
+SELECT @@global.innodb_file_format_check in (0, 1);
+@@global.innodb_file_format_check in (0, 1)
+1
+SELECT @@global.innodb_file_format_check;
+@@global.innodb_file_format_check
+1
+SELECT @@session.innodb_file_format_check;
+ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_file_format_check';
Variable_name Value
-innodb_file_format_max Antelope
-show session variables like 'innodb_file_format_max';
+innodb_file_format_check ON
+SHOW session variables LIKE 'innodb_file_format_check';
Variable_name Value
-innodb_file_format_max Antelope
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-set global innodb_file_format_max='Antelope';
-select @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Antelope
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Antelope
-set @@global.innodb_file_format_max='Barracuda';
-select @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Barracuda
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
+innodb_file_format_check ON
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_check';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
+INNODB_FILE_FORMAT_CHECK ON
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_check';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX Barracuda
-set session innodb_file_format_max='Salmon';
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
-set @@session.innodb_file_format_max='Salmon';
-ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_file_format_max=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
-set global innodb_file_format_max=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
-set global innodb_file_format_max='Salmon';
-ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon'
-SET @@global.innodb_file_format_max = @start_global_value;
-SELECT @@global.innodb_file_format_max;
-@@global.innodb_file_format_max
-Antelope
+INNODB_FILE_FORMAT_CHECK ON
+SET @@global.innodb_file_format_check='Off';
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET @@global.innodb_file_format_check=1;
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET @@global.innodb_file_format_check=0;
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET @@global.innodb_file_format_check='On';
+ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Expected error 'Read only variable'
+SET session innodb_large_prefix='OFF';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.innodb_stats_on_metadata='ON';
+ERROR HY000: Variable 'innodb_stats_on_metadata' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+COUNT(@@GLOBAL.innodb_file_format_check)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_file_format_check = @@GLOBAL.innodb_file_format_check;
+@@innodb_file_format_check = @@GLOBAL.innodb_file_format_check
+1
+1 Expected
+SELECT COUNT(@@innodb_file_format_check);
+COUNT(@@innodb_file_format_check)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_file_format_check);
+ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_file_format_check);
+ERROR HY000: Variable 'innodb_file_format_check' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+COUNT(@@GLOBAL.innodb_file_format_check)
+1
+1 Expected
+SELECT innodb_file_format_check = @@SESSION.innodb_file_format_check;
+ERROR 42S22: Unknown column 'innodb_file_format_check' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
index d9d067c2cf9..32b2262c091 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
@@ -1 +1,65 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_file_format_max;
+SELECT @start_global_value;
+@start_global_value
+Antelope
+Valid values are 'Antelope' and 'Barracuda'
+SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
+@@global.innodb_file_format_max in ('Antelope', 'Barracuda')
+1
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Antelope
+SELECT @@session.innodb_file_format_max;
+ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_file_format_max';
+Variable_name Value
+innodb_file_format_max Antelope
+SHOW session variables LIKE 'innodb_file_format_max';
+Variable_name Value
+innodb_file_format_max Antelope
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SET global innodb_file_format_max='Antelope';
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Antelope
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Antelope
+SET @@global.innodb_file_format_max='Barracuda';
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Barracuda
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Barracuda
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FILE_FORMAT_MAX Barracuda
+SET session innodb_file_format_max='Salmon';
+ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.innodb_file_format_max='Salmon';
+ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_file_format_max=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
+SET global innodb_file_format_max=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
+SET global innodb_file_format_max='Salmon';
+ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon'
+SET @@global.innodb_file_format_max = @start_global_value;
+SELECT @@global.innodb_file_format_max;
+@@global.innodb_file_format_max
+Antelope
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
index 163eb31f686..ecf11351cd9 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
@@ -1,13 +1,29 @@
+SET @start_global_value = @@global.innodb_file_per_table;
+SELECT @start_global_value;
+@start_global_value
+0
'#---------------------BS_STVARS_028_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_file_per_table);
COUNT(@@GLOBAL.innodb_file_per_table)
1
1 Expected
'#---------------------BS_STVARS_028_02----------------------#'
-SELECT COUNT(@@GLOBAL.innodb_file_per_table);
-COUNT(@@GLOBAL.innodb_file_per_table)
+SET @@global.innodb_file_per_table = 0;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+0
+SET @@global.innodb_file_per_table ='On' ;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+1
+SET @@global.innodb_file_per_table ='Off' ;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+0
+SET @@global.innodb_file_per_table = 1;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
1
-1 Expected
'#---------------------BS_STVARS_028_03----------------------#'
SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -47,4 +63,7 @@ COUNT(@@GLOBAL.innodb_file_per_table)
1 Expected
SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
ERROR 42S22: Unknown column 'innodb_file_per_table' in 'field list'
-Expected error 'Readonly variable'
+SET @@global.innodb_file_per_table = @start_global_value;
+SELECT @@global.innodb_file_per_table;
+@@global.innodb_file_per_table
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result b/mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result
new file mode 100644
index 00000000000..bc9b7019eb8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_force_load_corrupted_basic.result
@@ -0,0 +1,53 @@
+'#---------------------BS_STVARS_031_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+'#---------------------BS_STVARS_031_02----------------------#'
+SET @@GLOBAL.innodb_force_load_corrupted=1;
+ERROR HY000: Variable 'innodb_force_load_corrupted' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+'#---------------------BS_STVARS_031_03----------------------#'
+SELECT IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_031_04----------------------#'
+SELECT @@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted;
+@@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted
+1
+1 Expected
+'#---------------------BS_STVARS_031_05----------------------#'
+SELECT COUNT(@@innodb_force_load_corrupted);
+COUNT(@@innodb_force_load_corrupted)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_force_load_corrupted);
+ERROR HY000: Variable 'innodb_force_load_corrupted' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_force_load_corrupted);
+ERROR HY000: Variable 'innodb_force_load_corrupted' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+COUNT(@@GLOBAL.innodb_force_load_corrupted)
+1
+1 Expected
+SELECT innodb_force_load_corrupted = @@SESSION.innodb_force_load_corrupted;
+ERROR 42S22: Unknown column 'innodb_force_load_corrupted' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
index d9d067c2cf9..adb56b347cd 100644
--- a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
@@ -1 +1,92 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_large_prefix;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_large_prefix in (0, 1);
+@@global.innodb_large_prefix in (0, 1)
+1
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select @@session.innodb_large_prefix;
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable
+show global variables like 'innodb_large_prefix';
+Variable_name Value
+innodb_large_prefix OFF
+show session variables like 'innodb_large_prefix';
+Variable_name Value
+innodb_large_prefix OFF
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+set global innodb_large_prefix='OFF';
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+set @@global.innodb_large_prefix=1;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+set global innodb_large_prefix=0;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX OFF
+set @@global.innodb_large_prefix='ON';
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+set session innodb_large_prefix='OFF';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_large_prefix='ON';
+ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_large_prefix=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
+set global innodb_large_prefix=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
+set global innodb_large_prefix=2;
+ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '2'
+NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_large_prefix=-3;
+select @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+1
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LARGE_PREFIX ON
+set global innodb_large_prefix='AUTO';
+ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO'
+SET @@global.innodb_large_prefix = @start_global_value;
+SELECT @@global.innodb_large_prefix;
+@@global.innodb_large_prefix
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
index 89960e5860f..1dcc2d554ce 100644
--- a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
@@ -1,13 +1,21 @@
+SET @start_global_value=@@global.innodb_lock_wait_timeout;
+SELECT @start_global_value;
+@start_global_value
+50
'#---------------------BS_STVARS_032_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
COUNT(@@GLOBAL.innodb_lock_wait_timeout)
1
1 Expected
'#---------------------BS_STVARS_032_02----------------------#'
-SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
-COUNT(@@GLOBAL.innodb_lock_wait_timeout)
-1
-1 Expected
+SET global innodb_lock_wait_timeout=60;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+60
+SET session innodb_lock_wait_timeout=60;
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+60
'#---------------------BS_STVARS_032_03----------------------#'
SELECT @@GLOBAL.innodb_lock_wait_timeout = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -47,4 +55,7 @@ COUNT(@@GLOBAL.innodb_lock_wait_timeout)
1 Expected
SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
ERROR 42S22: Unknown column 'innodb_lock_wait_timeout' in 'field list'
-Expected error 'Readonly variable'
+SET @@global.innodb_lock_wait_timeout = @start_global_value;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+50
diff --git a/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result b/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result
new file mode 100644
index 00000000000..d627aa92ba7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result
@@ -0,0 +1,92 @@
+SET @start_global_value = @@global.innodb_random_read_ahead;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_random_read_ahead in (0, 1);
+@@global.innodb_random_read_ahead in (0, 1)
+1
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
+select @@session.innodb_random_read_ahead;
+ERROR HY000: Variable 'innodb_random_read_ahead' is a GLOBAL variable
+show global variables like 'innodb_random_read_ahead';
+Variable_name Value
+innodb_random_read_ahead OFF
+show session variables like 'innodb_random_read_ahead';
+Variable_name Value
+innodb_random_read_ahead OFF
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+set global innodb_random_read_ahead='ON';
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+1
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+set @@global.innodb_random_read_ahead=0;
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+set global innodb_random_read_ahead=1;
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+1
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+set @@global.innodb_random_read_ahead='OFF';
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD OFF
+set session innodb_random_read_ahead='OFF';
+ERROR HY000: Variable 'innodb_random_read_ahead' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_random_read_ahead='ON';
+ERROR HY000: Variable 'innodb_random_read_ahead' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_random_read_ahead=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_random_read_ahead'
+set global innodb_random_read_ahead=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_random_read_ahead'
+set global innodb_random_read_ahead=2;
+ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of '2'
+NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_random_read_ahead=-3;
+select @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+1
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_RANDOM_READ_AHEAD ON
+set global innodb_random_read_ahead='AUTO';
+ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of 'AUTO'
+SET @@global.innodb_random_read_ahead = @start_global_value;
+SELECT @@global.innodb_random_read_ahead;
+@@global.innodb_random_read_ahead
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result b/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result
index d9d067c2cf9..a8d392eee38 100644
--- a/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_rollback_segments_basic.result
@@ -1 +1,64 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_rollback_segments;
+SELECT @start_global_value;
+@start_global_value
+128
+Valid values are zero or above
+SELECT @@global.innodb_rollback_segments >=0;
+@@global.innodb_rollback_segments >=0
+1
+SELECT @@global.innodb_rollback_segments <=128;
+@@global.innodb_rollback_segments <=128
+1
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+128
+SELECT @@session.innodb_rollback_segments;
+ERROR HY000: Variable 'innodb_rollback_segments' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_rollback_segments';
+Variable_name Value
+innodb_rollback_segments 128
+SHOW session variables LIKE 'innodb_rollback_segments';
+Variable_name Value
+innodb_rollback_segments 128
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 128
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 128
+SET global innodb_rollback_segments=100;
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+100
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 100
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 100
+SET session innodb_rollback_segments=1;
+ERROR HY000: Variable 'innodb_rollback_segments' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_rollback_segments=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
+SET global innodb_rollback_segments=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
+SET global innodb_rollback_segments="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_rollback_segments'
+SET global innodb_rollback_segments=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_rollback_segments value: '-7'
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ROLLBACK_SEGMENTS 1
+SET @@global.innodb_rollback_segments = @start_global_value;
+SELECT @@global.innodb_rollback_segments;
+@@global.innodb_rollback_segments
+128
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result
index d9d067c2cf9..6599ca9edb6 100644
--- a/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_method_basic.result
@@ -1 +1,83 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_stats_method;
+SELECT @start_global_value;
+@start_global_value
+nulls_equal
+Valid values are 'nulls_equal', 'nulls_unequal', 'nulls_ignored'
+SELECT @@global.innodb_stats_method in ('nulls_equal', 'nulls_unequal',
+'nulls_ignored');
+@@global.innodb_stats_method in ('nulls_equal', 'nulls_unequal',
+'nulls_ignored')
+1
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_equal
+SELECT @@session.innodb_stats_method;
+ERROR HY000: Variable 'innodb_stats_method' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_stats_method';
+Variable_name Value
+innodb_stats_method nulls_equal
+SHOW session variables LIKE 'innodb_stats_method';
+Variable_name Value
+innodb_stats_method nulls_equal
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SET global innodb_stats_method='nulls_equal';
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_equal
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_equal
+SET @@global.innodb_stats_method='nulls_unequal';
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_unequal
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_unequal
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_unequal
+SET global innodb_stats_method=2;
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_ignored
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_ignored
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_METHOD nulls_ignored
+SET session innodb_stats_method='nulls_equal';
+ERROR HY000: Variable 'innodb_stats_method' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.innodb_stats_method='nulls_ignored';
+ERROR HY000: Variable 'innodb_stats_method' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_stats_method=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_method'
+SET global innodb_stats_method=4;
+ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of '4'
+SET global innodb_stats_method=-2;
+ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of '-2'
+SET global innodb_stats_method=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_method'
+SET global innodb_stats_method='some';
+ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of 'some'
+SET @@global.innodb_stats_method = @start_global_value;
+SELECT @@global.innodb_stats_method;
+@@global.innodb_stats_method
+nulls_equal
diff --git a/mysql-test/suite/sys_vars/r/max_join_size_func.result b/mysql-test/suite/sys_vars/r/max_join_size_func.result
index bf535579433..0bf4f507b0c 100644
--- a/mysql-test/suite/sys_vars/r/max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/max_join_size_func.result
@@ -41,7 +41,7 @@ id name id name
SET @@session.max_join_size=8;
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
'#--------------------FN_DYNVARS_079_03-------------------------#'
## Setting global value of variable ##
SET @@global.max_join_size=8;
@@ -52,7 +52,7 @@ SELECT @@global.max_join_size;
8
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
## Dropping both the tables ##
Drop table t1, t2;
## Restoring values ##
diff --git a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
index c18f4cd2a1d..a5f36de73fa 100644
--- a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
+++ b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result
@@ -1,20 +1,20 @@
select @@global.plugin_dir;
@@global.plugin_dir
-MYSQL_LIBDIR/plugins
+MYSQL_TMP_DIR
select @@session.plugin_dir;
ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
show global variables like 'plugin_dir';
Variable_name Value
-plugin_dir MYSQL_LIBDIR/plugins
+plugin_dir MYSQL_TMP_DIR
show session variables like 'plugin_dir';
Variable_name Value
-plugin_dir MYSQL_LIBDIR/plugins
+plugin_dir MYSQL_TMP_DIR
select * from information_schema.global_variables where variable_name='plugin_dir';
VARIABLE_NAME VARIABLE_VALUE
-PLUGIN_DIR MYSQL_LIBDIR/plugins
+PLUGIN_DIR MYSQL_TMP_DIR
select * from information_schema.session_variables where variable_name='plugin_dir';
VARIABLE_NAME VARIABLE_VALUE
-PLUGIN_DIR MYSQL_LIBDIR/plugins
+PLUGIN_DIR MYSQL_TMP_DIR
set global plugin_dir=1;
ERROR HY000: Variable 'plugin_dir' is a read only variable
set session plugin_dir=1;
diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
index 72631dbb1d5..ceac0ce539d 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
@@ -21,7 +21,7 @@ INSERT INTO t2 VALUES('aa4','bb');
'#--------------------FN_DYNVARS_154_01-------------------------#'
Expected error "Too big select"
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
'#--------------------FN_DYNVARS_154_02-------------------------#'
SET SESSION SQL_BIG_SELECTS = 1;
diff --git a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
index 0dc85925c6b..377c2c9c4ca 100644
--- a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
@@ -19,7 +19,7 @@ SET SESSION sql_max_join_size=9;
Warnings:
Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead
SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
-ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
'#--------------------FN_DYNVARS_161_02-------------------------#'
SET SESSION SQL_BIG_SELECTS = 1;
diff --git a/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test b/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test
index f4e1161aa07..8e9f4651929 100644
--- a/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test
+++ b/mysql-test/suite/sys_vars/t/binlog_dbug_fsync_sleep_basic.test
@@ -1,3 +1,5 @@
+--source include/have_debug.inc
+
# ulong global
SET @start_global_value = @@global.binlog_dbug_fsync_sleep;
diff --git a/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test b/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
index f7d17a8e5ad..6e37a47c5b8 100644
--- a/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
+++ b/mysql-test/suite/sys_vars/t/debug_crc_break_basic.test
@@ -1,3 +1,4 @@
+--source include/have_debug.inc
# ulong global
SET @start_global_value = @@global.debug_crc_break;
diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def
index 888298bbb09..133754ed6ce 100644
--- a/mysql-test/suite/sys_vars/t/disabled.def
+++ b/mysql-test/suite/sys_vars/t/disabled.def
@@ -9,3 +9,6 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
+
+innodb_force_load_corrupted_basic : not in XtraDB (yet?)
+innodb_random_read_ahead_basic : not in XtraDB (yet?)
diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
index 5b6fa943bbe..e07234a9152 100644
--- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
@@ -1,8 +1,7 @@
################# mysql-test\t\innodb_autoinc_lock_mode_basic.test ############
# #
# Variable Name: innodb_autoinc_lock_mode #
-# Scope: GLOBAL #
-# Access Type: Dynamic #
+# Access Type: Static #
# Data Type: Numeric #
# Default Value: 1 #
# Range: 0,1,2 #
diff --git a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
index 636309a3088..e1b62046313 100644
--- a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
@@ -3,9 +3,9 @@
# Variable Name: innodb_fast_shutdown #
# Scope: GLOBAL #
# Access Type: Dynamic #
-# Data Type: boolean #
+# Data Type: numeric #
# Default Value: 1 #
-# Valid Values: 0,1 #
+# Valid Values: 0,1,2 #
# #
# #
# Creation Date: 2008-02-20 #
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
index cbf25af2442..f9f61b9380c 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
@@ -1,55 +1,95 @@
-
-
-# 2010-01-25 - Added
#
+# 2011-08-02 - Added
+#
+
--source include/not_embedded.inc
--source include/have_innodb.inc
-SET @start_global_value = @@global.innodb_file_format_max;
+SET @start_global_value = @@global.innodb_file_format_check;
SELECT @start_global_value;
#
# exists as global only
#
---echo Valid values are 'Antelope' and 'Barracuda'
-select @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
-select @@global.innodb_file_format_max;
+--echo Valid values are 'ON' and 'OFF'
+SELECT @@global.innodb_file_format_check in (0, 1);
+SELECT @@global.innodb_file_format_check;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_file_format_check;
+SHOW global variables LIKE 'innodb_file_format_check';
+SHOW session variables LIKE 'innodb_file_format_check';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_check';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_check';
+
+#
+# show that it's read only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.innodb_file_format_check='Off';
+--echo Expected error 'Read only variable'
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.innodb_file_format_check=1;
+--echo Expected error 'Read only variable'
+
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_file_format_max;
-show global variables like 'innodb_file_format_max';
-show session variables like 'innodb_file_format_max';
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-
-#
-# show that it's writable
-#
-set global innodb_file_format_max='Antelope';
-select @@global.innodb_file_format_max;
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
-set @@global.innodb_file_format_max='Barracuda';
-select @@global.innodb_file_format_max;
-select * from information_schema.global_variables where variable_name='innodb_file_format_max';
-select * from information_schema.session_variables where variable_name='innodb_file_format_max';
+SET @@global.innodb_file_format_check=0;
+--echo Expected error 'Read only variable'
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.innodb_file_format_check='On';
+--echo Expected error 'Read only variable'
+
--error ER_GLOBAL_VARIABLE
-set session innodb_file_format_max='Salmon';
+SET session innodb_large_prefix='OFF';
--error ER_GLOBAL_VARIABLE
-set @@session.innodb_file_format_max='Salmon';
+SET @@session.innodb_stats_on_metadata='ON';
#
-# incorrect types
+# Check if the value in GLOBAL Table matches value in variable
#
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_file_format_max=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_file_format_max=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_file_format_max='Salmon';
+
+SELECT IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_file_format_check';
+--echo 1 Expected
#
-# Cleanup
+# Check if accessing variable with and without GLOBAL point to same variable
#
+SELECT @@innodb_file_format_check = @@GLOBAL.innodb_file_format_check;
+--echo 1 Expected
+
+#
+# Check if innodb_doublewrite can be accessed with and without @@ sign
+#
+
+SELECT COUNT(@@innodb_file_format_check);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_file_format_check);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_file_format_check);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_file_format_check);
+--echo 1 Expected
-SET @@global.innodb_file_format_max = @start_global_value;
-SELECT @@global.innodb_file_format_max;
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_file_format_check = @@SESSION.innodb_file_format_check;
+--echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
index 00aa476e8d2..c2cb4cb47bb 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
@@ -1 +1,60 @@
---echo XtraDB extension
+#
+# 2011-08-02 - Added
+#
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_file_format_max;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'Antelope' and 'Barracuda'
+SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
+SELECT @@global.innodb_file_format_max;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_file_format_max;
+SHOW global variables LIKE 'innodb_file_format_max';
+SHOW session variables LIKE 'innodb_file_format_max';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+
+#
+# show that it's writable
+#
+SET global innodb_file_format_max='Antelope';
+SELECT @@global.innodb_file_format_max;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+SET @@global.innodb_file_format_max='Barracuda';
+SELECT @@global.innodb_file_format_max;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_file_format_max';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_file_format_max';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_file_format_max='Salmon';
+--error ER_GLOBAL_VARIABLE
+SET @@session.innodb_file_format_max='Salmon';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_file_format_max=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_file_format_max=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_file_format_max='Salmon';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_file_format_max = @start_global_value;
+SELECT @@global.innodb_file_format_max;
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
index 76a50df8879..1478d6df2e9 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
@@ -4,7 +4,7 @@
# #
# Variable Name: innodb_file_per_table #
# Scope: Global #
-# Access Type: Static #
+# Access Type: Dynamic #
# Data Type: boolean #
# #
# #
@@ -24,6 +24,10 @@
--source include/have_innodb.inc
+SET @start_global_value = @@global.innodb_file_per_table;
+SELECT @start_global_value;
+
+
--echo '#---------------------BS_STVARS_028_01----------------------#'
####################################################################
# Displaying default value #
@@ -37,11 +41,17 @@ SELECT COUNT(@@GLOBAL.innodb_file_per_table);
# Check if Value can set #
####################################################################
-SELECT COUNT(@@GLOBAL.innodb_file_per_table);
---echo 1 Expected
+SET @@global.innodb_file_per_table = 0;
+SELECT @@global.innodb_file_per_table;
+SET @@global.innodb_file_per_table ='On' ;
+SELECT @@global.innodb_file_per_table;
+SET @@global.innodb_file_per_table ='Off' ;
+SELECT @@global.innodb_file_per_table;
+SET @@global.innodb_file_per_table = 1;
+SELECT @@global.innodb_file_per_table;
--echo '#---------------------BS_STVARS_028_03----------------------#'
#################################################################
@@ -93,6 +103,10 @@ SELECT COUNT(@@GLOBAL.innodb_file_per_table);
--Error ER_BAD_FIELD_ERROR
SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
---echo Expected error 'Readonly variable'
+#
+# Cleanup
+#
+SET @@global.innodb_file_per_table = @start_global_value;
+SELECT @@global.innodb_file_per_table;
diff --git a/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test b/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test
new file mode 100644
index 00000000000..1726b320f47
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test
@@ -0,0 +1,102 @@
+
+
+################## mysql-test\t\innodb_force_load_corrupted_basic.test #####
+# #
+# Variable Name: innodb_force_load_corrupted #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: boolean #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author : Sharique Abdullah #
+# #
+# #
+# Description:Test Cases of Dynamic System Variable innodb_force_load_corrupted#
+# that checks the behavior of this variable in the following ways #
+# * Value Check #
+# * Scope Check #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
+# server-system-variables.html #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+
+--echo '#---------------------BS_STVARS_031_01----------------------#'
+####################################################################
+# Displaying default value #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_031_02----------------------#'
+####################################################################
+# Check if Value can set #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_force_load_corrupted=1;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+
+
+
+--echo '#---------------------BS_STVARS_031_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+SELECT IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_031_04----------------------#'
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted;
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_031_05----------------------#'
+################################################################################
+# Check if innodb_force_load_corrupted can be accessed with and without @@ sign #
+################################################################################
+
+SELECT COUNT(@@innodb_force_load_corrupted);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_force_load_corrupted);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_force_load_corrupted);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_force_load_corrupted = @@SESSION.innodb_force_load_corrupted;
+--echo Expected error 'Readonly variable'
+
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test b/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test
index 3f00b50cf08..0ced5800d4b 100644
--- a/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_io_capacity_basic.test
@@ -54,5 +54,9 @@ select * from information_schema.global_variables where variable_name='innodb_io
set global innodb_io_capacity=100;
select @@global.innodb_io_capacity;
+#
+# cleanup
+#
+
SET @@global.innodb_io_capacity = @start_global_value;
SELECT @@global.innodb_io_capacity;
diff --git a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
index 00aa476e8d2..582e9ffbee8 100644
--- a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
@@ -1 +1,70 @@
---echo XtraDB extension
+
+
+# 2010-01-25 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_large_prefix;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_large_prefix in (0, 1);
+select @@global.innodb_large_prefix;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_large_prefix;
+show global variables like 'innodb_large_prefix';
+show session variables like 'innodb_large_prefix';
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+
+#
+# show that it's writable
+#
+set global innodb_large_prefix='OFF';
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set @@global.innodb_large_prefix=1;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set global innodb_large_prefix=0;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+set @@global.innodb_large_prefix='ON';
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--error ER_GLOBAL_VARIABLE
+set session innodb_large_prefix='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_large_prefix='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_large_prefix=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_large_prefix=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_large_prefix=2;
+--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_large_prefix=-3;
+select @@global.innodb_large_prefix;
+select * from information_schema.global_variables where variable_name='innodb_large_prefix';
+select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_large_prefix='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_large_prefix = @start_global_value;
+SELECT @@global.innodb_large_prefix;
diff --git a/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
index 8cfd23fd6e7..f80b8e48736 100644
--- a/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
@@ -3,13 +3,13 @@
################## mysql-test\t\innodb_lock_wait_timeout_basic.test ###########
# #
# Variable Name: innodb_lock_wait_timeout #
-# Scope: Global #
-# Access Type: Static #
+# Scope: Global , Session #
+# Access Type: Dynamic #
# Data Type: numeric #
# #
# #
# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
+# Author : Sharique Abdullah #
# #
# #
# Description:Test Cases of Dynamic System Variable innodb_lock_wait_timeout #
@@ -24,6 +24,9 @@
--source include/have_innodb.inc
+SET @start_global_value=@@global.innodb_lock_wait_timeout;
+SELECT @start_global_value;
+
--echo '#---------------------BS_STVARS_032_01----------------------#'
####################################################################
# Displaying default value #
@@ -37,11 +40,10 @@ SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
# Check if Value can set #
####################################################################
-SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
---echo 1 Expected
-
-
-
+SET global innodb_lock_wait_timeout=60;
+SELECT @@global.innodb_lock_wait_timeout;
+SET session innodb_lock_wait_timeout=60;
+SELECT @@session.innodb_lock_wait_timeout;
--echo '#---------------------BS_STVARS_032_03----------------------#'
#################################################################
@@ -89,6 +91,10 @@ SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
--Error ER_BAD_FIELD_ERROR
SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
---echo Expected error 'Readonly variable'
+#
+# Cleanup
+#
+SET @@global.innodb_lock_wait_timeout = @start_global_value;
+SELECT @@global.innodb_lock_wait_timeout;
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
index 38c3acd92a2..7e70ed11351 100644
--- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
@@ -4,8 +4,8 @@
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
-# Default Value: 90 #
-# Range: 0-1000 #
+# Default Value: 75 #
+# Range: 0-99 #
# #
# #
# Creation Date: 2008-02-07 #
diff --git a/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test
new file mode 100644
index 00000000000..f78223bad02
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test
@@ -0,0 +1,70 @@
+
+
+# 2010-01-25 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_random_read_ahead;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_random_read_ahead in (0, 1);
+select @@global.innodb_random_read_ahead;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_random_read_ahead;
+show global variables like 'innodb_random_read_ahead';
+show session variables like 'innodb_random_read_ahead';
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+
+#
+# show that it's writable
+#
+set global innodb_random_read_ahead='ON';
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+set @@global.innodb_random_read_ahead=0;
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+set global innodb_random_read_ahead=1;
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+set @@global.innodb_random_read_ahead='OFF';
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--error ER_GLOBAL_VARIABLE
+set session innodb_random_read_ahead='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_random_read_ahead='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_random_read_ahead=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_random_read_ahead=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_random_read_ahead=2;
+--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
+set global innodb_random_read_ahead=-3;
+select @@global.innodb_random_read_ahead;
+select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
+select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_random_read_ahead='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_random_read_ahead = @start_global_value;
+SELECT @@global.innodb_random_read_ahead;
diff --git a/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test b/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
index 00aa476e8d2..9f0b70a528f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
@@ -1 +1,58 @@
---echo XtraDB extension
+#
+# 2011-08-01 Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_rollback_segments;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are zero or above
+SELECT @@global.innodb_rollback_segments >=0;
+SELECT @@global.innodb_rollback_segments <=128;
+SELECT @@global.innodb_rollback_segments;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_rollback_segments;
+SHOW global variables LIKE 'innodb_rollback_segments';
+SHOW session variables LIKE 'innodb_rollback_segments';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+
+#
+# show that it's writable
+#
+SET global innodb_rollback_segments=100;
+SELECT @@global.innodb_rollback_segments;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_rollback_segments';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_rollback_segments=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_rollback_segments=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_rollback_segments=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_rollback_segments="foo";
+SET global innodb_rollback_segments=-7;
+SELECT @@global.innodb_rollback_segments;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_rollback_segments';
+
+#
+# cleanup
+#
+
+SET @@global.innodb_rollback_segments = @start_global_value;
+SELECT @@global.innodb_rollback_segments;
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
index 00aa476e8d2..f01574c3683 100644
--- a/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
@@ -1 +1,72 @@
---echo XtraDB extension
+#
+# 2011-08-05 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_stats_method;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'nulls_equal', 'nulls_unequal', 'nulls_ignored'
+SELECT @@global.innodb_stats_method in ('nulls_equal', 'nulls_unequal',
+'nulls_ignored');
+SELECT @@global.innodb_stats_method;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_stats_method;
+SHOW global variables LIKE 'innodb_stats_method';
+SHOW session variables LIKE 'innodb_stats_method';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+
+#
+# show that it's writable
+#
+SET global innodb_stats_method='nulls_equal';
+SELECT @@global.innodb_stats_method;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+SET @@global.innodb_stats_method='nulls_unequal';
+SELECT @@global.innodb_stats_method;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+SET global innodb_stats_method=2;
+SELECT @@global.innodb_stats_method;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_method';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_method';
+
+--error ER_GLOBAL_VARIABLE
+SET session innodb_stats_method='nulls_equal';
+--error ER_GLOBAL_VARIABLE
+SET @@session.innodb_stats_method='nulls_ignored';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_method=1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_stats_method=4;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_stats_method=-2;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_method=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_stats_method='some';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_stats_method = @start_global_value;
+SELECT @@global.innodb_stats_method;
diff --git a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
index 03b7743a7aa..98f5af90cac 100644
--- a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
+++ b/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
@@ -1,3 +1,4 @@
+--source include/have_debug.inc
# bool readonly
#
diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt b/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt
new file mode 100644
index 00000000000..69a9f0def2a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt
@@ -0,0 +1 @@
+--plugin-dir=$MYSQL_TMP_DIR
diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
index 8bb231c2c5e..59889f7ecb2 100644
--- a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
+++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test
@@ -3,22 +3,20 @@
#
#
-# on windows it's <basedir>/lib/plugin
-# on unix it's <basedir>/lib/mysql/plugin
-# unless mtr sets it to $MYSQL_TEST_DIR/var/plugins
+# Don't rely on being able to guess the correct default.
+# -master.opt file for this test sets plugin_dir to a known directory
#
-let plugindir=$MYSQLTEST_VARDIR;
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
select @@global.plugin_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.plugin_dir;
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
show global variables like 'plugin_dir';
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
show session variables like 'plugin_dir';
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
select * from information_schema.global_variables where variable_name='plugin_dir';
---replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ /
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ /
select * from information_schema.session_variables where variable_name='plugin_dir';
#
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 15b037a0294..1edee9abf1e 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1100,6 +1100,33 @@ ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
DROP TABLE t1;
+--echo #
+--echo # Test for bug #12652385 - "61493: REORDERING COLUMNS TO POSITION
+--echo # FIRST CAN CAUSE DATA TO BE CORRUPTED".
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+--echo # Use MyISAM engine as the fact that InnoDB doesn't support
+--echo # in-place ALTER TABLE in cases when columns are being renamed
+--echo # hides some bugs.
+create table t1 (i int, j int) engine=myisam;
+insert into t1 value (1, 2);
+--echo # First, test for original problem described in the bug report.
+select * from t1;
+--echo # Change of column order by the below ALTER TABLE statement should
+--echo # affect both column names and column contents.
+alter table t1 modify column j int first;
+select * from t1;
+--echo # Now test for similar problem with the same root.
+--echo # The below ALTER TABLE should change not only the name but
+--echo # also the value for the last column of the table.
+alter table t1 drop column i, add column k int default 0;
+select * from t1;
+--echo # Clean-up.
+drop table t1;
+
+
--echo End of 5.1 tests
#
diff --git a/mysql-test/t/auth_rpl-master.opt b/mysql-test/t/auth_rpl-master.opt
new file mode 100644
index 00000000000..3536d102387
--- /dev/null
+++ b/mysql-test/t/auth_rpl-master.opt
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
diff --git a/mysql-test/t/auth_rpl-slave.opt b/mysql-test/t/auth_rpl-slave.opt
new file mode 100644
index 00000000000..3f4af6e59bb
--- /dev/null
+++ b/mysql-test/t/auth_rpl-slave.opt
@@ -0,0 +1,4 @@
+--master-retry-count=1
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
+
diff --git a/mysql-test/t/auth_rpl.test b/mysql-test/t/auth_rpl.test
new file mode 100644
index 00000000000..c413a84b53c
--- /dev/null
+++ b/mysql-test/t/auth_rpl.test
@@ -0,0 +1,66 @@
+--source include/have_plugin_auth.inc
+--source include/not_embedded.inc
+--source include/master-slave.inc
+
+#
+# Check that replication slave can connect to master using an account
+# which authenticates with an external authentication plugin (bug#12897501).
+
+#
+# First stop the slave to guarantee that nothing is replicated.
+#
+--connection slave
+--echo [connection slave]
+--source include/stop_slave.inc
+#
+# Create an replication account on the master.
+#
+--connection master
+--echo [connection master]
+CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
+GRANT REPLICATION SLAVE ON *.* TO plug_user;
+FLUSH PRIVILEGES;
+
+#
+# Now go to slave and change the replication user.
+#
+--connection slave
+--echo [connection slave]
+--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
+CHANGE MASTER TO
+ MASTER_USER= 'plug_user',
+ MASTER_PASSWORD= 'plug_user';
+
+#
+# Start slave with new replication account - this should trigger connection
+# to the master server.
+#
+--source include/start_slave.inc
+
+# Replicate all statements executed on master, in this case,
+# (creation of the plug_user account).
+#
+--connection master
+--sync_slave_with_master
+--echo # Slave in-sync with master now.
+
+SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
+
+#
+# Now we can stop the slave and clean up.
+#
+# Note: it is important that slave is stopped at this
+# moment - otherwise master's cleanup statements
+# would be replicated on slave!
+#
+--echo # Cleanup (on slave).
+--source include/stop_slave.inc
+eval CHANGE MASTER TO MASTER_USER='$master_user';
+DROP USER 'plug_user';
+
+--echo # Cleanup (on master).
+--connection master
+DROP USER 'plug_user';
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/t/ctype_errors.test b/mysql-test/t/ctype_errors.test
index 3c73fdae264..681223dae64 100644
--- a/mysql-test/t/ctype_errors.test
+++ b/mysql-test/t/ctype_errors.test
@@ -44,4 +44,19 @@ USE nonexistant;
disconnect con1;
connection default;
---echo End of 5.4 tests
+--echo #
+--echo # Bug#12736295: Buffer overflow for variable converted_err
+--echo # with non-latin1 server error message
+--echo #
+
+connect (con1,localhost,root,,test);
+--echo # Connection con1
+SET lc_messages=ru_RU;
+SET NAMES latin1;
+--error ER_PARSE_ERROR
+--query SELECT '01234567890123456789012345678901234\'
+disconnect con1;
+--echo # Connection default
+connection default;
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test
index c748e7148bf..d47dc335d5b 100644
--- a/mysql-test/t/ctype_utf16.test
+++ b/mysql-test/t/ctype_utf16.test
@@ -757,6 +757,13 @@ INSERT INTO t1 VALUES ('a');
SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug#12340997
+--echo # DATE_ADD/DATE_SUB WITH INTERVAL CRASHES IN GET_INTERVAL_VALUE()
+--echo #
+
+SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second));
+
#
## TODO: add tests for all engines
#
diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test
index a62ffbf95c7..1d79fbe1616 100644
--- a/mysql-test/t/ctype_utf32_uca.test
+++ b/mysql-test/t/ctype_utf32_uca.test
@@ -293,6 +293,27 @@ SET collation_connection=utf32_czech_ci;
--source include/ctype_czech.inc
--source include/ctype_like_ignorable.inc
+--echo #
+--echo # Bug #12319710 : INVALID MEMORY READ AND/OR CRASH IN
+--echo # MY_UCA_CHARCMP WITH UTF32
+--echo #
+
+SET collation_connection=utf32_unicode_ci;
+CREATE TABLE t1 (a TEXT CHARACTER SET utf32 COLLATE utf32_turkish_ci NOT NULL);
+INSERT INTO t1 VALUES ('a'), ('b');
+CREATE TABLE t2 (b VARBINARY(5) NOT NULL);
+
+--echo #insert chars outside of BMP
+INSERT INTO t2 VALUEs (0x082837),(0x082837);
+
+--echo #test for read-out-of-bounds with non-BMP chars as a LIKE pattern
+SELECT * FROM t1,t2 WHERE a LIKE b;
+
+--echo #test the original statement
+SELECT 1 FROM t1 AS t1_0 NATURAL LEFT OUTER JOIN t2 AS t2_0
+RIGHT JOIN t1 AS t1_1 ON t1_0.a LIKE t2_0.b;
+
+DROP TABLE t1,t2;
--echo #
--echo # End of 5.5 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 45b785e6a80..ce9f57b130f 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -9,6 +9,7 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
+tablespace : disabled in MariaDB (no TABLESPACE table attribute)
events_time_zone : Test is not predictable as it depends on precise timing.
lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on Mac OSX
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
@@ -17,5 +18,4 @@ alter_table-big : Bug#11748731 2010-11-15 mattiasj was not tested
create-big : Bug#11748731 2010-11-15 mattiasj was not tested
archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
-mysql_embedded : Bug#12561297 2011-06-15 New test failing on all platforms
-tablespace : disabled in MariaDB (no TABLESPACE table attribute)
+mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836
diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test
index f6edacfaa29..a60eccad3d8 100644
--- a/mysql-test/t/error_simulation.test
+++ b/mysql-test/t/error_simulation.test
@@ -89,6 +89,7 @@ SET SESSION debug = DEFAULT;
DROP TABLE t1, t2;
+
--echo #
--echo # End of 5.1 tests
--echo #
diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test
index 92b1deb9921..285197cd1f4 100644
--- a/mysql-test/t/execution_constants.test
+++ b/mysql-test/t/execution_constants.test
@@ -38,7 +38,7 @@ while ($i)
{
# If we SEGV because the min stack size is exceeded, this would return error
# 2013 .
- error 0,1436 //
+ error 0,ER_STACK_OVERRUN_NEED_MORE //
eval $query_head 0 $query_tail//
if ($mysql_errno)
@@ -48,10 +48,10 @@ while ($i)
# limit, we still have enough space reserved to report an error.
let $i = 1//
- # Check that mysql_errno is 1436
- if ($mysql_errno != 1436)
+ # Check that mysql_errname is ER_STACK_OVERRUN_NEED_MORE
+ if ($mysql_errname != ER_STACK_OVERRUN_NEED_MORE)
{
- die Wrong error triggered, expected 1436 but got $mysql_errno//
+ die Wrong error triggered, expected ER_STACK_OVERRUN_NEED_MORE but got $mysql_errname//
}
}
@@ -76,7 +76,7 @@ while ($i)
enable_result_log//
enable_query_log//
-echo Assertion: mysql_errno 1436 == $mysql_errno//
+echo Assertion: mysql_errname ER_STACK_OVERRUN_NEED_MORE == $mysql_errname//
delimiter ;//
DROP TABLE `t_bug21476`;
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 2fb0fb8fac7..8620a43cea5 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -157,14 +157,12 @@ CREATE TABLE t1 (f1 INT);
SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
-# EXPLAIN EXTENDED (with subselect). used to crash. should give NOTICE.
-# Before moving max/min optimization to optimize phase this statement
-# generated error, but as far as original query do not contain aggregate
-# function user should not see error
-# --error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+# EXPLAIN EXTENDED (with subselect). used to crash.
+# This is actually a valid query for this sql_mode,
+# but it was transformed in such a way that it failed, see
+# Bug#12329653 - EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
EXPLAIN EXTENDED SELECT 1 FROM t1
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
-SHOW WARNINGS;
SET SESSION sql_mode=@old_sql_mode;
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index de23cf02c38..037e2fcaa73 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -668,3 +668,36 @@ ALTER TABLE t1 COMMENT 'test';
UNLOCK TABLES;
DROP TABLE t1;
+
+
+--echo #
+--echo # Test for bug #12641342 - "61401: UPDATE PERFORMANCE DEGRADES
+--echo # GRADUALLY IF A TRIGGER EXISTS".
+--echo #
+--echo # One of side-effects of this bug was that a transaction which
+--echo # involved DML statements requiring prelocking blocked concurrent
+--echo # FLUSH TABLES WITH READ LOCK for the whole its duration, while
+--echo # correct behavior in this case is to block FTWRL only for duration
+--echo # of individual DML statements.
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (id INT PRIMARY KEY, value INT);
+INSERT INTO t1 VALUES (1, 1);
+CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW SET @var = "a";
+BEGIN;
+UPDATE t1 SET value= value + 1 WHERE id = 1;
+
+--echo # Switching to connection 'con1'.
+connect(con1, localhost, root);
+--echo # The below FLUSH TABLES WITH READ LOCK should succeed and
+--echo # should not be blocked by the transaction in default connection.
+FLUSH TABLES WITH READ LOCK;
+UNLOCK TABLES;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
+--echo # Switching to connection 'default'.
+connection default;
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 0d59f98a313..a1df990fa8e 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -536,3 +536,25 @@ SELECT 1 div null;
--echo # Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS
--echo #
select (1.175494351E-37 div 1.7976931348623157E+308);
+
+--echo #
+--echo # Bug#12537160 ASSERTION FAILED:
+--echo # STOP0 <= &TO->BUF[TO->LEN] WITH LARGE NUMBER.
+--echo #
+
+let $nine_81=
+999999999999999999999999999999999999999999999999999999999999999999999999999999999;
+
+eval select $nine_81 % 0.1 as foo;
+eval select $nine_81 % 0.0 as foo;
+
+--echo #
+--echo # Bug#12711164 - 61676:
+--echo # RESULT OF DIV WITH DECIMAL AND INTEGER DOES NOT MAKE SENSE
+--echo #
+
+select 5 div 2;
+select 5.0 div 2.0;
+select 5.0 div 2;
+select 5 div 2.0;
+select 5.9 div 2, 1.23456789e3 DIV 2, 1.23456789e9 DIV 2, 1.23456789e19 DIV 2;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 9a9a8110a74..bb22366a98d 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1437,5 +1437,24 @@ SELECT * FROM t1;
DROP TABLE t1;
--echo #
+--echo # Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
+--echo #
+
+SELECT (rpad(1.0,2048,1)) IS NOT FALSE;
+SELECT ((+0) IN
+((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)),
+(32767.1)));
+SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1));
+
+--error 1690
+SELECT
+pow((rpad(10.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
+SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../'));
+SELECT stddev_samp(rpad(1.0,2048,1));
+SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
+SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index cdac95523e5..e3c7cf8281f 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -919,6 +919,12 @@ SELECT DATE_FORMAT('0000-00-11', '%w');
SELECT MAKEDATE(11111111,1);
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
+--echo #
+--echo # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
+--echo #
+
+DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5);
+
--echo End of 5.1 tests
--echo #
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 2a800140d1f..104afddeee5 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -820,5 +820,23 @@ CREATE TABLE t3 (
# cleanup
DROP TABLE t0, t1, t2;
+--echo #
+--echo # Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
+--echo #
+
+CREATE TABLE g1
+(a geometry NOT NULL, UNIQUE KEY i (a(151))) engine=myisam;
+
+INSERT INTO g1 VALUES (geomfromtext('point(1 1)'));
+INSERT INTO g1 VALUES (geomfromtext('point(1 2)'));
+
+FLUSH TABLES;
+
+SELECT 1 FROM g1
+FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
+;
+
+DROP TABLE g1;
+
--echo End of 5.5 tests
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index f739870ca07..85147e28cf9 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1297,6 +1297,20 @@ FROM t1 GROUP BY a;
DROP TABLE t1;
+--echo #
+--echo # Bug#11765254 (58200): Assertion failed: param.sort_length when grouping
+--echo # by functions
+--echo #
+
+SET SQL_BIG_TABLES=1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0),(0);
+SELECT 1 FROM t1 GROUP BY IF(`a`,'','');
+SELECT 1 FROM t1 GROUP BY TRIM(LEADING RAND() FROM '');
+SELECT 1 FROM t1 GROUP BY SUBSTRING('',SLEEP(0),'');
+SELECT 1 FROM t1 GROUP BY SUBSTRING(SYSDATE() FROM 'K' FOR 'jxW<');
+DROP TABLE t1;
+SET SQL_BIG_TABLES=0;
--echo # End of 5.1 tests
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index e5700eaeeb8..7d56425799a 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -459,7 +459,7 @@ drop table t1;
#
create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
---replace_column 8 #
+--replace_column 8 # 12 #
show table status like 't_';
drop table t1, t2;
diff --git a/mysql-test/t/implicit_commit.test b/mysql-test/t/implicit_commit.test
index b10788bd891..59f8dc3a44c 100644
--- a/mysql-test/t/implicit_commit.test
+++ b/mysql-test/t/implicit_commit.test
@@ -1,5 +1,6 @@
source include/have_innodb.inc;
source include/not_embedded.inc;
+source include/have_profiling.inc;
SET GLOBAL EVENT_SCHEDULER = OFF;
SET BINLOG_FORMAT = STATEMENT;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 4a43969a057..5b5e2137d0e 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1540,8 +1540,6 @@ DROP TABLE t1, information_schema.tables;
LOCK TABLES t1 READ, information_schema.tables READ;
DROP TABLE t1;
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
#
# Bug #43834 Assertion in Natural_join_column::db_name() on an I_S query
@@ -1606,5 +1604,185 @@ drop view v1;
--echo #
+--echo # Test for bug #12828477 - "MDL SUBSYSTEM CREATES BIG OVERHEAD FOR
+--echo # CERTAIN QUERIES TO INFORMATION_SCHEMA".
+--echo #
+--echo # Check that metadata locks which are acquired during the process
+--echo # of opening tables/.FRMs/.TRG files while filling I_S table are
+--echo # not kept to the end of statement. Keeping the locks has caused
+--echo # performance problems in cases when big number of tables (.FRMs
+--echo # or .TRG files) were scanned as cost of new lock acquisition has
+--echo # increased linearly.
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+create database mysqltest;
+use mysqltest;
+create table t0 (i int);
+create table t1 (j int);
+create table t2 (k int);
+
+--echo #
+--echo # Test that we don't keep locks in case when we to fill
+--echo # I_S table we perform full-blown table open.
+--echo #
+
+--echo # Acquire lock on 't2' so upcoming RENAME is
+--echo # blocked.
+lock tables t2 read;
+
+--echo #
+--echo # Switching to connection 'con12828477_1'.
+--echo #
+connect (con12828477_1, localhost, root,,mysqltest);
+--echo # The below RENAME should wait on 't2' while
+--echo # keeping X lock on 't1'.
+--send rename table t1 to t3, t2 to t1, t3 to t2
+
+--echo #
+--echo # Switching to connection 'con12828477_2'.
+--echo #
+connect (con12828477_2, localhost, root,,mysqltest);
+--echo # Wait while the above RENAME is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table metadata lock" and
+ info = "rename table t1 to t3, t2 to t1, t3 to t2";
+--source include/wait_condition.inc
+
+--echo # Issue query to I_S which will open 't0' and get
+--echo # blocked on 't1' because of RENAME.
+--send select table_name, auto_increment from information_schema.tables where table_schema='mysqltest'
+
+--echo #
+--echo # Switching to connection 'con12828477_3'.
+--echo #
+connect (con12828477_3, localhost, root,,mysqltest);
+--echo # Wait while the above SELECT is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table metadata lock" and
+ info = "select table_name, auto_increment from information_schema.tables where table_schema='mysqltest'";
+--source include/wait_condition.inc
+
+--echo #
+--echo # Check that it holds no lock on 't0' so it can be renamed.
+rename table t0 to t4;
+
+--echo #
+--echo # Switching to connection 'default'.
+--echo #
+connection default;
+--echo #
+--echo # Unblock the first RENAME.
+unlock tables;
+
+--echo #
+--echo # Switching to connection 'con12828477_1'.
+--echo #
+connection con12828477_1;
+--echo # Reap the first RENAME
+--reap
+
+--echo #
+--echo # Switching to connection 'con12828477_2'.
+--echo #
+connection con12828477_2;
+--echo # Reap SELECT to I_S.
+--reap
+
+--echo #
+--echo # Switching to connection 'default'.
+--echo #
+connection default;
+
+--echo #
+--echo # Now test that we don't keep locks in case when we to fill
+--echo # I_S table we read .FRM or .TRG file only (this was the case
+--echo # for which problem existed).
+--echo #
+
+rename table t4 to t0;
+--echo # Acquire lock on 't2' so upcoming RENAME is
+--echo # blocked.
+lock tables t2 read;
+
+--echo #
+--echo # Switching to connection 'con12828477_1'.
+--echo #
+connection con12828477_1;
+--echo # The below RENAME should wait on 't2' while
+--echo # keeping X lock on 't1'.
+--send rename table t1 to t3, t2 to t1, t3 to t2
+
+--echo #
+--echo # Switching to connection 'con12828477_2'.
+--echo #
+connection con12828477_2;
+--echo # Wait while the above RENAME is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table metadata lock" and
+ info = "rename table t1 to t3, t2 to t1, t3 to t2";
+--source include/wait_condition.inc
+
+--echo # Issue query to I_S which will open 't0' and get
+--echo # blocked on 't1' because of RENAME.
+--send select event_object_table, trigger_name from information_schema.triggers where event_object_schema='mysqltest'
+
+--echo #
+--echo # Switching to connection 'con12828477_3'.
+--echo #
+connection con12828477_3;
+--echo # Wait while the above SELECT is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table metadata lock" and
+ info = "select event_object_table, trigger_name from information_schema.triggers where event_object_schema='mysqltest'";
+--source include/wait_condition.inc
+
+--echo #
+--echo # Check that it holds no lock on 't0' so it can be renamed.
+rename table t0 to t4;
+
+--echo #
+--echo # Switching to connection 'default'.
+--echo #
+connection default;
+--echo #
+--echo # Unblock the first RENAME.
+unlock tables;
+
+--echo #
+--echo # Switching to connection 'con12828477_1'.
+--echo #
+connection con12828477_1;
+--echo # Reap the first RENAME
+--reap
+
+--echo #
+--echo # Switching to connection 'con12828477_2'.
+--echo #
+connection con12828477_2;
+--echo # Reap SELECT to I_S.
+--reap
+
+--echo #
+--echo # Switching to connection 'default'.
+--echo #
+connection default;
+disconnect con12828477_1;
+disconnect con12828477_2;
+disconnect con12828477_3;
+
+--echo #
+--echo # Clean-up.
+drop database mysqltest;
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index ca2f5ebb4d7..4066fcb264b 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -2809,7 +2809,32 @@ UNLOCK TABLES;
DROP TABLE m1, t1;
---echo End of 6.0 tests
+--echo #
+--echo # Test for bug #11754210 - "45777: CHECK TABLE DOESN'T SHOW ALL
+--echo # PROBLEMS FOR MERGE TABLE COMPLIANCE IN 5.1"
+--echo #
+--disable_warnings
+drop tables if exists t1, t2, t3, t4, m1;
+--enable_warnings
+create table t1(id int) engine=myisam;
+create view t3 as select 1 as id;
+create table t4(id int) engine=memory;
+create table m1(id int) engine=merge union=(t1,t2,t3,t4);
+--error ER_WRONG_MRG_TABLE
+select * from m1;
+--echo # The below CHECK and REPAIR TABLE statements should
+--echo # report all problems with underlying tables:
+--echo # - absence of 't2',
+--echo # - missing base table for 't3',
+--echo # - wrong engine of 't4'.
+check table m1;
+repair table m1;
+--echo # Clean-up.
+drop tables m1, t1, t4;
+drop view t3;
+
+
+--echo End of 5.5 tests
--disable_result_log
--disable_query_log
diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test
index 190ee8d8fd2..afa417822e6 100644
--- a/mysql-test/t/myisampack.test
+++ b/mysql-test/t/myisampack.test
@@ -223,3 +223,47 @@ DROP TABLE t1,t2,t3;
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
+--echo #
+--echo # BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
+--echo #
+CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
+INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
+FLUSH TABLE t1;
+--exec $MYISAMPACK -sf $MYSQLD_DATADIR/test/t1
+--exec $MYISAMCHK -srq $MYSQLD_DATADIR/test/t1
+CHECK TABLE t1;
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
+DROP TABLE t1;
+
+--echo # Test table with key_reflength > rec_reflength
+CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
+--disable_query_log
+--echo # Populating a table, so it's index file exceeds 65K
+let $1=1700;
+while ($1)
+{
+ eval INSERT INTO t1 VALUES('$1aaaaaaaaaaaaaaaaaaaaaaaaaa');
+ dec $1;
+}
+
+--echo # Populating a table, so index file has second level fulltext tree
+let $1=60;
+while ($1)
+{
+ eval INSERT INTO t1 VALUES('aaaa'),('aaaa'),('aaaa'),('aaaa'),('aaaa');
+ dec $1;
+}
+--enable_query_log
+
+FLUSH TABLE t1;
+--echo # Compressing table
+--exec $MYISAMPACK -sf $MYSQLD_DATADIR/test/t1
+--echo # Fixing index (repair by sort)
+--exec $MYISAMCHK -srnq $MYSQLD_DATADIR/test/t1
+CHECK TABLE t1;
+FLUSH TABLE t1;
+--echo # Fixing index (repair with keycache)
+--exec $MYISAMCHK -soq $MYSQLD_DATADIR/test/t1
+CHECK TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/mysql_embedded.test b/mysql-test/t/mysql_embedded.test
index b4c8c6be05f..30959b83017 100644
--- a/mysql-test/t/mysql_embedded.test
+++ b/mysql-test/t/mysql_embedded.test
@@ -3,4 +3,10 @@
--echo #
--source include/is_embedded.inc
---exec $MYSQL_TEST_DIR/../libmysqld/examples/mysql_embedded -e 'select 1'
+
+# Test case require mysql_embedded to be present
+if(!$MYSQL_EMBEDDED)
+{
+ --skip Test requires mysql_embedded executable
+}
+--exec $MYSQL_EMBEDDED -e 'select 1'
diff --git a/mysql-test/t/mysql_plugin-master.opt b/mysql-test/t/mysql_plugin-master.opt
new file mode 100644
index 00000000000..061ca907902
--- /dev/null
+++ b/mysql-test/t/mysql_plugin-master.opt
@@ -0,0 +1 @@
+--plugin-dir=$DAEMONEXAMPLE_DIR
diff --git a/mysql-test/t/mysql_plugin.test b/mysql-test/t/mysql_plugin.test
new file mode 100644
index 00000000000..b7fbe377e31
--- /dev/null
+++ b/mysql-test/t/mysql_plugin.test
@@ -0,0 +1,318 @@
+#
+# Test mysql_plugin tool
+#
+# This test contains test cases for testing the mysql_plugin client with
+# the daemon_example plugin. Test cases include tests for:
+#
+# - successful enable/disable
+# - incorrect paths
+# - missing paths/options
+#
+# Implementation Notes
+#
+# The mysql_plugin tool now accepts --mysqld the path to mysqld server. The
+# mysqld path is extracted from MYSQLD_BOOTSTRAP_CMD line. We also extract
+# the path of MYSQLD_BASEDIR (where mysql exists) and use it for the errmsg
+# file. The directories differ between Windows and Unix but the Perl script
+# included below will pick as per platform.
+#
+# The test is also designed to issue the --skip directive if the location of
+# the mysqld, my_print_defaults, or daemon_example.ini files cannot be found.
+#
+
+--source include/not_embedded.inc
+
+# Add the datadir, basedir, plugin_dir to the bootstrap command
+let $MYSQLD_DATADIR= `select @@datadir`;
+let $MYSQL_BASEDIR= `select @@basedir`;
+let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`;
+let $PLUGIN_DIR=`select @@plugin_dir`;
+
+--disable_abort_on_error
+
+# Perl script to extract the location of the basedir from environment
+# variables. This is needed to ensure the test will run on the PB machines
+# designed to test release as well as debug builds. It also checks for the
+# location of the my_print_defaults and daemon_example.ini files.
+
+perl;
+use File::Basename;
+ my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
+ my $mysqld_basedir=dirname($mysqld);
+ my $my_print_defaults= $ENV{MYSQL_MY_PRINT_DEFAULTS};
+ my $my_print_defaults_basedir=dirname($my_print_defaults);
+ my $daemonexample_ini= "$ENV{DAEMONEXAMPLE_DIR}/daemon_example.ini";
+ my $plugindir_ini= "$ENV{PLUGIN_DIR}/daemon_example.ini";
+ my $notfound= "";
+ open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
+ print FILE "let \$MYSQLD_BASEDIR= $mysqld_basedir;\n";
+ print FILE "let \$MYSQL_MY_PRINT_DEFAULTS_BASEDIR= $my_print_defaults_basedir;\n";
+ if ((!-e $daemonexample_ini) || (!-r $daemonexample_ini))
+ {
+ print FILE "let \$DAEMONEXAMPLE_DIR= $not_found;\n";
+ }
+ if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
+ {
+ print FILE "let \$PLUGIN_DIR= $not_found;\n";
+ }
+ close FILE;
+EOF
+
+
+source $MYSQL_TMP_DIR/mysqld.inc;
+remove_file $MYSQL_TMP_DIR/mysqld.inc;
+
+# The mysql_plugin tool expects a directory structure like in the installed
+# mysql version, so errmsg.sys will be copied to "basedir/share", we create
+# and remove this structure.
+
+--mkdir $MYSQLD_BASEDIR/share
+--mkdir $MYSQLD_BASEDIR/share/mysql
+--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
+--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/mysql/errmsg.sys
+
+# The mysql_plugin tool now accepts --my-print-defaults which points to the
+# executable my_print_defaults.exe we can get this path from the variable
+# $MYSQL_MY_PRINT_DEFAULTS.
+
+# Check for my_print_defaults location. Skip if not found.
+if ($MYSQL_MY_PRINT_DEFAULTS_BASEDIR == '')
+{
+ --skip Test requires known location of my_print_defaults executable.
+}
+
+# Check for mysqld location. Skip if not found.
+if ($MYSQLD == '')
+{
+ --skip Test requires known location of mysqld executable.
+}
+
+# Check for daemon_example.ini location. Skip if not found in either
+# the plugin_dir path or the daemon_example_dir path.
+if ($PLUGIN_DIR == '')
+{
+ if ($DAEMONEXAMPLE_DIR == '')
+ {
+ --skip Test requires known location of daemon_example.ini file.
+ }
+ let $PLUGIN_DIR = $DAEMONEXAMPLE_DIR;
+}
+
+# Build client command for reuse.
+
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+
+--echo #
+--echo # Ensure the plugin isn't loaded.
+--echo #
+SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name;
+
+--echo #
+--echo # Enable the plugin...
+--echo #
+let $expect_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+# MTR will remove this file later, but this might be too late.
+--error 0,1
+--remove_file $expect_file
+--write_file $expect_file
+wait
+EOF
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+
+#
+# Enable the plugin
+#
+--exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
+
+#
+# Ensure enabling an enabled plugin doesn't fail
+--exec $MYSQL_PLUGIN_CMD ENABLE daemon_example
+
+#
+# Restart the server
+#
+--append_file $expect_file
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo #
+--echo # Ensure the plugin is now loaded.
+--echo #
+--replace_regex /\.dll/.so/
+SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name;
+
+--echo #
+--echo # Disable the plugin...
+--echo #
+# MTR will remove this file later, but this might be too late.
+--error 0,1
+--remove_file $expect_file
+--write_file $expect_file
+wait
+EOF
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+
+#
+# Disable the plugin
+#
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example
+
+#
+# Restart the server
+#
+--append_file $expect_file
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo #
+--echo # Ensure the plugin isn't loaded.
+--echo #
+SELECT * FROM mysql.plugin WHERE name = 'daemon_example' ORDER BY name;
+
+#
+# Stop the server for error conditions
+#
+let $expect_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+# MTR will remove this file later, but this might be too late.
+--error 0,1
+--remove_file $expect_file
+--write_file $expect_file
+wait
+EOF
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+
+--echo #
+--echo # Attempt to load non-existant plugin
+--echo #
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE NOT_THERE_AT_ALL 2>&1
+
+--echo #
+--echo # Attempt to use non-existant plugin.ini file
+--echo #
+--error 1,2,7,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example --plugin-ini=/NOT/THERE/pi.ini 2>&1
+
+--echo #
+--echo # Attempt to omit the plugin
+--echo #
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE 2>&1
+
+--echo #
+--echo # Attempt to omit DISABLE|ENABLE
+--echo #
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD daemon_example 2>&1
+
+--echo #
+--echo # Attempt to use bad paths - datadir
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=/data_not_there/ --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Attempt to use bad paths - basedir
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=/basedir_not_there/ --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+replace_result "/basedir_not_there//" "/basedir_not_there/";
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Attempt to use bad paths - plugin_dir
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=/plugin_not_there/ --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Attempt to use bad paths - mysqld
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=/mysqld_not_there/ --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Attempt to use bad paths - my_print_defaults
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=/my_print_defaults_not_there/;
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+
+--echo #
+--echo # Missing library
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_soname.ini --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Bad format for config file
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --plugin-ini=$MYSQL_TEST_DIR/include/daemon_example_bad_format.ini --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Missing base_dir option
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,139,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Missing data_dir option
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --basedir=$MYSQL_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,139,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Missing plugin_dir option
+--echo #
+let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQL_BASEDIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+--error 1,2,139,256
+--exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
+
+--echo #
+--echo # Show the help.
+--echo #
+replace_result $MYSQL_PLUGIN mysql_plugin;
+--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/
+--exec $MYSQL_PLUGIN --help
+
+replace_result $MYSQL_PLUGIN mysql_plugin;
+--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/
+--exec $MYSQL_PLUGIN --version
+
+#
+# Restart the server
+#
+--append_file $expect_file
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+#
+# Cleanup
+# MTR will remove this file later, but this might be too late.
+--error 0,1
+--remove_file $expect_file
+
+# Cleanup the share folder in the binary path.
+--remove_file $MYSQLD_BASEDIR/share/errmsg.sys
+--rmdir $MYSQLD_BASEDIR/share/mysql
+--rmdir $MYSQLD_BASEDIR/share
+
+--enable_abort_on_error
diff --git a/mysql-test/t/mysqld--defaults-file.test b/mysql-test/t/mysqld--defaults-file.test
index 065436c38aa..3bfe0aa891f 100644
--- a/mysql-test/t/mysqld--defaults-file.test
+++ b/mysql-test/t/mysqld--defaults-file.test
@@ -5,21 +5,6 @@
source include/not_embedded.inc;
source include/not_windows.inc;
-# We need to use a plain "mysqld" without any other options to trigger
-# the bug. In particular, it seems that passing --bootstrap does not
-# trigger the bug. To do that, we extract the "command name" from the
-# MYSQLD_BOOTSTRAP_CMD variable and store that in a file, which we
-# then load into the test case.
-
-perl;
- my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
- open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
- print FILE "let \$MYSQLD= $mysqld;\n";
- close FILE;
-EOF
-
-source $MYSQL_TMP_DIR/mysqld.inc;
-
# All these tests refer to configuration files that do not exist
--error 1
@@ -44,4 +29,3 @@ exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
--error 1
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
-remove_file $MYSQL_TMP_DIR/mysqld.inc;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 6f12c6d4d11..ab55fd30bf5 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1,3 +1,14 @@
+# ----------------------------------------------------------------------------
+# $mysql_errno contains the return code of the last command
+# sent to the server.
+# ----------------------------------------------------------------------------
+# get $mysql_errno before the first statement
+# $mysql_errno should be -1
+# get $mysql_errname as well
+
+echo $mysql_errno before test;
+echo $mysql_errname before test;
+
-- source include/have_log_bin.inc
# This test should work in embedded server after mysqltest is fixed
@@ -42,15 +53,6 @@ SET GLOBAL max_connections = 1000;
# ============================================================================
# ----------------------------------------------------------------------------
-# $mysql_errno contains the return code of the last command
-# sent to the server.
-# ----------------------------------------------------------------------------
-# get $mysql_errno before the first statement
-# $mysql_errno should be -1
-eval select $mysql_errno as "before_use_test" ;
-
-
-# ----------------------------------------------------------------------------
# Positive case(statement)
# ----------------------------------------------------------------------------
@@ -142,6 +144,7 @@ select friedrich from (select 1 as otto) as t1;
# check mysql_errno = 0 after successful statement
# ----------------------------------------------------------------------------
select otto from (select 1 as otto) as t1;
+echo $mysql_errname;
eval select $mysql_errno as "after_successful_stmt_errno" ;
#----------------------------------------------------------------------------
@@ -150,6 +153,7 @@ eval select $mysql_errno as "after_successful_stmt_errno" ;
--error ER_PARSE_ERROR
garbage ;
+echo $mysql_errname;
eval select $mysql_errno as "after_wrong_syntax_errno" ;
# ----------------------------------------------------------------------------
@@ -159,6 +163,7 @@ eval select $mysql_errno as "after_wrong_syntax_errno" ;
garbage ;
let $my_var= 'abc' ;
+echo $mysql_errname;
eval select $mysql_errno as "after_let_var_equal_value" ;
# ----------------------------------------------------------------------------
@@ -168,6 +173,7 @@ eval select $mysql_errno as "after_let_var_equal_value" ;
garbage ;
set @my_var= 'abc' ;
+echo $mysql_errname;
eval select $mysql_errno as "after_set_var_equal_value" ;
# ----------------------------------------------------------------------------
@@ -178,6 +184,7 @@ eval select $mysql_errno as "after_set_var_equal_value" ;
garbage ;
--disable_warnings
+echo $mysql_errname;
eval select $mysql_errno as "after_disable_warnings_command" ;
# ----------------------------------------------------------------------------
@@ -190,6 +197,7 @@ drop table if exists t1 ;
garbage ;
drop table if exists t1 ;
+echo $mysql_errname;
eval select $mysql_errno as "after_disable_warnings" ;
--enable_warnings
@@ -202,6 +210,7 @@ garbage ;
--error ER_NO_SUCH_TABLE
select 3 from t1 ;
+echo $mysql_errname;
eval select $mysql_errno as "after_minus_masked" ;
--error ER_PARSE_ERROR
@@ -209,6 +218,7 @@ garbage ;
--error ER_NO_SUCH_TABLE
select 3 from t1 ;
+echo $mysql_errname;
eval select $mysql_errno as "after_!_masked" ;
# ----------------------------------------------------------------------------
@@ -230,6 +240,7 @@ garbage ;
--error ER_NO_SUCH_TABLE
prepare stmt from "select 3 from t1" ;
+echo $mysql_errname;
eval select $mysql_errno as "after_failing_prepare" ;
create table t1 ( f1 char(10));
@@ -238,6 +249,7 @@ create table t1 ( f1 char(10));
garbage ;
prepare stmt from "select 3 from t1" ;
+echo $mysql_errname;
eval select $mysql_errno as "after_successful_prepare" ;
# successful execute
@@ -245,6 +257,7 @@ eval select $mysql_errno as "after_successful_prepare" ;
garbage ;
execute stmt;
+echo $mysql_errname;
eval select $mysql_errno as "after_successful_execute" ;
# failing execute (table has been dropped)
@@ -255,6 +268,7 @@ garbage ;
--error ER_NO_SUCH_TABLE
execute stmt;
+echo $mysql_errname;
eval select $mysql_errno as "after_failing_execute" ;
# failing execute (unknown statement)
@@ -264,6 +278,7 @@ garbage ;
--error ER_UNKNOWN_STMT_HANDLER
execute __stmt_;
+echo $mysql_errname;
eval select $mysql_errno as "after_failing_execute" ;
# successful deallocate
@@ -271,6 +286,7 @@ eval select $mysql_errno as "after_failing_execute" ;
garbage ;
deallocate prepare stmt;
+echo $mysql_errname;
eval select $mysql_errno as "after_successful_deallocate" ;
# failing deallocate ( statement handle does not exist )
@@ -280,6 +296,7 @@ garbage ;
--error ER_UNKNOWN_STMT_HANDLER
deallocate prepare __stmt_;
+echo $mysql_errname;
eval select $mysql_errno as "after_failing_deallocate" ;
@@ -307,6 +324,7 @@ eval select $mysql_errno as "after_failing_deallocate" ;
garbage ;
--disable_abort_on_error
+echo $mysql_errname;
eval select $mysql_errno as "after_--disable_abort_on_error" ;
# ----------------------------------------------------------------------------
@@ -324,6 +342,7 @@ select 3 from t1 ;
--error ER_NO_SUCH_TABLE
select 3 from t1 ;
+echo $mysql_errname;
eval select $mysql_errno as "after_!errno_masked_error" ;
# expected error <> response
# --error 1000
@@ -343,12 +362,21 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
EOF
# ----------------------------------------------------------------------------
+# Check backtick and query_get_value, result should be empty
+# ----------------------------------------------------------------------------
+let $empty= `garbage`;
+echo $empty is empty;
+let $empty= query_get_value(nonsense, blabla, 1);
+echo $empty is empty;
+
+# ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno
# ----------------------------------------------------------------------------
--error ER_PARSE_ERROR
garbage ;
--enable_abort_on_error
+echo $mysql_errname;
eval select $mysql_errno as "after_--enable_abort_on_error" ;
# ----------------------------------------------------------------------------
@@ -371,6 +399,71 @@ select 3 from t1 ;
--error 1
--exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1
+# ----------------------------------------------------------------------------
+# Test --enable and --disable with ONCE
+# ----------------------------------------------------------------------------
+
+--disable_abort_on_error ONCE
+garbage;
+--disable_abort_on_error ONCE
+--remove_file DoesNotExist
+
+--disable_result_log
+select 2;
+--enable_result_log ONCE
+select 3;
+select 5;
+--enable_result_log
+
+# ----------------------------------------------------------------------------
+# Test cumulative ONCE
+# ----------------------------------------------------------------------------
+
+--disable_abort_on_error ONCE
+--disable_query_log ONCE
+select 3 from t1;
+select 7;
+
+--error 1
+--exec echo "--disable_info OCNE" | $MYSQL_TEST 2>&1
+
+--enable_connect_log ONCE
+connect (con1,localhost,root,,);
+connection default;
+disconnect con1;
+
+# ----------------------------------------------------------------------------
+# Test ONCE can be combined with --error or modifiers like lowercase
+# ----------------------------------------------------------------------------
+
+--disable_result_log ONCE
+--error ER_NO_SUCH_TABLE
+select 5 from t1;
+
+--disable_query_log ONCE
+--lowercase_result
+select "CASE" as "LOWER";
+
+--sorted_result
+--disable_query_log ONCE
+select "xyz" as name union select "abc" as name order by name desc;
+
+# ----------------------------------------------------------------------------
+# Test --error with backtick operator or query_get_value
+# ----------------------------------------------------------------------------
+
+--error 0,ER_NO_SUCH_TABLE
+let $empty= `SELECT foo from bar`;
+echo $empty is empty;
+
+--error 0,ER_BAD_FIELD_ERROR
+let $empty= query_get_value(SELECT bar as foo, baz, 1);
+echo $empty is empty;
+
+--error 0,ER_NO_SUCH_TABLE
+if (!`SELECT foo from bar`) {
+ echo "Yes it's empty";
+}
# ----------------------------------------------------------------------------
# Test comments
@@ -940,10 +1033,9 @@ while ($outer)
--source $MYSQLTEST_VARDIR/tmp/sourced.inc
--error ER_NO_SUCH_TABLE
SELECT * from nowhere;
- --disable_abort_on_error
+ --disable_abort_on_error ONCE
# Statement giving a different error, to make sure we don't mask it
SELECT * FROM nowhere else;
- --enable_abort_on_error
}
dec $outer;
inc $ifval;
@@ -1092,9 +1184,8 @@ system echo "hej" > /dev/null;
--error 1
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
---disable_abort_on_error
+--disable_abort_on_error ONCE
system NonExistsinfComamdn 2> /dev/null;
---enable_abort_on_error
# ----------------------------------------------------------------------------
@@ -2513,10 +2604,9 @@ INSERT INTO t1 SELECT f1 - 64 FROM t1;
INSERT INTO t1 SELECT f1 - 128 FROM t1;
INSERT INTO t1 SELECT f1 - 256 FROM t1;
INSERT INTO t1 SELECT f1 - 512 FROM t1;
---disable_result_log
+--disable_result_log ONCE
--sorted_result
SELECT * FROM t1;
---enable_result_log
DROP TABLE t1;
# ----------------------------------------------------------------------------
@@ -2564,11 +2654,9 @@ SELECT 0 as "WILL NOT lower case ÄËÐ";
--exec $MYSQL_TEST --help 2>&1 > /dev/null
--exec $MYSQL_TEST --version 2>&1 > /dev/null
--enable_query_log
---disable_abort_on_error
+--disable_abort_on_error ONCE
--error 1
--exec $MYSQL_TEST a b c 2>&1 > /dev/null
---enable_abort_on_error
---enable_query_log
# ----------------------------------------------------------------------------
# test for query_get_value
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index d820f1c03bd..99945a82c7f 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -1547,6 +1547,13 @@ SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
DROP TABLE t1;
+--echo #
+--echo # Bug#11765255 58201:
+--echo # VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+--echo #
+
+select 1 order by max(1) + min(1);
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_innodb_plugin.test b/mysql-test/t/partition_innodb_plugin.test
index e8b73687177..6ff90f37687 100644
--- a/mysql-test/t/partition_innodb_plugin.test
+++ b/mysql-test/t/partition_innodb_plugin.test
@@ -7,7 +7,6 @@ call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB
--echo #
--echo # Bug#55091: Server crashes on ADD PARTITION after a failed attempt
--echo #
-SET @old_innodb_file_format_max = @@global.innodb_file_format_max;
SET @old_innodb_file_format = @@global.innodb_file_format;
SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
@@ -66,7 +65,6 @@ DROP TABLE t1;
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
-SET @@global.innodb_file_format_max = @old_innodb_file_format_max;
#
# Bug#32430 - show engine innodb status causes errors
diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test
index 16c96fa0c21..e1de1cc8153 100644
--- a/mysql-test/t/plugin_auth.test
+++ b/mysql-test/t/plugin_auth.test
@@ -507,4 +507,63 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
ORDER BY COLUMN_NAME;
+--echo #
+--echo # Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN
+--echo # .-> USING PASSWORD: NO
+--echo #
+
+--echo # shoud contain "using password=yes"
+--error 1
+--exec $MYSQL -uunknown -punknown 2>&1
+
+--echo # shoud contain "using password=no"
+--error 1
+--exec $MYSQL -uunknown 2>&1
+
+--echo #
+--echo # Bug #12610784: SET PASSWORD INCORRECTLY KEEP AN OLD EMPTY PASSWORD
+--echo #
+
+CREATE USER bug12610784@localhost;
+SET PASSWORD FOR bug12610784@localhost = PASSWORD('secret');
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect(b12610784,localhost,bug12610784,,test);
+--enable_query_log
+connect(b12610784,localhost,bug12610784,secret,test);
+connection default;
+disconnect b12610784;
+DROP USER bug12610784@localhost;
+
+
+--echo #
+--echo # Bug #12818542: PAM: ADDING PASSWORD FOR AN ACCOUNT DISABLES PAM
+--echo # AUTHENTICATION SETTINGS
+--echo #
+
+CREATE USER bug12818542@localhost
+ IDENTIFIED WITH 'test_plugin_server' AS 'bug12818542_dest';
+CREATE USER bug12818542_dest@localhost
+ IDENTIFIED BY 'bug12818542_dest_passwd';
+GRANT PROXY ON bug12818542_dest@localhost TO bug12818542@localhost;
+
+connect(bug12818542_con,localhost,bug12818542,bug12818542_dest);
+connection bug12818542_con;
+SELECT USER(),CURRENT_USER();
+
+SET PASSWORD = PASSWORD('bruhaha');
+
+connection default;
+disconnect bug12818542_con;
+
+connect(bug12818542_con2,localhost,bug12818542,bug12818542_dest);
+connection bug12818542_con2;
+SELECT USER(),CURRENT_USER();
+
+connection default;
+disconnect bug12818542_con2;
+
+DROP USER bug12818542@localhost;
+DROP USER bug12818542_dest@localhost;
+
--echo End of 5.5 tests
diff --git a/mysql-test/t/secure_file_priv_win-master.opt b/mysql-test/t/secure_file_priv_win-master.opt
new file mode 100644
index 00000000000..e9a43a5584d
--- /dev/null
+++ b/mysql-test/t/secure_file_priv_win-master.opt
@@ -0,0 +1 @@
+--secure_file_priv=$MYSQL_TMP_DIR
diff --git a/mysql-test/t/secure_file_priv_win.test b/mysql-test/t/secure_file_priv_win.test
new file mode 100644
index 00000000000..a12510974ce
--- /dev/null
+++ b/mysql-test/t/secure_file_priv_win.test
@@ -0,0 +1,79 @@
+#
+# Bug58747 breaks secure_file_priv+not secure yet+still accesses other folders
+#
+
+# we do the windows specific relative directory testing
+
+--source include/windows.inc
+
+CREATE TABLE t1 (c1 longtext);
+INSERT INTO t1 values ('a');
+
+LET $MYSQL_TMP_DIR_UCASE= `SELECT upper('$MYSQL_TMP_DIR')`;
+LET $MYSQL_TMP_DIR_LCASE= `SELECT lower('$MYSQL_TMP_DIR')`;
+
+#create the file
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR/B11764517.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+show global variables like 'secure_file_priv';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR\\\\B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval SELECT load_file('$MYSQL_TMP_DIR_UCASE/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval SELECT load_file('$MYSQL_TMP_DIR_LCASE/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR\\\\B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR_UCASE/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error ER_OPTION_PREVENTS_STATEMENT
+eval LOAD DATA INFILE "$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp" into table t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error ER_OPTION_PREVENTS_STATEMENT
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517-2.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR\\\\B11764517-2.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR/B11764517-3.tmp';
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR_UCASE/B11764517-4.tmp';
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp';
+
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-2.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-3.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-4.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-5.tmp;
+DROP TABLE t1;
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index bc5ac8ac63f..e78724d16da 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -295,37 +295,37 @@ CREATE TABLE t3 (
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1,1),(2,2);
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
insert into t1 values (3),(4);
insert into t2 values (3),(4);
insert into t3 values (3,3),(4,4);
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
delete from t1 where a=3;
delete from t2 where b=3;
delete from t3 where a=3;
---replace_column 6 # 7 # 8 # 9 # 10 #
+--replace_column 6 # 7 # 8 # 9 # 10 # 12 #
show table status;
truncate table t1;
truncate table t2;
truncate table t3;
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
insert into t1 values (5);
insert into t2 values (5);
insert into t3 values (5,5);
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 12 #
show table status;
delete from t1 where a=5;
delete from t2 where b=5;
delete from t3 where a=5;
---replace_column 6 # 7 # 8 # 9 # 10 #
+--replace_column 6 # 7 # 8 # 9 # 10 # 12 #
show table status;
drop table t1, t2, t3;
@@ -443,7 +443,7 @@ flush tables;
# Create a junk frm file on disk
let $MYSQLD_DATADIR= `select @@datadir`;
system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 12 #
SHOW TABLE STATUS like 't1';
--error ER_NOT_FORM_FILE
show create table t1;
@@ -1073,7 +1073,7 @@ set names latin1;
SET NAMES latin1;
CREATE DATABASE `ä`;
CREATE TABLE `ä`.`ä` (a int) ENGINE=Memory;
---replace_column 6 # 7 # 8 # 9 #
+--replace_column 6 # 7 # 8 # 9 # 12 #
SHOW TABLE STATUS FROM `ä` LIKE 'ä';
DROP DATABASE `ä`;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 6175fc53adf..063b30c01cb 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -2541,6 +2541,28 @@ DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # Bug#12428824 - PARSER STACK OVERFLOW AND CRASH IN SP_ADD_USED_ROUTINE
+--echo # WITH OBSCURE QUERY
+--echo #
+
+--error ER_TOO_LONG_IDENT
+SELECT very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+
+--error ER_TOO_LONG_IDENT
+CALL very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+
+--error ER_WRONG_DB_NAME
+SELECT very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_func();
+
+--error ER_WRONG_DB_NAME
+CALL very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_proc();
+
+--error ER_TOO_LONG_IDENT
+SELECT db_name.very_long_fn_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
+
+--error ER_TOO_LONG_IDENT
+CALL db_name.very_long_pr_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
--echo End of 5.1 tests
--echo #
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index d7ea829bf50..ca4e6b04f13 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -959,6 +959,43 @@ drop user bug57061_user@localhost;
drop database mysqltest_db;
+--echo #
+--echo # Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE
+--echo # DEFINITION OF ANY ROUTINE.
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SELECT 1;
+CREATE USER user2@localhost IDENTIFIED BY '';
+GRANT SELECT(db) ON mysql.proc TO user2@localhost;
+
+--echo # Connection con2 as user2
+connect (con2, localhost, user2);
+--echo # The statement below before disclosed info from body_utf8 column.
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PROCEDURE db1.p1;
+
+--echo # Check that SHOW works with SELECT grant on whole table
+--echo # Connection default
+connection default;
+GRANT SELECT ON mysql.proc TO user2@localhost;
+
+--echo # Connection con2
+connection con2;
+--echo # This should work
+SHOW CREATE PROCEDURE db1.p1;
+
+--echo # Connection default
+connection default;
+disconnect con2;
+DROP USER user2@localhost;
+DROP DATABASE db1;
+
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 2b83e9a10dc..acbf75d9f01 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -8385,6 +8385,53 @@ SET @@GLOBAL.init_connect= @old_init_connect;
DROP PROCEDURE p2;
DROP PROCEDURE p5;
+
+--echo #
+--echo # Bug#11840395 (formerly known as bug#60347):
+--echo # The string "versiondata" seems
+--echo # to be 'leaking' into the schema name space
+--echo #
+--disable_warnings
+DROP DATABASE IF EXISTS mixedCaseDbName;
+--enable_warnings
+CREATE DATABASE mixedCaseDbName;
+DELIMITER |;
+CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end|
+CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin return 'IT WORKS'; end
+|
+DELIMITER ;|
+call mixedCaseDbName.tryMyProc();
+select mixedCaseDbName.tryMyFunc();
+DROP DATABASE mixedCaseDbName;
+
+
+--echo #
+--echo # Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, KEY(b));
+CREATE TABLE t2 (c INT, d INT, KEY(c));
+INSERT INTO t1 VALUES (1,1),(1,1),(1,2);
+INSERT INTO t2 VALUES (1,1),(1,2);
+
+DELIMITER $;
+
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+ DECLARE a int;
+ -- SQL statement inside
+ SELECT 1 INTO a;
+ RETURN a;
+END $
+
+DELIMITER ;$
+
+SELECT COUNT(DISTINCT d) FROM t1, t2 WHERE a = c AND b = f1();
+
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
+
+
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
@@ -8787,4 +8834,60 @@ DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
--echo
+
+--echo
+--echo # --
+--echo # -- Bug#12652769 - 61470: case operator in stored routine retains old
+--echo # -- value of input parameter
+--echo # ---
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf8);
+INSERT INTO t1 VALUES ('a');
+
+delimiter |;
+
+CREATE PROCEDURE p1(dt DATETIME, i INT)
+BEGIN
+ SELECT
+ CASE
+ WHEN i = 1 THEN 2
+ ELSE dt
+ END AS x1;
+
+ SELECT
+ CASE _latin1'a'
+ WHEN _utf8'a' THEN 'A'
+ END AS x2;
+
+ SELECT
+ CASE _utf8'a'
+ WHEN _latin1'a' THEN _utf8'A'
+ END AS x3;
+
+ SELECT
+ CASE s1
+ WHEN _latin1'a' THEN _latin1'b'
+ ELSE _latin1'c'
+ END AS x4
+ FROM t1;
+END|
+
+delimiter ;|
+
+--echo
+CALL p1('2011-04-03 05:14:10', 1);
+CALL p1('2011-04-03 05:14:11', 2);
+CALL p1('2011-04-03 05:14:12', 2);
+CALL p1('2011-04-03 05:14:13', 2);
+
+--echo
+DROP TABLE t1;
+DROP PROCEDURE p1;
+--echo
+
--echo # End of 5.5 test
diff --git a/mysql-test/t/sp_sync.test b/mysql-test/t/sp_sync.test
index 368a09eac8c..589832bb570 100644
--- a/mysql-test/t/sp_sync.test
+++ b/mysql-test/t/sp_sync.test
@@ -1,7 +1,7 @@
# This test should work in embedded server after mysqltest is fixed
-- source include/not_embedded.inc
---echo Tests of syncronization of stored procedure execution.
+--echo Tests of synchronization of stored procedure execution.
--source include/have_debug_sync.inc
@@ -149,9 +149,34 @@ disconnect con2;
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP TABLES t0, t1;
-SET DEBUG_SYNC= 'RESET';
+--echo #
+--echo # test for bug#11756013
+--echo #
+--disable_warnings
+DROP SCHEMA IF EXISTS s1;
+--enable_warnings
+CREATE SCHEMA s1;
+CREATE PROCEDURE s1.p1() BEGIN END;
+
+connect (con3, localhost, root);
+SET DEBUG_SYNC='before_db_dir_check SIGNAL check_db WAIT_FOR dropped_schema';
+--send CALL s1.p1
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR check_db';
+DROP SCHEMA s1;
+SET DEBUG_SYNC='now SIGNAL dropped_schema';
+
+connection con3;
+--error ER_BAD_DB_ERROR
+--reap
+connection default;
+disconnect con3;
+
+SET DEBUG_SYNC = 'RESET';
+
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index c114d397e43..39ac086071b 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -598,6 +598,39 @@ select distinct f1, bug13575(f1) from t3 order by f1|
drop function bug13575|
drop table t3|
+#
+# BUG#11758414: Default storage_engine not honored when set
+# from within a stored procedure
+#
+SELECT @@GLOBAL.storage_engine INTO @old_engine|
+SET @@GLOBAL.storage_engine=InnoDB|
+SET @@SESSION.storage_engine=InnoDB|
+# show defaults at define-time
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+CREATE PROCEDURE bug11758414()
+BEGIN
+ SET @@GLOBAL.storage_engine="MyISAM";
+ SET @@SESSION.storage_engine="MyISAM";
+ # show defaults at execution time / that setting them worked
+ SHOW GLOBAL VARIABLES LIKE 'storage_engine';
+ SHOW SESSION VARIABLES LIKE 'storage_engine';
+ CREATE TABLE t1 (id int);
+ CREATE TABLE t2 (id int) ENGINE=InnoDB;
+ # show we're heeding the default (at run-time, not parse-time!)
+ SHOW CREATE TABLE t1;
+ # show that we didn't break explicit override with ENGINE=...
+ SHOW CREATE TABLE t2;
+END;
+|
+CALL bug11758414|
+# show that changing defaults within SP stuck
+SHOW GLOBAL VARIABLES LIKE 'storage_engine'|
+SHOW SESSION VARIABLES LIKE 'storage_engine'|
+DROP PROCEDURE bug11758414|
+DROP TABLE t1, t2|
+SET @@GLOBAL.storage_engine=@old_engine|
+
--echo #
--echo # End of 5.1 tests
--echo #
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 7444af790e5..0b368f5be67 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3433,6 +3433,39 @@ ORDER BY outr.pk;
DROP TABLE t1,t2;
+#--echo #
+#--echo # Bug#12329653
+#--echo # EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
+#--echo #
+#
+#CREATE TABLE t1(a1 int);
+#INSERT INTO t1 VALUES (1),(2);
+#
+#SELECT @@session.sql_mode INTO @old_sql_mode;
+#SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+#
+### First a simpler query, illustrating the transformation
+### '1 < some (...)' => '1 < max(...)'
+#SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1);
+#
+### The query which made the server crash.
+#PREPARE stmt FROM
+#'SELECT 1 UNION ALL
+#SELECT 1 FROM t1
+#ORDER BY
+#(SELECT 1 FROM t1 AS t1_0
+# WHERE 1 < SOME (SELECT a1 FROM t1)
+#)' ;
+#
+#--error ER_SUBQUERY_NO_1_ROW
+#EXECUTE stmt ;
+#--error ER_SUBQUERY_NO_1_ROW
+#EXECUTE stmt ;
+#
+#SET SESSION sql_mode=@old_sql_mode;
+#
+#DEALLOCATE PREPARE stmt;
+#DROP TABLE t1;
--echo End of 5.0 tests.
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index 45cf80aab5c..b33c51566a0 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -307,4 +307,27 @@ INSERT INTO t1 VALUES(-1.79769313486231e+308);
SELECT f1 FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
+--echo #
+
+--echo # Ignoring output from misc. float operations
+--disable_result_log
+
+let $nine_65=
+99999999999999999999999999999999999999999999999999999999999999999;
+
+select format(-1.7976931348623157E+307,256) as foo;
+select least(-1.1111111111111111111111111,
+ - group_concat(1.7976931348623157E+308)) as foo;
+eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
+ ($nine_65)) into @a;
+--enable_result_log
+
--echo End of 5.0 tests
+
+--echo #
+--echo # Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
+--echo #
+
+select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index f1eeabbd924..4f4b1962cc3 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1535,3 +1535,17 @@ DROP TABLE IF EXISTS t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # BUG#12911710 - VALGRIND FAILURE IN
+--echo # ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
+--echo #
+
+CREATE TABLE t1(d1 DECIMAL(60,0) NOT NULL,
+ d2 DECIMAL(60,0) NOT NULL);
+
+INSERT INTO t1 (d1, d2) VALUES(0.0, 0.0);
+SELECT d1 * d2 FROM t1;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index db7f8397c7b..c9bc3f5e1aa 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1124,6 +1124,47 @@ insert into t1 values (10),(10),(10),(2),(3),(4),(5),(6),(7),(8),(9),(1),(10);
select a from t1 where false UNION select a from t1 limit 8;
drop table t1;
+--echo #
+--echo # Bug#11765255 58201:
+--echo # VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+--echo #
+
+let $my_stmt=
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+select 4
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+
+eval $my_stmt;
+
+eval prepare stmt1 from '$my_stmt';
+execute stmt1;
+execute stmt1;
+
+let $my_stmt=
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+(select 4)
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+
+eval $my_stmt;
+
+eval prepare stmt1 from '$my_stmt';
+execute stmt1;
+execute stmt1;
+
+deallocate prepare stmt1;
+
--echo End of 5.1 tests
--echo #
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 89c0b8992b1..b36bd2067cc 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -665,5 +665,14 @@ SET NAMES latin1;
SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
--echo #
+--echo # Bug#12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
+--echo #
+SELECT UPDATEXML('','(a)/a','');
+SELECT UPDATEXML('<a><a>x</a></a>','(a)/a','<b />');
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />');
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />');
+SELECT ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b');
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 34f164bc731..739cc587ac0 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -1203,3 +1203,46 @@
fun:buf_buddy_free_low
fun:buf_buddy_free
}
+
+# Note the wildcard in the (mangled) function signatures of
+# write_keys() and find_all_keys().
+# They both return ha_rows, which is platform dependent.
+#
+# The '...' wildcards are for 'fun:inline_mysql_file_write' which *may*
+# be inlined.
+{
+ Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / one
+ Memcheck:Param
+ write(buf)
+ obj:*/libpthread*.so
+ fun:my_write
+ ...
+ fun:my_b_flush_io_cache
+ fun:_my_b_write
+ fun:_Z*10write_keysP13st_sort_paramPPhjP11st_io_cacheS4_
+ fun:_Z*13find_all_keysP13st_sort_paramP10SQL_SELECTPPhP11st_io_cacheS6_S6_
+ fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
+}
+
+{
+ Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / two
+ Memcheck:Param
+ write(buf)
+ obj:*/libpthread*.so
+ fun:my_write
+ ...
+ fun:my_b_flush_io_cache
+ fun:_Z15merge_many_buffP13st_sort_paramPhP10st_buffpekPjP11st_io_cache
+ fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
+}
+
+{
+ Bug#12856915 VALGRIND FAILURE IN FILESORT/CREATE_SORT_INDEX / three
+ Memcheck:Param
+ write(buf)
+ obj:*/libpthread*.so
+ fun:my_write
+ ...
+ fun:my_b_flush_io_cache
+ fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPy
+}
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index ca338369dad..0eadd4629c6 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysys/array.c b/mysys/array.c
index d5a4a6fa284..c969da83586 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Handling of arrays that can grow dynamicly. */
diff --git a/mysys/base64.c b/mysys/base64.c
index ab66715c929..b48bcb85e03 100644
--- a/mysys/base64.c
+++ b/mysys/base64.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <m_string.h> /* strchr() */
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 703cd8568e0..11416f11c06 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2003-2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
diff --git a/mysys/charset.c b/mysys/charset.c
index 98b87ba9feb..e3c5c945500 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/checksum.c b/mysys/checksum.c
index c8d3c1a038d..7bc52c6a178 100644
--- a/mysys/checksum.c
+++ b/mysys/checksum.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
diff --git a/mysys/errors.c b/mysys/errors.c
index 2a9b3e770d2..fe0122c2e94 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/hash.c b/mysys/hash.c
index 38914d5f350..b93f6b666d6 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* The hash functions used for saveing keys */
/* One of key_length or key_length_offset must be given */
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index ab88828d2f6..5eda20c3236 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -1,5 +1,5 @@
/* QQ: TODO multi-pinbox */
-/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
wait-free concurrent allocator based on pinning addresses
diff --git a/mysys/lf_dynarray.c b/mysys/lf_dynarray.c
index 0941c8762bb..3d072fd063e 100644
--- a/mysys/lf_dynarray.c
+++ b/mysys/lf_dynarray.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Analog of DYNAMIC_ARRAY that never reallocs
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 2c89f5ca7ca..28e97192f18 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
extensible hash
diff --git a/mysys/list.c b/mysys/list.c
index e68fbf519d1..fb46120db04 100644
--- a/mysys/list.c
+++ b/mysys/list.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Code for handling dubble-linked lists in C
diff --git a/mysys/mf_cache.c b/mysys/mf_cache.c
index 691532c0d80..545084ea97f 100644
--- a/mysys/mf_cache.c
+++ b/mysys/mf_cache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Open a temporary file and cache it with io_cache. Delete it on close */
diff --git a/mysys/mf_dirname.c b/mysys/mf_dirname.c
index 5a9440483e4..569293f5401 100644
--- a/mysys/mf_dirname.c
+++ b/mysys/mf_dirname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/mf_fn_ext.c b/mysys/mf_fn_ext.c
index c872f2993c4..47fc67cabbd 100644
--- a/mysys/mf_fn_ext.c
+++ b/mysys/mf_fn_ext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
diff --git a/mysys/mf_format.c b/mysys/mf_format.c
index 74f114a966f..2b2356c08df 100644
--- a/mysys/mf_format.c
+++ b/mysys/mf_format.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/mf_getdate.c b/mysys/mf_getdate.c
index 70278e64003..ed8544a23fe 100644
--- a/mysys/mf_getdate.c
+++ b/mysys/mf_getdate.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Get date in a printable form: yyyy-mm-dd hh:mm:ss */
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index cde11f3cae5..908f5c65cf7 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Cashing of files with only does (sequential) read or writes of fixed-
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 85631e9741b..3c23d0737e7 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
More functions to be used with IO_CACHE files
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 80111b3245d..4321a3aa072 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c
index 9ea5678da9a..7dbfc26a365 100644
--- a/mysys/mf_keycaches.c
+++ b/mysys/mf_keycaches.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003-2007 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Handling of multiple key caches
diff --git a/mysys/mf_loadpath.c b/mysys/mf_loadpath.c
index 510c72ffa38..0b24731f2a7 100644
--- a/mysys/mf_loadpath.c
+++ b/mysys/mf_loadpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index 790936461a4..18c9a38f0db 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mysys/mf_path.c b/mysys/mf_path.c
index 92cb62e6827..725cf278f6f 100644
--- a/mysys/mf_path.c
+++ b/mysys/mf_path.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/mf_sort.c b/mysys/mf_sort.c
index a3e7465ead0..9ef02787716 100644
--- a/mysys/mf_sort.c
+++ b/mysys/mf_sort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Sort of string pointers in string-order with radix or qsort */
diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c
index c84987cfc96..eceb90bb619 100644
--- a/mysys/mf_tempdir.c
+++ b/mysys/mf_tempdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index e85124fb4c3..15482075c39 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/mf_unixpath.c b/mysys/mf_unixpath.c
index ee81aae4584..6777c27bc96 100644
--- a/mysys/mf_unixpath.c
+++ b/mysys/mf_unixpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <m_string.h>
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index 923e00d2182..f2bd029e522 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Routines to handle mallocing of results which will be freed the same time */
diff --git a/mysys/my_atomic.c b/mysys/my_atomic.c
index 7cbe15cfb74..26348b518ae 100644
--- a/mysys/my_atomic.c
+++ b/mysys/my_atomic.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <my_sys.h>
diff --git a/mysys/my_bit.c b/mysys/my_bit.c
index f072f243765..d36f52bb3c0 100644
--- a/mysys/my_bit.c
+++ b/mysys/my_bit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index 8f86e5832f6..414d5acaaf0 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2000 MySQL AB
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (C) 2009- 2011 Monty Program Ab
+/*
+ Copyright (c) 2001, 2011, Oracle and/or its affiliates.
+ Copyright (C) 2009, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index b9013811b34..97ecd881af1 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_compress.c b/mysys/my_compress.c
index 98f96f6b2b6..ea56900db05 100644
--- a/mysys/my_compress.c
+++ b/mysys/my_compress.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sinisa Milivojevic <sinisa@mysql.com> */
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index c2f4f53a780..802913b141f 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_create.c b/mysys/my_create.c
index 49529f9b7b5..2e4e8eb1af2 100644
--- a/mysys/my_create.c
+++ b/mysys/my_create.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2001, 2005-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <my_dir.h>
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index 4a23fedb5ab..cf9573f592b 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_error.c b/mysys/my_error.c
index 48b907d48cb..3302add688b 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_file.c b/mysys/my_file.c
index a6a4244a772..bb81fd5f06b 100644
--- a/mysys/my_file.c
+++ b/mysys/my_file.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "my_static.h"
diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c
index 83cb0d261c0..e758609741b 100644
--- a/mysys/my_fstream.c
+++ b/mysys/my_fstream.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* USE_MY_STREAM isn't set because we can't thrust my_fclose! */
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
index ab44bac43d3..54823a7c5ca 100644
--- a/mysys/my_gethwaddr.c
+++ b/mysys/my_gethwaddr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* get hardware address for an interface */
/* if there are many available, any non-zero one can be used */
diff --git a/mysys/my_getncpus.c b/mysys/my_getncpus.c
index a7631e15966..a17d8812e04 100644
--- a/mysys/my_getncpus.c
+++ b/mysys/my_getncpus.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* get the number of (online) CPUs */
diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c
index ace14c8a3c9..3552081b85f 100644
--- a/mysys/my_getwd.c
+++ b/mysys/my_getwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* my_setwd() and my_getwd() works with intern_filenames !! */
diff --git a/mysys/my_handler_errors.h b/mysys/my_handler_errors.h
index 8f2a8b750bd..42839fd31f5 100644
--- a/mysys/my_handler_errors.h
+++ b/mysys/my_handler_errors.h
@@ -1,6 +1,21 @@
#ifndef MYSYS_MY_HANDLER_ERRORS_INCLUDED
#define MYSYS_MY_HANDLER_ERRORS_INCLUDED
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
/*
Errors a handler can give you
*/
@@ -66,6 +81,8 @@ static const char *handler_error_messages[]=
"Read page with wrong checksum",
"Too many active concurrent transactions",
"Index column length exceeds limit",
+ "Index corrupted",
+ "Undo record too big",
"Row is not visible by the current transaction",
"Operation was interrupted by end user (probably kill command?)",
"Disk full"
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 580e29c381a..6bbc11714ca 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "my_static.h"
@@ -99,10 +99,6 @@ my_bool my_init(void)
if (my_thread_global_init())
return 1;
-#if defined(HAVE_PTHREAD_INIT)
- pthread_init(); /* Must be called before DBUG_ENTER */
-#endif
-
/* $HOME is needed early to parse configuration files located in ~/ */
if ((home_dir= getenv("HOME")) != 0)
home_dir= intern_filename(home_dir_buff, home_dir);
diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c
index 9f5ab01a2b7..59f815a9d87 100644
--- a/mysys/my_largepage.c
+++ b/mysys/my_largepage.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 06f9521a664..b42a3d55d93 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* TODO: check for overun of memory for names. */
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index 96abded4cc3..c9e599904fa 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_lockmem.c b/mysys/my_lockmem.c
index a37db6b2089..8f06192d9f8 100644
--- a/mysys/my_lockmem.c
+++ b/mysys/my_lockmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Alloc a block of locked memory */
diff --git a/mysys/my_mess.c b/mysys/my_mess.c
index 513afe39054..8ee816b385a 100644
--- a/mysys/my_mess.c
+++ b/mysys/my_mess.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c
index 82ee1562bc2..acd4862eaca 100644
--- a/mysys/my_mmap.c
+++ b/mysys/my_mmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
diff --git a/mysys/my_new.cc b/mysys/my_new.cc
index 7da54ffac87..377d9be22a8 100644
--- a/mysys/my_new.cc
+++ b/mysys/my_new.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2001, 2003-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This is a replacement of new/delete operators to be used when compiling
diff --git a/mysys/my_once.c b/mysys/my_once.c
index 32d07802028..7df9b0a1981 100644
--- a/mysys/my_once.c
+++ b/mysys/my_once.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Not MT-SAFE */
diff --git a/mysys/my_open.c b/mysys/my_open.c
index bac0be46766..cfbc9257aec 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index 9d513a08418..4aa12eec33c 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index f0b3b1e8aef..d29cbcc5048 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to get threads more portable */
diff --git a/mysys/my_quick.c b/mysys/my_quick.c
index b93e7e17224..2d5e9fb95ca 100644
--- a/mysys/my_quick.c
+++ b/mysys/my_quick.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Quicker interface to read & write. Used with my_nosys.h */
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c
index 2afe3ec31dd..028c7f810d4 100644
--- a/mysys/my_rdtsc.c
+++ b/mysys/my_rdtsc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2010 Sun Microsystems, Inc
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
rdtsc3 -- multi-platform timer code
diff --git a/mysys/my_read.c b/mysys/my_read.c
index dbe9006a1d3..ca5fbfaeef6 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_redel.c b/mysys/my_redel.c
index 1b200568a47..7f4e95f4f74 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_rename.c b/mysys/my_rename.c
index 1a4e7b2b409..6704d7c87d0 100644
--- a/mysys/my_rename.c
+++ b/mysys/my_rename.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include <my_dir.h>
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index efe0416c49a..505aec0a3c0 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_sleep.c b/mysys/my_sleep.c
index 5a18a2854d6..77eb466aee8 100644
--- a/mysys/my_sleep.c
+++ b/mysys/my_sleep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Wait a given number of microseconds */
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 60e23e8dfa9..ae32ae6387e 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Static variables for mysys library. All definied here for easy making of
diff --git a/mysys/my_static.h b/mysys/my_static.h
index 0f1cd34a04e..a44a4b26c3d 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -1,7 +1,7 @@
#ifndef MYSYS_MY_STATIC_INCLUDED
#define MYSYS_MY_STATIC_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Static variables for mysys library. All definied here for easy making of
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index b001354275d..7fe7a92f54e 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
@@ -147,22 +147,23 @@ int my_realpath(char *to, const char *filename, myf MyFlags)
result= -1;
}
DBUG_RETURN(result);
-#else
-#ifdef _WIN32
+#elif defined(_WIN32)
int ret= GetFullPathName(filename,FN_REFLEN, to, NULL);
if (ret == 0 || ret > FN_REFLEN)
{
- if (ret > FN_REFLEN)
- my_errno= ENAMETOOLONG;
- else
- my_errno= EACCES;
+ my_errno= (ret > FN_REFLEN) ? ENAMETOOLONG : GetLastError();
if (MyFlags & MY_WME)
my_error(EE_REALPATH, MYF(0), filename, my_errno);
+ /*
+ GetFullPathName didn't work : use my_load_path() which is a poor
+ substitute original name but will at least be able to resolve
+ paths that starts with '.'.
+ */
+ my_load_path(to, filename, NullS);
return -1;
}
#else
my_load_path(to, filename, NullS);
#endif
return 0;
-#endif
}
diff --git a/mysys/my_sync.c b/mysys/my_sync.c
index 4d187631786..a18f82bcf64 100644
--- a/mysys/my_sync.c
+++ b/mysys/my_sync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 121392be8c3..ee9bc91e910 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions to handle initializating and allocationg of all mysys & debug
diff --git a/mysys/my_timer_cycles.il b/mysys/my_timer_cycles.il
index 2f3f776530b..e655cad2a2e 100644
--- a/mysys/my_timer_cycles.il
+++ b/mysys/my_timer_cycles.il
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 Sun Microsystems, Inc
+/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Sun Studio SPARC inline templates for cycle timer */
/* Sun Studio i386 and x86_64 inline templates for cycle timer */
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index bed64230aea..f88e33e17f3 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*****************************************************************************
** The following is a simple implementation of posix conditions
diff --git a/mysys/my_windac.c b/mysys/my_windac.c
index 0c924188623..51fe22e8f59 100644
--- a/mysys/my_windac.c
+++ b/mysys/my_windac.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "m_string.h"
diff --git a/mysys/my_winerr.c b/mysys/my_winerr.c
index 534078b6737..15f52dd7f37 100644
--- a/mysys/my_winerr.c
+++ b/mysys/my_winerr.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Convert Windows API error (GetLastError() to Posix equivalent (errno)
diff --git a/mysys/my_winfile.c b/mysys/my_winfile.c
index 4d80d774dad..ad87bf718d2 100644
--- a/mysys/my_winfile.c
+++ b/mysys/my_winfile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
The purpose of this file is to provide implementation of file IO routines on
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 54b8463fe0b..d9f5149e6c9 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*****************************************************************************
** Simulation of posix threads calls for Windows
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 46b0d749944..e873228620a 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysys_priv.h"
#include "mysys_err.h"
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 2f669878f49..2c0c8bf82f8 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <my_sys.h>
diff --git a/mysys/ptr_cmp.c b/mysys/ptr_cmp.c
index dcafe13291d..6f9ab13c82b 100644
--- a/mysys/ptr_cmp.c
+++ b/mysys/ptr_cmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
get_ptr_compare(len) returns a pointer to a optimal byte-compare function
diff --git a/mysys/rijndael.c b/mysys/rijndael.c
index 2d622efad82..e893a886726 100644
--- a/mysys/rijndael.c
+++ b/mysys/rijndael.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c
index c2e930d76e2..d0897fabb52 100644
--- a/mysys/stacktrace.c
+++ b/mysys/stacktrace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <my_stacktrace.h>
diff --git a/mysys/string.c b/mysys/string.c
index fa669ceda3a..d9791341c60 100644
--- a/mysys/string.c
+++ b/mysys/string.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Code for handling strings with can grow dynamicly.
diff --git a/mysys/test_charset.c b/mysys/test_charset.c
index 39df1b02d7b..49e25b8d5cd 100644
--- a/mysys/test_charset.c
+++ b/mysys/test_charset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <m_ctype.h>
diff --git a/mysys/testhash.c b/mysys/testhash.c
index 376303f29be..ffdaaece770 100644
--- a/mysys/testhash.c
+++ b/mysys/testhash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Test of hash library: big test */
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index f902057a71b..adce7407239 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* To avoid problems with alarms in debug code, we disable DBUG here */
#define FORCE_DBUG_OFF
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index b2e51cde260..61f18d9dddf 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Read and write locks for Posix threads. All tread must acquire
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 83395adaf61..de222e7047f 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This makes a wrapper for mutex handling to make it easier to debug mutex */
diff --git a/mysys/thr_rwlock.c b/mysys/thr_rwlock.c
index a6eb16a4b1b..17fafecd8fd 100644
--- a/mysys/thr_rwlock.c
+++ b/mysys/thr_rwlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Synchronization - readers / writer thread locks */
diff --git a/mysys/tree.c b/mysys/tree.c
index 03c4ac5b36b..85770194f25 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Code for handling red-black (balanced) binary trees.
diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt
index 4048273fc03..a5970703720 100644
--- a/packaging/WiX/CMakeLists.txt
+++ b/packaging/WiX/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/packaging/WiX/CPackWixConfig.cmake b/packaging/WiX/CPackWixConfig.cmake
index f49406b5787..9ebb2398a2b 100644
--- a/packaging/WiX/CPackWixConfig.cmake
+++ b/packaging/WiX/CPackWixConfig.cmake
@@ -1,3 +1,17 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
IF(ESSENTIALS)
SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
diff --git a/packaging/WiX/ca/CMakeLists.txt b/packaging/WiX/ca/CMakeLists.txt
index 6872dc99d94..81622a1d158 100644
--- a/packaging/WiX/ca/CMakeLists.txt
+++ b/packaging/WiX/ca/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/packaging/WiX/ca/CustomAction.cpp b/packaging/WiX/ca/CustomAction.cpp
index 806535bc79a..444e003c3f2 100644
--- a/packaging/WiX/ca/CustomAction.cpp
+++ b/packaging/WiX/ca/CustomAction.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef UNICODE
#define UNICODE
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in
index dd2e9fd9d85..8de271fc1cf 100644
--- a/packaging/WiX/create_msi.cmake.in
+++ b/packaging/WiX/create_msi.cmake.in
@@ -1,3 +1,18 @@
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@")
diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs
index 1dc1ef28e4f..a77612c4e50 100644
--- a/packaging/WiX/custom_ui.wxs
+++ b/packaging/WiX/custom_ui.wxs
@@ -1,5 +1,23 @@
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+
+<!--
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+-->
+
<UI Id="WixUI_Mondo_Custom">
<Dialog Id="CustomWelcomeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in
index fe2e73c3340..91bf3f64b8e 100644
--- a/packaging/WiX/extra.wxs.in
+++ b/packaging/WiX/extra.wxs.in
@@ -1,6 +1,23 @@
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+<!--
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+-->
+
<!-- Datafiles that installation will copy to CommonAppData (initial database)
They are declared Permanent and NeverOverwrite since it is user data -->
<DirectoryRef Id='TARGETDIR'>
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in
index 43a30538384..370830d82db 100644
--- a/packaging/WiX/mysql_server.wxs.in
+++ b/packaging/WiX/mysql_server.wxs.in
@@ -1,5 +1,23 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+
+<!--
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+-->
+
<Product
Id="*"
UpgradeCode="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3"
diff --git a/plugin/audit_null/audit_null.c b/plugin/audit_null/audit_null.c
index 161bd1cea70..469e5ae494c 100644
--- a/plugin/audit_null/audit_null.c
+++ b/plugin/audit_null/audit_null.c
@@ -1,12 +1,13 @@
-/* Copyright (C) 2006-2007 MySQL AB
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; version 2 of
+ the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
@@ -153,7 +154,8 @@ mysql_declare_plugin(audit_null)
0x0002, /* version */
simple_status, /* status variables */
NULL, /* system variables */
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
diff --git a/plugin/auth_examples/dialog_examples.c b/plugin/auth_examples/dialog_examples.c
index 0d8897042c9..9c4728b7886 100644
--- a/plugin/auth_examples/dialog_examples.c
+++ b/plugin/auth_examples/dialog_examples.c
@@ -134,7 +134,8 @@ mysql_declare_plugin(dialog)
0x0100,
NULL,
NULL,
- NULL
+ NULL,
+ 0,
},
{
MYSQL_AUTHENTICATION_PLUGIN,
@@ -148,7 +149,8 @@ mysql_declare_plugin(dialog)
0x0100,
NULL,
NULL,
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
diff --git a/plugin/auth_examples/qa_auth_interface.c b/plugin/auth_examples/qa_auth_interface.c
index a768995fbfd..303978f7b1f 100644
--- a/plugin/auth_examples/qa_auth_interface.c
+++ b/plugin/auth_examples/qa_auth_interface.c
@@ -152,7 +152,8 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
diff --git a/plugin/auth_examples/qa_auth_server.c b/plugin/auth_examples/qa_auth_server.c
index 31cc4f08616..a6a06cfa289 100644
--- a/plugin/auth_examples/qa_auth_server.c
+++ b/plugin/auth_examples/qa_auth_server.c
@@ -72,6 +72,7 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
diff --git a/plugin/auth_examples/test_plugin.c b/plugin/auth_examples/test_plugin.c
index da9ab51bb58..2b20a8cb56c 100644
--- a/plugin/auth_examples/test_plugin.c
+++ b/plugin/auth_examples/test_plugin.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -115,7 +115,8 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
- NULL
+ NULL,
+ 0,
},
{
MYSQL_AUTHENTICATION_PLUGIN,
@@ -129,7 +130,8 @@ mysql_declare_plugin(test_plugin)
0x0100,
NULL,
NULL,
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
diff --git a/plugin/auth_socket/auth_socket.c b/plugin/auth_socket/auth_socket.c
index 2aa4a0794ea..dbc8513e5dd 100644
--- a/plugin/auth_socket/auth_socket.c
+++ b/plugin/auth_socket/auth_socket.c
@@ -1,5 +1,5 @@
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -98,7 +98,8 @@ mysql_declare_plugin(socket_auth)
0x0100,
NULL,
NULL,
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
maria_declare_plugin(socket_auth)
diff --git a/plugin/daemon_example/CMakeLists.txt b/plugin/daemon_example/CMakeLists.txt
index 60aa00687ba..1623c3025d7 100644
--- a/plugin/daemon_example/CMakeLists.txt
+++ b/plugin/daemon_example/CMakeLists.txt
@@ -15,3 +15,5 @@
MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc
MODULE_ONLY MODULE_OUTPUT_NAME "libdaemon_example")
+
+INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR})
diff --git a/plugin/daemon_example/daemon_example.cc b/plugin/daemon_example/daemon_example.cc
index 79b58d27414..ab374a4fb3f 100644
--- a/plugin/daemon_example/daemon_example.cc
+++ b/plugin/daemon_example/daemon_example.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -201,7 +201,8 @@ mysql_declare_plugin(daemon_example)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(daemon_example)
diff --git a/plugin/daemon_example/daemon_example.ini b/plugin/daemon_example/daemon_example.ini
new file mode 100644
index 00000000000..7c6d4d1456e
--- /dev/null
+++ b/plugin/daemon_example/daemon_example.ini
@@ -0,0 +1,9 @@
+#
+# Plugin configuration file. Place the following on a separate line:
+#
+# library binary file name (without .so or .dll)
+# component_name
+# [component_name] - additional components in plugin
+#
+libdaemon_example
+daemon_example
diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c
index 13715094850..b58f3e9eda5 100644
--- a/plugin/fulltext/plugin_example.c
+++ b/plugin/fulltext/plugin_example.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -267,7 +267,8 @@ mysql_declare_plugin(ftexample)
0x0001, /* version */
simple_status, /* status variables */
simple_system_variables, /* system variables */
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index bfdea128e68..8656a40a3f4 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -1,5 +1,6 @@
/* Copyright (C) 2007 Google Inc.
- Copyright (C) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc
+ Copyright (c) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -307,18 +308,18 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
* The most important functions during semi-syn replication listed:
*
* Master:
- * . reportReplyBinlog(): called by the binlog dump thread when it receives
- * the slave's status information.
- * . updateSyncHeader(): based on transaction waiting information, decide
- * whether to request the slave to reply.
- * . writeTraxInBinlog(): called by the transaction thread when it finishes
- * writing all transaction events in binlog.
- * . commitTrx(): transaction thread wait for the slave reply.
+ * . reportReplyBinlog(): called by the binlog dump thread when it receives
+ * the slave's status information.
+ * . updateSyncHeader(): based on transaction waiting information, decide
+ * whether to request the slave to reply.
+ * . writeTranxInBinlog(): called by the transaction thread when it finishes
+ * writing all transaction events in binlog.
+ * . commitTrx(): transaction thread wait for the slave reply.
*
* Slave:
* . slaveReadSyncHeader(): read the semi-sync header from the master, get the
- * sync status and get the payload for events.
- * . slaveReply(): reply to the master about the replication progress.
+ * sync status and get the payload for events.
+ * . slaveReply(): reply to the master about the replication progress.
*
******************************************************************************/
diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h
index dfadf85f271..841c24197fc 100644
--- a/plugin/semisync/semisync_master.h
+++ b/plugin/semisync/semisync_master.h
@@ -1,6 +1,6 @@
/* Copyright (C) 2007 Google Inc.
- Copyright (C) 2008 MySQL AB
- Copyright (C) 2009 Sun Microsystems, Inc
+ Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/plugin/semisync/semisync_master_plugin.cc b/plugin/semisync/semisync_master_plugin.cc
index a55ba184a17..9a325018242 100644
--- a/plugin/semisync/semisync_master_plugin.cc
+++ b/plugin/semisync/semisync_master_plugin.cc
@@ -1,5 +1,6 @@
/* Copyright (C) 2007 Google Inc.
- Copyright (C) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc
+ Copyright (c) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -428,6 +429,7 @@ mysql_declare_plugin(semi_sync_master)
0x0100 /* 1.0 */,
semi_sync_master_status_vars, /* status variables */
semi_sync_master_system_vars, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
diff --git a/plugin/semisync/semisync_slave.cc b/plugin/semisync/semisync_slave.cc
index 109577fb688..5f98472d5d7 100644
--- a/plugin/semisync/semisync_slave.cc
+++ b/plugin/semisync/semisync_slave.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/plugin/semisync/semisync_slave.h b/plugin/semisync/semisync_slave.h
index 19ea43e2653..1bf8cf31972 100644
--- a/plugin/semisync/semisync_slave.h
+++ b/plugin/semisync/semisync_slave.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc
index cfb04bdd276..d5472b9cc83 100644
--- a/plugin/semisync/semisync_slave_plugin.cc
+++ b/plugin/semisync/semisync_slave_plugin.cc
@@ -225,6 +225,7 @@ mysql_declare_plugin(semi_sync_slave)
0x0100 /* 1.0 */,
semi_sync_slave_status_vars, /* status variables */
semi_sync_slave_system_vars, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
diff --git a/plugin/win_auth_client/common.cc b/plugin/win_auth_client/common.cc
index 1d1f2938969..9544e7734f5 100644
--- a/plugin/win_auth_client/common.cc
+++ b/plugin/win_auth_client/common.cc
@@ -22,6 +22,24 @@ template <> void error_log_print<error_log_level::INFO>(const char *fmt, ...);
template <> void error_log_print<error_log_level::WARNING>(const char *fmt, ...);
template <> void error_log_print<error_log_level::ERROR>(const char *fmt, ...);
+/**
+ Option indicating desired level of logging. Values:
+
+ 0 - no logging
+ 1 - log only error messages
+ 2 - additionally log warnings
+ 3 - additionally log info notes
+ 4 - also log debug messages
+
+ Value of this option should be taken into account in the
+ implementation of error_log_vprint() function (see
+ log_client.cc).
+
+ Note: No error or debug messages are logged in production code
+ (see logging macros in common.h).
+*/
+int opt_auth_win_log_level= 2;
+
/** Connection class **************************************************/
diff --git a/plugin/win_auth_client/common.h b/plugin/win_auth_client/common.h
index ff0f7153664..7f7aa1d2dff 100644
--- a/plugin/win_auth_client/common.h
+++ b/plugin/win_auth_client/common.h
@@ -41,13 +41,15 @@ struct error_log_level
typedef enum {INFO, WARNING, ERROR} type;
};
+extern "C" int opt_auth_win_log_level;
+unsigned int get_log_level(void);
+void set_log_level(unsigned int);
+
/*
If DEBUG_ERROR_LOG is defined then error logging happens only
in debug-copiled code. Otherwise ERROR_LOG() expands to
- error_log_print() even in production code. Note that in client
- plugin, error_log_print() will print nothing if opt_auth_win_clinet_log
- is 0.
+ error_log_print() even in production code.
Note: Macro ERROR_LOG() can use printf-like format string like this:
@@ -57,8 +59,6 @@ struct error_log_level
to fprintf() (see error_log_vprint() function).
*/
-extern "C" int opt_auth_win_client_log;
-
#if defined(DEBUG_ERROR_LOG) && defined(DBUG_OFF)
#define ERROR_LOG(Level, Msg) do {} while (0)
#else
@@ -67,7 +67,7 @@ extern "C" int opt_auth_win_client_log;
void error_log_vprint(error_log_level::type level,
- const char *fmt, va_list args);
+ const char *fmt, va_list args);
template <error_log_level::type Level>
void error_log_print(const char *fmt, ...)
@@ -96,7 +96,7 @@ const char* get_last_error_message(Error_message_buf);
#define DBUG_PRINT_DO(Keyword, Msg) \
do { \
- if (2 > opt_auth_win_client_log) break; \
+ if (4 > get_log_level()) break; \
fprintf(stderr, "winauth: %s: ", Keyword); \
debug_msg Msg; \
} while (0)
diff --git a/plugin/win_auth_client/handshake_client.cc b/plugin/win_auth_client/handshake_client.cc
index 7e89fc92ae7..02e5483da29 100644
--- a/plugin/win_auth_client/handshake_client.cc
+++ b/plugin/win_auth_client/handshake_client.cc
@@ -161,6 +161,21 @@ int Handshake_client::write_packet(Blob &data)
keep all the data.
*/
unsigned block_count= data.len()/512 + ((data.len() % 512) ? 1 : 0);
+
+#if !defined(DBUG_OFF) && defined(WINAUTH_USE_DBUG_LIB)
+
+ /*
+ For testing purposes, use wrong block count to see how server
+ handles this.
+ */
+ DBUG_EXECUTE_IF("winauth_first_packet_test",{
+ block_count= data.len() == 601 ? 0 :
+ data.len() == 602 ? 1 :
+ block_count;
+ });
+
+#endif
+
DBUG_ASSERT(block_count < (unsigned)0x100);
saved_byte= data[254];
data[254] = block_count;
@@ -323,13 +338,13 @@ int win_auth_handshake_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
int opt_val= opt ? atoi(opt) : 0;
if (opt && !opt_val)
{
- if (!strncasecmp("on", opt, 2)) opt_val= 1;
- if (!strncasecmp("yes", opt, 3)) opt_val= 1;
- if (!strncasecmp("true", opt, 4)) opt_val= 1;
- if (!strncasecmp("debug", opt, 5)) opt_val= 2;
- if (!strncasecmp("dbug", opt, 4)) opt_val= 2;
+ if (!strncasecmp("on", opt, 2)) opt_val= 2;
+ if (!strncasecmp("yes", opt, 3)) opt_val= 2;
+ if (!strncasecmp("true", opt, 4)) opt_val= 2;
+ if (!strncasecmp("debug", opt, 5)) opt_val= 4;
+ if (!strncasecmp("dbug", opt, 4)) opt_val= 4;
}
- opt_auth_win_client_log= opt_val;
+ set_log_level(opt_val);
}
ERROR_LOG(INFO, ("Authentication handshake for account %s", mysql->user));
diff --git a/plugin/win_auth_client/log_client.cc b/plugin/win_auth_client/log_client.cc
index df4ce4f9c2a..8a49c4220bb 100644
--- a/plugin/win_auth_client/log_client.cc
+++ b/plugin/win_auth_client/log_client.cc
@@ -16,36 +16,32 @@
#include <my_global.h>
#include "common.h"
-/**
- This option is set in win_auth_handshake_client() function
- in handshake_client.cc.
-
- Values:
- 0 - no logging
- 1 - log error/warning/info messages
- 2 - also log debug messages
-
- Note: No error or debug messages are logged in production code
- (see logging macros in common.h).
-*/
-int opt_auth_win_client_log= 0;
-
// Client-side logging function
void error_log_vprint(error_log_level::type level,
const char *fmt, va_list args)
{
- if (0 == opt_auth_win_client_log)
- return;
-
const char *level_string= "";
+ int log_level= get_log_level();
switch (level)
{
- case error_log_level::INFO: level_string= "Note"; break;
- case error_log_level::WARNING: level_string= "Warning"; break;
- case error_log_level::ERROR: level_string= "ERROR"; break;
+ case error_log_level::INFO:
+ if (3 > log_level)
+ return;
+ level_string= "Note";
+ break;
+ case error_log_level::WARNING:
+ if (2 > log_level)
+ return;
+ level_string= "Warning";
+ break;
+ case error_log_level::ERROR:
+ if (1 > log_level)
+ return;
+ level_string= "ERROR";
+ break;
}
fprintf(stderr, "Windows Authentication Plugin %s: ", level_string);
@@ -53,3 +49,17 @@ void error_log_vprint(error_log_level::type level,
fputc('\n', stderr);
fflush(stderr);
}
+
+
+// Trivial implementation of log-level setting storage.
+
+void set_log_level(unsigned int level)
+{
+ opt_auth_win_log_level= level;
+}
+
+
+unsigned int get_log_level(void)
+{
+ return opt_auth_win_log_level;
+}
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 56b7f779bb0..424d92e31e1 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -65,7 +65,7 @@ ADD_CUSTOM_TARGET(GenFixPrivs
IF(UNIX)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
- "cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake" )
+ "cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake\n" )
EXECUTE_PROCESS(
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
)
@@ -104,11 +104,11 @@ IF(UNIX)
# FIND_PROC and CHECK_PID are used by mysqld_safe
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET (FIND_PROC
- "ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null")
+ "ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
ENDIF()
IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET (FIND_PROC
- "ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null")
+ "ps -p $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
ENDIF()
IF(NOT FIND_PROC)
@@ -116,7 +116,7 @@ IF(NOT FIND_PROC)
EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
SET( FIND_PROC
- "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null")
+ "ps -uaxww | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
ENDIF()
@@ -124,7 +124,7 @@ IF(NOT FIND_PROC)
# SysV style
EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
IF(result MATCHES 0)
- SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null")
+ SET( FIND_PROC "ps -ef | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
ENDIF()
ENDIF()
diff --git a/scripts/dheadgen.pl b/scripts/dheadgen.pl
index 374b232a04e..c42bd49b32e 100755
--- a/scripts/dheadgen.pl
+++ b/scripts/dheadgen.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright (c) 2008, 2009 Sun Microsystems, Inc.
# Use is subject to license terms.
#
diff --git a/scripts/mysql_config.pl.in b/scripts/mysql_config.pl.in
index fb48979eb7b..acf33699b05 100644
--- a/scripts/mysql_config.pl.in
+++ b/scripts/mysql_config.pl.in
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- cperl -*-
#
-# Copyright (C) 2007 MySQL AB
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##############################################################################
#
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 6463b3bf099..c05b311cc7b 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2000-2006 MySQL AB
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# This script reports various configuration settings that may be needed
# when using the MySQL client library.
diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh
index 7983982913c..5f3e093d2b9 100644
--- a/scripts/mysql_convert_table_format.sh
+++ b/scripts/mysql_convert_table_format.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2002 MySQL AB
+# Copyright (c) 2000-2002, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh
index 967a8196ebd..48c4915ae00 100644
--- a/scripts/mysql_find_rows.sh
+++ b/scripts/mysql_find_rows.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000, 2004 MySQL AB
+# Copyright (c) 2000, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh
index 74a47fdf4a1..2a50bfe22bb 100644
--- a/scripts/mysql_fix_extensions.sh
+++ b/scripts/mysql_fix_extensions.sh
@@ -1,6 +1,7 @@
#!/usr/bin/perl
-# Copyright (C) 2001 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2001 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -14,8 +15,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
# This is a utility for MySQL. It is not needed by any standard part
# of MySQL.
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
index 2119a1b650a..83756d686d2 100644
--- a/scripts/mysql_install_db.pl.in
+++ b/scripts/mysql_install_db.pl.in
@@ -61,10 +61,15 @@ Usage: $0 [OPTIONS]
--cross-bootstrap For internal use. Used when building the MySQL system
tables on a different host than the target.
--datadir=path The path to the MySQL data directory.
+ --defaults-extra-file=name
+ Read this file after the global files are read.
+ --defaults-file=name Only read default options from the given file name.
--force Causes mysql_install_db to run even if DNS does not
work. In that case, grant table entries that normally
use hostnames will use IP addresses.
+ --help Display this help and exit.
--ldata=path The path to the MySQL data directory. Same as --datadir.
+ --no-defaults Don't read default options from any option file.
--rpm For internal use. This option is used by RPM files
during the MySQL installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 5b21de31f6d..0454654ad1d 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+# Copyright (c) 2000-2008 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
# Copyright (C) 2002-2003 MySQL AB & Monty Program Ab
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -45,12 +47,16 @@ Usage: $0 [OPTIONS]
--cross-bootstrap For internal use. Used when building the MariaDB system
tables on a different host than the target.
--datadir=path The path to the MariaDB data directory.
+ --defaults-extra-file=name
+ Read this file after the global files are read.
+ --defaults-file=name Only read default options from the given file name.
--force Causes mysql_install_db to run even if DNS does not
work. In that case, grant table entries that normally
use hostnames will use IP addresses.
+ --help Display this help and exit.
--ldata=path The path to the MariaDB data directory. Same as
--datadir.
- --no-defaults Don't read any configuration files (my.cnf).
+ --no-defaults Don't read default options from any option file.
--defaults-file=path Read only this configuration file.
--rpm For internal use. This option is used by RPM files
during the MariaDB installation process.
diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in
index 0cd99267cdb..543b8d1b1c0 100755
--- a/scripts/mysql_secure_installation.pl.in
+++ b/scripts/mysql_secure_installation.pl.in
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- cperl -*-
#
-# Copyright (C) 2002 MySQL AB and Jeremy Cole
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
use Fcntl;
use File::Spec;
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
index d59f1ac8565..d5ace68ea76 100644
--- a/scripts/mysql_secure_installation.sh
+++ b/scripts/mysql_secure_installation.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2002 MySQL AB and Jeremy Cole
+# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
config=".my.cnf.$$"
command=".mysql.$$"
diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh
index 433f30dfabb..f23011a5ae6 100644
--- a/scripts/mysql_setpermission.sh
+++ b/scripts/mysql_setpermission.sh
@@ -1,7 +1,8 @@
#!/usr/bin/perl
## Emacs, this is -*- perl -*- mode? :-)
-# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -15,8 +16,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
##
## Permission setter for MySQL
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index e1ac071fd3b..5179f35c0b6 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -1,4 +1,4 @@
--- Copyright (C) 2008, 2010 Oracle and/or its affiliates.
+-- Copyright (C) 2008, 2011 Oracle and/or its affiliates.
-- Copyright (C) 2010, 2011 Monty Program Ab
--
-- This program is free software; you can redistribute it and/or modify
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index 0d6127d2173..a3b6f6cbfef 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -1,4 +1,4 @@
--- Copyright (C) 2007, 2008 MySQL AB
+-- Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
--- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--
-- The inital data for system tables of MySQL Server
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 1ad06b6013d..697838b55a3 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -1,4 +1,4 @@
--- Copyright (C) 2003, 2010 Oracle and/or its affiliates.
+-- Copyright (C) 2003, 2011 Oracle and/or its affiliates.
-- Copyright (C) 2010, 2011 Monty Program Ab
--
-- This program is free software; you can redistribute it and/or modify
diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh
index f78212e2578..a9c3e7a7f5a 100644
--- a/scripts/mysql_zap.sh
+++ b/scripts/mysql_zap.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2002, 2004 MySQL AB
+# Copyright (c) 2000-2002, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index 4e208e6c16e..bab0dbf5b87 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -1,6 +1,7 @@
#!/usr/bin/perl
-# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -14,8 +15,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
# ****************************
package MySQLaccess;
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 6b421034447..9d2571b201f 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -1,5 +1,22 @@
#!/usr/bin/perl
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
+
use Getopt::Long;
use POSIX qw(strftime getcwd);
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index de565678f9b..0de4fe159f0 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -1,4 +1,23 @@
#!/usr/bin/perl
+
+# Copyright (c) 2000-2002, 2005-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
+
# mysqldumpslow - parse and summarize the MySQL slow query log
# Original version by Tim Bunce, sometime in 2000.
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index d605f6ef02d..b7fb73cf1dd 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -1,5 +1,22 @@
#!/usr/bin/perl
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
+
use strict;
use Getopt::Long;
use Data::Dumper;
diff --git a/sql-bench/as3ap.sh b/sql-bench/as3ap.sh
index 1c672377fd3..52e790cafeb 100644
--- a/sql-bench/as3ap.sh
+++ b/sql-bench/as3ap.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2001, 2003 MySQL AB
+# Copyright (c) 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# AS3AP single-user benchmark.
#
diff --git a/sql-bench/bench-count-distinct.sh b/sql-bench/bench-count-distinct.sh
index 5cc9fb555af..923af98648a 100644
--- a/sql-bench/bench-count-distinct.sh
+++ b/sql-bench/bench-count-distinct.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2001, 2003 MySQL AB
+# Copyright (c) 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# Test of selecting on keys that consist of many parts
#
diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh
index f1d4bd9edec..a46bb2d7a49 100644
--- a/sql-bench/bench-init.pl.sh
+++ b/sql-bench/bench-init.pl.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2003, 2005 MySQL AB
+# Copyright (c) 2000-2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
##########################################################
# this is the base file every test is using ....
diff --git a/sql-bench/compare-results.sh b/sql-bench/compare-results.sh
index fe3563bd0b9..91d29685ee3 100644
--- a/sql-bench/compare-results.sh
+++ b/sql-bench/compare-results.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# a little program to generate a table of results
# just read all the RUN-*.log files and format them nicely
diff --git a/sql-bench/copy-db.sh b/sql-bench/copy-db.sh
index e0c290d2453..082db2203aa 100644
--- a/sql-bench/copy-db.sh
+++ b/sql-bench/copy-db.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000, 2003 MySQL AB
+# Copyright (c) 2000, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# start initialition
#
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh
index cc8659513c2..473a66933cc 100644
--- a/sql-bench/crash-me.sh
+++ b/sql-bench/crash-me.sh
@@ -1,6 +1,7 @@
#!/usr/bin/perl
# -*- perl -*-
-# Copyright (C) 2000-2006 MySQL AB
+# Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -14,8 +15,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
# Written by Monty for the TCX/Monty Program/Detron benchmark suite.
# Empress and PostgreSQL patches by Luuk de Boer
diff --git a/sql-bench/run-all-tests.sh b/sql-bench/run-all-tests.sh
index a4b03428d94..4e4b372b759 100644
--- a/sql-bench/run-all-tests.sh
+++ b/sql-bench/run-all-tests.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2003, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# This program runs all test that starts with 'test-' and sums
# the results that the program prints.
diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh
index de92fd80a40..8b7cdfdb103 100644
--- a/sql-bench/server-cfg.sh
+++ b/sql-bench/server-cfg.sh
@@ -1,6 +1,7 @@
#!/usr/bin/perl
# -*- perl -*-
-# Copyright (C) 2000-2006 MySQL AB
+# Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -14,8 +15,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# The configuration file for the DBI/DBD tests on different databases ....
# You will need the DBD module for the database you are running.
diff --git a/sql-bench/test-ATIS.sh b/sql-bench/test-ATIS.sh
index ee697d4f319..ca1132435ff 100644
--- a/sql-bench/test-ATIS.sh
+++ b/sql-bench/test-ATIS.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# Test of creating the ATIS database and doing many different selects on it
#
diff --git a/sql-bench/test-alter-table.sh b/sql-bench/test-alter-table.sh
index 03d40a01276..6dc5ce35841 100644
--- a/sql-bench/test-alter-table.sh
+++ b/sql-bench/test-alter-table.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# Test of alter table
#
diff --git a/sql-bench/test-big-tables.sh b/sql-bench/test-big-tables.sh
index de2b0830bd3..68b4afaa429 100644
--- a/sql-bench/test-big-tables.sh
+++ b/sql-bench/test-big-tables.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# Test of extreme tables.
#
diff --git a/sql-bench/test-connect.sh b/sql-bench/test-connect.sh
index d2b8530ed0d..50024e7e055 100644
--- a/sql-bench/test-connect.sh
+++ b/sql-bench/test-connect.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# This test is for testing the speed of connections and sending
# data to the client.
diff --git a/sql-bench/test-create.sh b/sql-bench/test-create.sh
index e2a51f96fff..235cacd86ec 100644
--- a/sql-bench/test-create.sh
+++ b/sql-bench/test-create.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2003 MySQL AB
+# Copyright (c) 2000-2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# This test is for testing how long it takes to create tables,
# make a count(*) from them and finally drop the tables. These
diff --git a/sql-bench/test-insert.sh b/sql-bench/test-insert.sh
index 387cb48e494..e264c7d529f 100644
--- a/sql-bench/test-insert.sh
+++ b/sql-bench/test-insert.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2003 MySQL AB
+# Copyright (c) 2000-2003, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# Test of creating a simple table and inserting $record_count records in it,
# $opt_loop_count rows in order, $opt_loop_count rows in reverse order and
diff --git a/sql-bench/test-select.sh b/sql-bench/test-select.sh
index a3162b29dc3..1752c05079b 100644
--- a/sql-bench/test-select.sh
+++ b/sql-bench/test-select.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# Test of selecting on keys that consist of many parts
#
diff --git a/sql-bench/test-transactions.sh b/sql-bench/test-transactions.sh
index f6de5641cbd..b0aee8c6d38 100644
--- a/sql-bench/test-transactions.sh
+++ b/sql-bench/test-transactions.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2001, 2003 MySQL AB
+# Copyright (c) 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
# Test of transactions performance.
#
diff --git a/sql-bench/test-wisconsin.sh b/sql-bench/test-wisconsin.sh
index 0dbd88dd62d..4fb3bc65f35 100644
--- a/sql-bench/test-wisconsin.sh
+++ b/sql-bench/test-wisconsin.sh
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000-2001, 2003 MySQL AB
+# Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -13,8 +14,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
#
use Cwd;
diff --git a/sql-common/client.c b/sql-common/client.c
index 6db20153eaa..638dab9afc4 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index add5c60c056..f31ddb22a6a 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -1,5 +1,5 @@
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
- Copyright (C) 2010 Sun Microsystems, Inc.
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index a0fc2aa98de..5a436fa9819 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2006 MySQL AB
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_time.h>
#include <m_string.h>
diff --git a/sql-common/my_user.c b/sql-common/my_user.c
index 0b72e002977..8d717ea7131 100644
--- a/sql-common/my_user.c
+++ b/sql-common/my_user.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_user.h>
#include <m_string.h>
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 1b06252d6a3..5e6e6b48a27 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -107,6 +107,14 @@ ENDIF()
MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
+IF(APPLE)
+ # Add CoreServices framework since some dloadable plugins may need it
+ FIND_LIBRARY(CORESERVICES NAMES CoreServices)
+ IF(CORESERVICES)
+ TARGET_LINK_LIBRARIES(mysqld ${CORESERVICES})
+ ENDIF()
+ENDIF()
+
IF(NOT WITHOUT_DYNAMIC_PLUGINS)
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
GET_TARGET_PROPERTY(mysqld_link_flags mysqld LINK_FLAGS)
diff --git a/sql/authors.h b/sql/authors.h
index 40fcd4c47f8..018c8fabc31 100644
--- a/sql/authors.h
+++ b/sql/authors.h
@@ -1,7 +1,7 @@
#ifndef AUTHORS_INCLUDED
#define AUTHORS_INCLUDED
-/* Copyright (C) 2005-2006 MySQL AB
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/client_settings.h b/sql/client_settings.h
index 0a61c12b64a..54cb72f9412 100644
--- a/sql/client_settings.h
+++ b/sql/client_settings.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef CLIENT_SETTINGS_INCLUDED
@@ -23,9 +23,18 @@
#include <thr_alarm.h>
#include <sql_common.h>
-#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
- CLIENT_SECURE_CONNECTION | CLIENT_TRANSACTIONS | \
- CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
+/*
+ Note: CLIENT_CAPABILITIES is also defined in libmysql/client_settings.h.
+ When adding capabilities here, consider if they should be also added to
+ the libmysql version.
+*/
+#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
+ CLIENT_LONG_FLAG | \
+ CLIENT_SECURE_CONNECTION | \
+ CLIENT_TRANSACTIONS | \
+ CLIENT_PROTOCOL_41 | \
+ CLIENT_SECURE_CONNECTION | \
+ CLIENT_PLUGIN_AUTH)
#define read_user_name(A) {}
#undef _CUSTOMCONFIG_
diff --git a/sql/contributors.h b/sql/contributors.h
index 6cf8bb88e3b..b1ba2c20997 100644
--- a/sql/contributors.h
+++ b/sql/contributors.h
@@ -1,7 +1,8 @@
#ifndef CONTRIBUTORS_INCLUDED
#define CONTRIBUTORS_INCLUDED
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 7e5db3b499d..093650b3673 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
== Debug Sync Facility ==
diff --git a/sql/debug_sync.h b/sql/debug_sync.h
index ba3739e8ad5..930e6c35be9 100644
--- a/sql/debug_sync.h
+++ b/sql/debug_sync.h
@@ -1,7 +1,7 @@
#ifndef DEBUG_SYNC_INCLUDED
#define DEBUG_SYNC_INCLUDED
-/* Copyright (C) 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/derror.h b/sql/derror.h
index cb8ae91acbc..b2f6331e048 100644
--- a/sql/derror.h
+++ b/sql/derror.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/des_key_file.cc b/sql/des_key_file.cc
index d2bf2ebdaa7..b6b6f4536bc 100644
--- a/sql/des_key_file.cc
+++ b/sql/des_key_file.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_global.h" // HAVE_*
#include "sql_priv.h"
diff --git a/sql/des_key_file.h b/sql/des_key_file.h
index d817ff93949..024a1715d47 100644
--- a/sql/des_key_file.h
+++ b/sql/des_key_file.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/discover.cc b/sql/discover.cc
index b129747503e..b9dba92a780 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
diff --git a/sql/discover.h b/sql/discover.h
index 54fb78ddd2f..a663e44128d 100644
--- a/sql/discover.h
+++ b/sql/discover.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index fc9ab35ac8a..eabe215bc3a 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define MYSQL_LEX 1
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index 2c693e5ec43..2483c564dff 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -1,6 +1,6 @@
#ifndef _EVENT_DATA_OBJECTS_H_
#define _EVENT_DATA_OBJECTS_H_
-/* Copyright (C) 2004-2006 MySQL AB
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@addtogroup Event_Scheduler
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 53f9727f489..252dac5f01d 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -1,4 +1,5 @@
-/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/*
+ Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h
index 162ec5d1243..bb708b2b520 100644
--- a/sql/event_db_repository.h
+++ b/sql/event_db_repository.h
@@ -1,6 +1,8 @@
#ifndef _EVENT_DB_REPOSITORY_H_
#define _EVENT_DB_REPOSITORY_H_
-/* Copyright (C) 2004-2006 MySQL AB
+
+/*
+ Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/**
@addtogroup Event_Scheduler
diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc
index 8bffe47f30f..b53e366e27c 100644
--- a/sql/event_parse_data.cc
+++ b/sql/event_parse_data.cc
@@ -1,4 +1,5 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/*
+ Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/event_parse_data.h b/sql/event_parse_data.h
index 85c620760cb..1ea22edf488 100644
--- a/sql/event_parse_data.h
+++ b/sql/event_parse_data.h
@@ -1,4 +1,5 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/*
+ Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _EVENT_PARSE_DATA_H_
#define _EVENT_PARSE_DATA_H_
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index c92c3a835ba..40fddff094c 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/event_queue.h b/sql/event_queue.h
index 5e489ddaa37..affa306b259 100644
--- a/sql/event_queue.h
+++ b/sql/event_queue.h
@@ -1,6 +1,6 @@
#ifndef _EVENT_QUEUE_H_
#define _EVENT_QUEUE_H_
-/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index ab6f0cdccaa..8944b749305 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h
index ecd7031f546..aca4b74dd95 100644
--- a/sql/event_scheduler.h
+++ b/sql/event_scheduler.h
@@ -1,6 +1,6 @@
#ifndef _EVENT_SCHEDULER_H_
#define _EVENT_SCHEDULER_H_
-/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@addtogroup Event_Scheduler
diff --git a/sql/events.cc b/sql/events.cc
index 631092f68e7..00299463dba 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/field.cc b/sql/field.cc
index bf4cb3e4ff9..550cc435467 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1,5 +1,7 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011 Monty Program Ab
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
@@ -11,7 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/**
@file
diff --git a/sql/field.h b/sql/field.h
index 728eb6f3f49..8e7e5a6d854 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1,6 +1,6 @@
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
Copyright (c) 2009-2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -1943,7 +1943,13 @@ public:
int store(longlong nr, bool unsigned_val);
int store_decimal(const my_decimal *);
uint size_of() const { return sizeof(*this); }
- int reset(void) { return !maybe_null() || Field_blob::reset(); }
+
+ /**
+ Non-nullable GEOMETRY types cannot have defaults,
+ but the underlying blob must still be reset.
+ */
+ int reset(void) { return Field_blob::reset() || !maybe_null(); }
+
geometry_type get_geometry_type() { return geom_type; };
};
#endif /*HAVE_SPATIAL*/
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index a0f6a159c05..8808d73f622 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@@ -178,7 +178,10 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
((Field_timestamp*) field)->set_time();
return 0; // Ok to set time to NULL
}
+
+ // Note: we ignore any potential failure of reset() here.
field->reset();
+
if (field == field->table->next_number_field)
{
field->table->auto_increment_field_not_null= FALSE;
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 13b5d0e2bd5..ebef3b2716b 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -145,8 +145,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
error= 1;
bzero((char*) &param,sizeof(param));
param.sort_length= sortlength(thd, sortorder, s_length, &multi_byte_charset);
- /* filesort cannot handle zero-length records. */
- DBUG_ASSERT(param.sort_length);
param.ref_length= table->file->ref_length;
if (!(table->file->ha_table_flags() & HA_FAST_KEY_READ) &&
!table->fulltext_searched && !sort_positions)
@@ -258,6 +256,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
else
{
thd->query_plan_flags|= QPLAN_FILESORT_DISK;
+
+ /* filesort cannot handle zero-length records during merge. */
+ DBUG_ASSERT(param.sort_length != 0);
+
if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
{
my_free(table_sort.buffpek);
@@ -999,21 +1001,10 @@ static void make_sortkey(register SORTPARAM *param,
if (addonf->null_bit && field->is_null())
{
nulls[addonf->null_offset]|= addonf->null_bit;
-#ifdef HAVE_valgrind
- bzero(to, addonf->length);
-#endif
}
else
{
-#ifdef HAVE_valgrind
- uchar *end= field->pack(to, field->ptr);
- uint length= (uint) ((to + addonf->length) - end);
- DBUG_ASSERT((int) length >= 0);
- if (length)
- bzero(end, length);
-#else
(void) field->pack(to, field->ptr);
-#endif
}
to+= addonf->length;
}
diff --git a/sql/filesort.h b/sql/filesort.h
index a4056415d32..8ee8999d055 100644
--- a/sql/filesort.h
+++ b/sql/filesort.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/frm_crypt.cc b/sql/frm_crypt.cc
index 821e61c5247..5612908aea5 100644
--- a/sql/frm_crypt.cc
+++ b/sql/frm_crypt.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/sql/frm_crypt.h b/sql/frm_crypt.h
index e119dceae35..0605644b3e0 100644
--- a/sql/frm_crypt.h
+++ b/sql/frm_crypt.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index d442d029ba0..e2ced8c8326 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -84,6 +85,8 @@ So, we can read full search-structure as 32-bit word
#include <stdio.h>
#include <string.h>
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
struct hash_lex_struct
{
int first_char;
@@ -374,24 +377,9 @@ int main(int argc,char **argv)
/* Broken up to indicate that it's not advice to you, gentle reader. */
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
- printf("\
-/* Copyright (C) 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
-\n\
- This program is free software; you can redistribute it and/or modify\n\
- it under the terms of the GNU General Public License as published by\n\
- the Free Software Foundation; version 2 of the License.\n\
-\n\
- This program is distributed in the hope that it will be useful,\n\
- but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
- GNU General Public License for more details.\n\
-\n\
- You should have received a copy of the GNU General Public License\n\
- along with this program; see the file COPYING. If not, write to the\n\
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston\n\
- MA 02110-1301 USA. */\n\
-\n\
-");
+ puts("/*");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
+ puts("*/");
/* Broken up to indicate that it's not advice to you, gentle reader. */
printf("/* Do " "not " "edit " "this " "file! This is generated by "
diff --git a/sql/gstream.cc b/sql/gstream.cc
index fcb9a91ac50..61263380411 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions to read and parse geometrical data.
diff --git a/sql/gstream.h b/sql/gstream.h
index 7c079c7bdb3..533fafa28f3 100644
--- a/sql/gstream.h
+++ b/sql/gstream.h
@@ -1,7 +1,7 @@
#ifndef GSTREAM_INCLUDED
#define GSTREAM_INCLUDED
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_global.h" /* NULL, NullS */
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 773b6155c68..7a62efb1917 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11026,7 +11026,8 @@ mysql_declare_plugin(ndbcluster)
0x0100 /* 1.0 */,
ndb_status_variables_export,/* status variables */
system_variables, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(ndbcluster)
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 83205084209..f3c9553f524 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -1,7 +1,8 @@
#ifndef HA_NDBCLUSTER_INCLUDED
#define HA_NDBCLUSTER_INCLUDED
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This file defines the NDB Cluster handler: the interface between MySQL and
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index c4b71bf32cf..040b5778dbd 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h
index 5dbcf0fa43f..1cc20c954cb 100644
--- a/sql/ha_ndbcluster_binlog.h
+++ b/sql/ha_ndbcluster_binlog.h
@@ -1,7 +1,8 @@
#ifndef HA_NDBCLUSTER_BINLOG_INCLUDED
#define HA_NDBCLUSTER_BINLOG_INCLUDED
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "sql_class.h" /* THD */
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index c5540976f93..c580ae86439 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
This handler was developed by Mikael Ronstrom for version 5.1 of MySQL.
@@ -7220,7 +7222,8 @@ mysql_declare_plugin(partition)
0x0100, /* 1.0 */
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(partition)
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 45ac8168513..46a8924c883 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -1,7 +1,8 @@
#ifndef HA_PARTITION_INCLUDED
#define HA_PARTITION_INCLUDED
-/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
diff --git a/sql/handler.cc b/sql/handler.cc
index 1aeb818b65d..b2736e4559d 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -362,6 +362,7 @@ int ha_init_errors(void)
SETMSG(HA_ERR_AUTOINC_ERANGE, ER_DEFAULT(ER_WARN_DATA_OUT_OF_RANGE));
SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER_DEFAULT(ER_TOO_MANY_CONCURRENT_TRXS));
SETMSG(HA_ERR_INDEX_COL_TOO_LONG, ER_DEFAULT(ER_INDEX_COLUMN_TOO_LONG));
+ SETMSG(HA_ERR_INDEX_CORRUPT, ER_DEFAULT(ER_INDEX_CORRUPT));
SETMSG(HA_ERR_DISK_FULL, ER_DEFAULT(ER_DISK_FULL));
/* Register the error messages for use with my_error(). */
@@ -3010,6 +3011,12 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_INDEX_COL_TOO_LONG:
textno= ER_INDEX_COLUMN_TOO_LONG;
break;
+ case HA_ERR_INDEX_CORRUPT:
+ textno= ER_INDEX_CORRUPT;
+ break;
+ case HA_ERR_UNDO_REC_TOO_BIG:
+ textno= ER_UNDO_RECORD_TOO_BIG;
+ break;
default:
{
/* The error was "unknown" to this function.
diff --git a/sql/handler.h b/sql/handler.h
index b27c897364b..7a75253f040 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1,6 +1,7 @@
#ifndef HANDLER_INCLUDED
#define HANDLER_INCLUDED
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011 Monty Program Ab
This program is free software; you can redistribute it and/or
@@ -15,8 +16,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* Definitions for parameters to do with handler-routines */
diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc
index 9d6e4363efc..7c275ffc617 100644
--- a/sql/hash_filo.cc
+++ b/sql/hash_filo.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/sql/hash_filo.h b/sql/hash_filo.h
index 8301f5c8c3b..dab54928a55 100644
--- a/sql/hash_filo.h
+++ b/sql/hash_filo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/sql/hostname.h b/sql/hostname.h
index 03611bb5813..6e9535c2947 100644
--- a/sql/hostname.h
+++ b/sql/hostname.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/init.cc b/sql/init.cc
index e43b12787ab..86915b7aa01 100644
--- a/sql/init.cc
+++ b/sql/init.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
diff --git a/sql/init.h b/sql/init.h
index 2c160879223..88cd8e6e178 100644
--- a/sql/init.h
+++ b/sql/init.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/item.cc b/sql/item.cc
index 0d4b25f4440..e4b7b1f5092 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_IMPLEMENTATION
@@ -5109,14 +5110,14 @@ mark_non_agg_field:
SELECT_LEX *select_lex= cached_table ?
cached_table->select_lex : context->select_lex;
if (!thd->lex->in_sum_func)
- select_lex->full_group_by_flag|= NON_AGG_FIELD_USED;
+ select_lex->set_non_agg_field_used(true);
else
{
if (outer_fixed)
thd->lex->in_sum_func->outer_fields.push_back(this);
else if (thd->lex->in_sum_func->nest_level !=
thd->lex->current_select->nest_level)
- select_lex->full_group_by_flag|= NON_AGG_FIELD_USED;
+ select_lex->set_non_agg_field_used(true);
}
}
return FALSE;
diff --git a/sql/item_buff.cc b/sql/item_buff.cc
index 8c4224404d0..e72c63daf7d 100644
--- a/sql/item_buff.cc
+++ b/sql/item_buff.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index c0d3b14b71b..325e4ac219e 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2901,11 +2901,35 @@ void Item_func_case::agg_num_lengths(Item *arg)
}
+/**
+ Check if (*place) and new_value points to different Items and call
+ THD::change_item_tree() if needed.
+
+ This function is a workaround for implementation deficiency in
+ Item_func_case. The problem there is that the 'args' attribute contains
+ Items from different expressions.
+
+ The function must not be used elsewhere and will be remove eventually.
+*/
+
+static void change_item_tree_if_needed(THD *thd,
+ Item **place,
+ Item *new_value)
+{
+ if (*place == new_value)
+ return;
+
+ thd->change_item_tree(place, new_value);
+}
+
+
void Item_func_case::fix_length_and_dec()
{
Item **agg;
uint nagg;
uint found_types= 0;
+ THD *thd= current_thd;
+
if (!(agg= (Item**) sql_alloc(sizeof(Item*)*(ncases+1))))
return;
@@ -2930,9 +2954,10 @@ void Item_func_case::fix_length_and_dec()
Some of the items might have been changed to Item_func_conv_charset.
*/
for (nagg= 0 ; nagg < ncases / 2 ; nagg++)
- args[nagg * 2 + 1]= agg[nagg];
+ change_item_tree_if_needed(thd, &args[nagg * 2 + 1], agg[nagg]);
+
if (else_expr_num != -1)
- args[else_expr_num]= agg[nagg++];
+ change_item_tree_if_needed(thd, &args[else_expr_num], agg[nagg++]);
}
else
collation.set_numeric();
@@ -2992,9 +3017,10 @@ void Item_func_case::fix_length_and_dec()
arrray, because some of the items might have been changed to converters
(e.g. Item_func_conv_charset, or Item_string for constants).
*/
- args[first_expr_num]= agg[0];
+ change_item_tree_if_needed(thd, &args[first_expr_num], agg[0]);
+
for (nagg= 0; nagg < ncases / 2; nagg++)
- args[nagg * 2]= agg[nagg + 1];
+ change_item_tree_if_needed(thd, &args[nagg * 2], agg[nagg + 1]);
}
for (i= 0; i <= (uint)TIME_RESULT; i++)
diff --git a/sql/item_create.cc b/sql/item_create.cc
index afa78946fb8..315ca857f6f 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/sql/item_create.h b/sql/item_create.h
index 457879a618f..a8a8b9d97dd 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to create an item. Used by sql/sql_yacc.yy */
diff --git a/sql/item_func.cc b/sql/item_func.cc
index bbfa3b74c5e..c765d142285 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1752,8 +1752,13 @@ longlong Item_func_int_div::val_int()
return 0;
}
+ my_decimal truncated;
+ const bool do_truncate= true;
+ if (my_decimal_round(E_DEC_FATAL_ERROR, &tmp, 0, do_truncate, &truncated))
+ DBUG_ASSERT(false);
+
longlong res;
- if (my_decimal2int(E_DEC_FATAL_ERROR, &tmp, unsigned_flag, &res) &
+ if (my_decimal2int(E_DEC_FATAL_ERROR, &truncated, unsigned_flag, &res) &
E_DEC_OVERFLOW)
raise_integer_overflow();
return res;
@@ -5152,8 +5157,9 @@ longlong Item_func_get_user_var::val_int()
*/
-int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
- LEX_STRING &name, user_var_entry **out_entry)
+static int
+get_var_with_binlog(THD *thd, enum_sql_command sql_command,
+ LEX_STRING &name, user_var_entry **out_entry)
{
BINLOG_USER_VAR_EVENT *user_var_event;
user_var_entry *var_entry;
@@ -5283,7 +5289,7 @@ void Item_func_get_user_var::fix_length_and_dec()
'var_entry' is NULL only if there occured an error during the call to
get_var_with_binlog.
*/
- if (var_entry)
+ if (!error && var_entry)
{
m_cached_result_type= var_entry->type;
unsigned_flag= var_entry->unsigned_flag;
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index d734b55a970..621ddcb1a30 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2006 MySQL AB
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
diff --git a/sql/item_row.cc b/sql/item_row.cc
index eb446768423..df03b0e0ebb 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
/*
diff --git a/sql/item_row.h b/sql/item_row.h
index 2141213b194..1d34ecfc310 100644
--- a/sql/item_row.h
+++ b/sql/item_row.h
@@ -1,7 +1,7 @@
#ifndef ITEM_ROW_INCLUDED
#define ITEM_ROW_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
class Item_row: public Item
{
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index a0e5b42767f..5ca66801796 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/**
@file
@@ -2317,7 +2319,7 @@ String *Item_func_format::val_str_ascii(String *str)
return 0; /* purecov: inspected */
nr= my_double_round(nr, (longlong) dec, FALSE, FALSE);
str->set_real(nr, dec, &my_charset_numeric);
- if (isnan(nr))
+ if (isnan(nr) || my_isinf(nr))
return str;
str_length=str->length();
}
@@ -2373,6 +2375,7 @@ String *Item_func_format::val_str_ascii(String *str)
For short values without thousands (<1000)
replace decimal point to localized value.
*/
+ DBUG_ASSERT(dec_length <= str_length);
((char*) str->ptr())[str_length - dec_length]= lc->decimal_point;
}
return str;
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 554052640da..40f1e753d60 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -38,6 +39,7 @@
#include "set_var.h"
#include "sql_select.h"
#include "sql_parse.h" // check_stack_overrun
+#include "sql_test.h"
double get_post_group_estimate(JOIN* join, double join_op_rows);
@@ -2617,7 +2619,8 @@ subselect_single_select_engine(THD *thd_arg, st_select_lex *select,
select_result_interceptor *result_arg,
Item_subselect *item_arg)
:subselect_engine(thd_arg, item_arg, result_arg),
- prepared(0), executed(0), select_lex(select), join(0)
+ prepared(0), executed(0), optimize_error(0),
+ select_lex(select), join(0)
{
select_lex->master_unit()->item= item_arg;
}
@@ -2630,7 +2633,7 @@ int subselect_single_select_engine::get_identifier()
void subselect_single_select_engine::cleanup()
{
DBUG_ENTER("subselect_single_select_engine::cleanup");
- prepared= executed= 0;
+ prepared= executed= optimize_error= 0;
join= 0;
result->cleanup();
select_lex->uncacheable&= ~UNCACHEABLE_DEPENDENT_INJECTED;
@@ -2861,6 +2864,10 @@ int join_read_next_same_or_null(READ_RECORD *info);
int subselect_single_select_engine::exec()
{
DBUG_ENTER("subselect_single_select_engine::exec");
+
+ if (optimize_error)
+ DBUG_RETURN(1);
+
char const *save_where= thd->where;
SELECT_LEX *save_select= thd->lex->current_select;
thd->lex->current_select= select_lex;
@@ -2872,7 +2879,7 @@ int subselect_single_select_engine::exec()
if (join->optimize())
{
thd->where= save_where;
- executed= 1;
+ optimize_error= 1;
thd->lex->current_select= save_select;
DBUG_RETURN(join->error ? join->error : 1);
}
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index de3279aeeef..5beabed9182 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -1,7 +1,7 @@
#ifndef ITEM_SUBSELECT_INCLUDED
#define ITEM_SUBSELECT_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* subselect Item */
@@ -663,6 +663,7 @@ class subselect_single_select_engine: public subselect_engine
{
bool prepared; /* simple subselect is prepared */
bool executed; /* simple subselect is executed */
+ bool optimize_error; ///< simple subselect optimization failed
st_select_lex *select_lex; /* corresponding select_lex */
JOIN * join; /* corresponding JOIN structure */
public:
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 0b8ae2d1d54..55bcf868690 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@@ -259,10 +260,10 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
in_sum_func->outer_fields.push_back(field);
}
else
- sel->full_group_by_flag|= NON_AGG_FIELD_USED;
+ sel->set_non_agg_field_used(true);
}
if (sel->nest_level > aggr_level &&
- (sel->full_group_by_flag & SUM_FUNC_USED) &&
+ (sel->agg_func_used()) &&
!sel->group_list.elements)
{
my_message(ER_MIX_OF_GROUP_FUNC_AND_FIELDS,
@@ -271,7 +272,7 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref)
}
}
}
- aggr_sel->full_group_by_flag|= SUM_FUNC_USED;
+ aggr_sel->set_agg_func_used(true);
update_used_tables();
thd->lex->in_sum_func= in_sum_func;
return FALSE;
diff --git a/sql/item_sum.h b/sql/item_sum.h
index cd5ce3df9fc..c7a222bcd84 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -1,6 +1,7 @@
#ifndef ITEM_SUM_INCLUDED
#define ITEM_SUM_INCLUDED
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* classes for sum functions */
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 2bda3bbab00..da40e3b99d6 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@@ -1320,7 +1321,7 @@ bool get_interval_value(Item *args,interval_type int_type, INTERVAL *interval)
else
{
String *res;
- if (!(res=args->val_str(&str_value)))
+ if (!(res= args->val_str_ascii(&str_value)))
return (1);
/* record negative intervalls in interval->neg */
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 183c07c1781..b93a83c05a9 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2006 MySQL AB
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1982,6 +1982,9 @@ static int my_xpath_parse_UnionExpr(MY_XPATH *xpath)
static int
my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath)
{
+ Item *context= xpath->context;
+ int rc;
+
if (!my_xpath_parse_FilterExpr(xpath))
return 0;
@@ -1995,8 +1998,22 @@ my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath)
return 0;
}
- my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH);
- return my_xpath_parse_RelativeLocationPath(xpath);
+ /*
+ The context for the next relative path is the nodeset
+ returned by FilterExpr
+ */
+ xpath->context= xpath->item;
+
+ /* treat double slash (//) as /descendant-or-self::node()/ */
+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH))
+ xpath->context= new Item_nodeset_func_descendantbyname(xpath->context,
+ "*", 1, xpath->pxml, 1);
+ rc= my_xpath_parse_RelativeLocationPath(xpath);
+
+ /* push back the context and restore the item */
+ xpath->item= xpath->context;
+ xpath->context= context;
+ return rc;
}
static int my_xpath_parse_PathExpr(MY_XPATH *xpath)
{
diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h
index 38dd0a5e1d1..800cf6ed760 100644
--- a/sql/item_xmlfunc.h
+++ b/sql/item_xmlfunc.h
@@ -1,7 +1,8 @@
#ifndef ITEM_XMLFUNC_INCLUDED
#define ITEM_XMLFUNC_INCLUDED
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file defines all XML functions */
diff --git a/sql/key.cc b/sql/key.cc
index 02ef37ec1e5..dd7818119c8 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to handle keys and fields in forms */
diff --git a/sql/key.h b/sql/key.h
index 93f2c07e17a..8bf6f88fa04 100644
--- a/sql/key.h
+++ b/sql/key.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/keycaches.cc b/sql/keycaches.cc
index 984b5a6768b..26a39808c56 100644
--- a/sql/keycaches.cc
+++ b/sql/keycaches.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "keycaches.h"
diff --git a/sql/keycaches.h b/sql/keycaches.h
index 52bd163a0be..04d3f6145e7 100644
--- a/sql/keycaches.h
+++ b/sql/keycaches.h
@@ -1,7 +1,7 @@
#ifndef KEYCACHES_INCLUDED
#define KEYCACHES_INCLUDED
-/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_list.h"
#include <keycache.h>
diff --git a/sql/lex.h b/sql/lex.h
index 37d0f0cc015..ea6e9fd9707 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -1,7 +1,7 @@
#ifndef LEX_INCLUDED
#define LEX_INCLUDED
-/* Copyright (C) 2000-2002 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file includes all reserved words and functions */
diff --git a/sql/lock.cc b/sql/lock.cc
index 8b010968f5f..631e5018cf3 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
diff --git a/sql/lock.h b/sql/lock.h
index 442881c5b9b..a4833cdc38e 100644
--- a/sql/lock.h
+++ b/sql/lock.h
@@ -1,3 +1,18 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
#ifndef LOCK_INCLUDED
#define LOCK_INCLUDED
diff --git a/sql/log.cc b/sql/log.cc
index 133ea907ea0..c60cca3a2e9 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -7642,22 +7642,6 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
-mysql_declare_plugin(binlog)
-{
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &binlog_storage_engine,
- "binlog",
- "MySQL AB",
- "This is a pseudo storage engine to represent the binlog in a transaction",
- PLUGIN_LICENSE_GPL,
- binlog_init, /* Plugin Init */
- NULL, /* Plugin Deinit */
- 0x0100 /* 1.0 */,
- binlog_status_vars_top, /* status variables */
- binlog_sys_vars, /* system variables */
- NULL /* config options */
-}
-mysql_declare_plugin_end;
maria_declare_plugin(binlog)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 49383778b58..93f0f8dd96a 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1,4 +1,5 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef MYSQL_CLIENT
@@ -113,6 +114,11 @@ static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD* thd);
static const char *HA_ERR(int i)
{
+ /*
+ This function should only be called in case of an error
+ was detected
+ */
+ DBUG_ASSERT(i != 0);
switch (i) {
case HA_ERR_KEY_NOT_FOUND: return "HA_ERR_KEY_NOT_FOUND";
case HA_ERR_FOUND_DUPP_KEY: return "HA_ERR_FOUND_DUPP_KEY";
@@ -165,7 +171,7 @@ static const char *HA_ERR(int i)
case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT";
case HA_ERR_ROWS_EVENT_APPLY : return "HA_ERR_ROWS_EVENT_APPLY";
}
- return 0;
+ return "No Error!";
}
/**
@@ -186,7 +192,7 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
TABLE *table, const char * type,
const char *log_name, ulong pos)
{
- const char *handler_error= HA_ERR(ha_error);
+ const char *handler_error= (ha_error ? HA_ERR(ha_error) : NULL);
char buff[MAX_SLAVE_ERRMSG], *slider;
const char *buff_end= buff + sizeof(buff);
uint len;
@@ -8236,7 +8242,8 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
error= do_exec_row(rli);
- DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
+ if (error)
+ DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
DBUG_ASSERT(error != HA_ERR_RECORD_DELETED);
table->in_use = old_thd;
@@ -9101,6 +9108,97 @@ int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len,
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
+enum enum_tbl_map_status
+{
+ /* no duplicate identifier found */
+ OK_TO_PROCESS= 0,
+
+ /* this table map must be filtered out */
+ FILTERED_OUT= 1,
+
+ /* identifier mapping table with different properties */
+ SAME_ID_MAPPING_DIFFERENT_TABLE= 2,
+
+ /* a duplicate identifier was found mapping the same table */
+ SAME_ID_MAPPING_SAME_TABLE= 3
+};
+
+/*
+ Checks if this table map event should be processed or not. First
+ it checks the filtering rules, and then looks for duplicate identifiers
+ in the existing list of rli->tables_to_lock.
+
+ It checks that there hasn't been any corruption by verifying that there
+ are no duplicate entries with different properties.
+
+ In some cases, some binary logs could get corrupted, showing several
+ tables mapped to the same table_id, 0 (see: BUG#56226). Thus we do this
+ early sanity check for such cases and avoid that the server crashes
+ later.
+
+ In some corner cases, the master logs duplicate table map events, i.e.,
+ same id, same database name, same table name (see: BUG#37137). This is
+ different from the above as it's the same table that is mapped again
+ to the same identifier. Thus we cannot just check for same ids and
+ assume that the event is corrupted we need to check every property.
+
+ NOTE: in the event that BUG#37137 ever gets fixed, this extra check
+ will still be valid because we would need to support old binary
+ logs anyway.
+
+ @param rli The relay log info reference.
+ @param table_list A list element containing the table to check against.
+ @return OK_TO_PROCESS
+ if there was no identifier already in rli->tables_to_lock
+
+ FILTERED_OUT
+ if the event is filtered according to the filtering rules
+
+ SAME_ID_MAPPING_DIFFERENT_TABLE
+ if the same identifier already maps a different table in
+ rli->tables_to_lock
+
+ SAME_ID_MAPPING_SAME_TABLE
+ if the same identifier already maps the same table in
+ rli->tables_to_lock.
+*/
+static enum_tbl_map_status
+check_table_map(Relay_log_info const *rli, RPL_TABLE_LIST *table_list)
+{
+ DBUG_ENTER("check_table_map");
+ enum_tbl_map_status res= OK_TO_PROCESS;
+
+ if (rli->sql_thd->slave_thread /* filtering is for slave only */ &&
+ (!rpl_filter->db_ok(table_list->db) ||
+ (rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list))))
+ res= FILTERED_OUT;
+ else
+ {
+ for(RPL_TABLE_LIST *ptr= static_cast<RPL_TABLE_LIST*>(rli->tables_to_lock);
+ ptr;
+ ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_local))
+ {
+ if (ptr->table_id == table_list->table_id)
+ {
+
+ if (strcmp(ptr->db, table_list->db) ||
+ strcmp(ptr->alias, table_list->table_name) ||
+ ptr->lock_type != TL_WRITE) // the ::do_apply_event always sets TL_WRITE
+ res= SAME_ID_MAPPING_DIFFERENT_TABLE;
+ else
+ res= SAME_ID_MAPPING_SAME_TABLE;
+
+ break;
+ }
+ }
+ }
+
+ DBUG_PRINT("debug", ("check of table map ended up with: %u", res));
+
+ DBUG_RETURN(res);
+}
+
int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
{
RPL_TABLE_LIST *table_list;
@@ -9127,18 +9225,11 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
tname_mem, strlen(tname_mem),
tname_mem, TL_WRITE);
- table_list->table_id= m_table_id;
+ table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id);
table_list->updating= 1;
-
- int error= 0;
-
- if (rli->sql_thd->slave_thread /* filtering is for slave only */ &&
- (!rpl_filter->db_ok(table_list->db) ||
- (rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list))))
- {
- my_free(memory);
- }
- else
+ DBUG_PRINT("debug", ("table: %s is mapped to %u", table_list->table_name, table_list->table_id));
+ enum_tbl_map_status tblmap_status= check_table_map(rli, table_list);
+ if (tblmap_status == OK_TO_PROCESS)
{
DBUG_ASSERT(thd->lex->query_tables != table_list);
@@ -9168,8 +9259,48 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
const_cast<Relay_log_info*>(rli)->tables_to_lock_count++;
/* 'memory' is freed in clear_tables_to_lock */
}
+ else // FILTERED_OUT, SAME_ID_MAPPING_*
+ {
+ /*
+ If mapped already but with different properties, we raise an
+ error.
+ If mapped already but with same properties we skip the event.
+ If filtered out we skip the event.
- DBUG_RETURN(error);
+ In all three cases, we need to free the memory previously
+ allocated.
+ */
+ if (tblmap_status == SAME_ID_MAPPING_DIFFERENT_TABLE)
+ {
+ /*
+ Something bad has happened. We need to stop the slave as strange things
+ could happen if we proceed: slave crash, wrong table being updated, ...
+ As a consequence we push an error in this case.
+ */
+
+ char buf[256];
+
+ my_snprintf(buf, sizeof(buf),
+ "Found table map event mapping table id %u which "
+ "was already mapped but with different settings.",
+ table_list->table_id);
+
+ if (thd->slave_thread)
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), buf);
+ else
+ /*
+ For the cases in which a 'BINLOG' statement is set to
+ execute in a user session
+ */
+ my_printf_error(ER_SLAVE_FATAL_ERROR, ER(ER_SLAVE_FATAL_ERROR),
+ MYF(0), buf);
+ }
+
+ my_free(memory);
+ }
+
+ DBUG_RETURN(tblmap_status == SAME_ID_MAPPING_DIFFERENT_TABLE);
}
Log_event::enum_skip_reason
@@ -10187,7 +10318,8 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
restart_rnd_next:
error= table->file->ha_rnd_next(table->record[0]);
- DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
+ if (error)
+ DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
switch (error) {
case 0:
diff --git a/sql/log_event.h b/sql/log_event.h
index 48c781a04fb..e1fdc70663b 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@addtogroup Replication
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index c6efa91f375..a52c584726a 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1,3 +1,17 @@
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#ifndef MYSQL_CLIENT
diff --git a/sql/main.cc b/sql/main.cc
index 249a2a883fe..10141c132a6 100644
--- a/sql/main.cc
+++ b/sql/main.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
main() for mysqld.
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 45f0c02338e..d29f6a112d4 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2008 MySQL AB
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mdl.h"
diff --git a/sql/mdl.h b/sql/mdl.h
index 2fa89ea2f55..3a0ac0037aa 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -1,6 +1,6 @@
#ifndef MDL_H
#define MDL_H
-/* Copyright (C) 2007-2008 MySQL AB
+/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#if defined(__IBMC__) || defined(__IBMCPP__)
/* Further down, "next_in_lock" and "next_in_context" have the same type,
@@ -153,11 +153,24 @@ enum enum_mdl_type {
/** Duration of metadata lock. */
-enum enum_mdl_duration { MDL_STATEMENT= 0,
- MDL_TRANSACTION,
- MDL_EXPLICIT,
- /* This should be the last ! */
- MDL_DURATION_END };
+enum enum_mdl_duration {
+ /**
+ Locks with statement duration are automatically released at the end
+ of statement or transaction.
+ */
+ MDL_STATEMENT= 0,
+ /**
+ Locks with transaction duration are automatically released at the end
+ of transaction.
+ */
+ MDL_TRANSACTION,
+ /**
+ Locks with explicit duration survive the end of statement and transaction.
+ They have to be released explicitly by calling MDL_context::release_lock().
+ */
+ MDL_EXPLICIT,
+ /* This should be the last ! */
+ MDL_DURATION_END };
/** Maximal length of key for metadata locking subsystem. */
diff --git a/sql/message.h b/sql/message.h
index 102d38091e7..8ef0032e423 100644
--- a/sql/message.h
+++ b/sql/message.h
@@ -1,6 +1,7 @@
#ifndef MESSAGE_INCLUDED
#define MESSAGE_INCLUDED
-/* Copyright 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
To change or add messages mysqld writes to the Windows error log, run
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index af0cb660713..d8848c1ee35 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index 1a60d199b13..39be927fd27 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2006 MySQL AB
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include "sql_priv.h"
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 3a309209b90..e0c47029940 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -99,12 +99,8 @@ public:
{
len= DECIMAL_BUFF_LENGTH;
buf= buffer;
-#if !defined (HAVE_valgrind) && !defined(DBUG_OFF)
- /* Set buffer to 'random' value to find wrong buffer usage */
- for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
- buffer[i]= i;
-#endif
}
+
my_decimal()
{
init();
@@ -119,8 +115,6 @@ public:
void swap(my_decimal &rhs)
{
swap_variables(my_decimal, *this, rhs);
- /* Swap the buffer pointers back */
- swap_variables(decimal_digit_t *, buf, rhs.buf);
}
};
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index b2b066230bc..53f7cfe944f 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2111,8 +2111,12 @@ static my_socket activate_tcp_port(uint port)
unireg_abort(1); /* purecov: tested */
}
- for (a= ai; a != NULL && ip_sock == INVALID_SOCKET; a= a->ai_next)
+ for (a= ai; a != NULL; a= a->ai_next)
+ {
ip_sock= socket(a->ai_family, a->ai_socktype, a->ai_protocol);
+ if (ip_sock != INVALID_SOCKET)
+ break;
+ }
if (ip_sock == INVALID_SOCKET)
{
@@ -7189,7 +7193,7 @@ static void usage(void)
if (!default_collation_name)
default_collation_name= (char*) default_charset_info->name;
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
puts("Starts the MySQL database server.\n");
printf("Usage: %s [OPTIONS]\n", my_progname);
if (!opt_verbose)
@@ -8078,12 +8082,15 @@ fn_format_relative_to_data_home(char * to, const char *name,
bool is_secure_file_path(char *path)
{
char buff1[FN_REFLEN], buff2[FN_REFLEN];
+ size_t opt_secure_file_priv_len;
/*
All paths are secure if opt_secure_file_path is 0
*/
if (!opt_secure_file_priv)
return TRUE;
+ opt_secure_file_priv_len= strlen(opt_secure_file_priv);
+
if (strlen(path) >= FN_REFLEN)
return FALSE;
@@ -8099,7 +8106,21 @@ bool is_secure_file_path(char *path)
return FALSE;
}
convert_dirname(buff2, buff1, NullS);
- return is_prefix(buff2, opt_secure_file_priv) ? TRUE : FALSE;
+ if (!lower_case_file_system)
+ {
+ if (strncmp(opt_secure_file_priv, buff2, opt_secure_file_priv_len))
+ return FALSE;
+ }
+ else
+ {
+ if (files_charset_info->coll->strnncoll(files_charset_info,
+ (uchar *) buff2, strlen(buff2),
+ (uchar *) opt_secure_file_priv,
+ opt_secure_file_priv_len,
+ TRUE))
+ return FALSE;
+ }
+ return TRUE;
}
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 281082e2d7e..1ad46f94817 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/mysqld_suffix.h b/sql/mysqld_suffix.h
index c7ab212f2a2..fd515ac5998 100644
--- a/sql/mysqld_suffix.h
+++ b/sql/mysqld_suffix.h
@@ -1,7 +1,8 @@
#ifndef MYSQLD_SUFFIX_INCLUDED
#define MYSQLD_SUFFIX_INCLUDED
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000-2004, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index e5f544747e5..9a61317b1a7 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
TODO:
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 38a47dffc30..a52f3c2cd3a 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* classes to use when handling where clause */
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 3aefa7c99d1..bcc8a42efc6 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index bffcfea3654..699aa7e2b95 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/parse_file.h b/sql/parse_file.h
index a075928c6d0..20e3051e671 100644
--- a/sql/parse_file.h
+++ b/sql/parse_file.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _PARSE_FILE_H_
#define _PARSE_FILE_H_
diff --git a/sql/partition_element.h b/sql/partition_element.h
index f6816cfecf0..87f3d00e68c 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -1,7 +1,7 @@
#ifndef PARTITION_ELEMENT_INCLUDED
#define PARTITION_ELEMENT_INCLUDED
-/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index baea5c2c086..e62b895a839 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Some general useful functions */
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 6ae210d9574..e59d4ec8ba4 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -1,7 +1,7 @@
#ifndef PARTITION_INFO_INCLUDED
#define PARTITION_INFO_INCLUDED
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/password.c b/sql/password.c
index 1b3aa8f356d..a7e599d4777 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* password checking routines */
/*****************************************************************************
diff --git a/sql/procedure.cc b/sql/procedure.cc
index 66e09a42cb4..bdaced20586 100644
--- a/sql/procedure.cc
+++ b/sql/procedure.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002, 2004-2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Procedures (functions with changes output of select) */
diff --git a/sql/procedure.h b/sql/procedure.h
index b0b5583dcb6..6870b97de57 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -1,7 +1,7 @@
#ifndef PROCEDURE_INCLUDED
#define PROCEDURE_INCLUDED
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* When using sql procedures */
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 606bf4ccb00..eb9c3e34dbf 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2011 Oracle and/or its affiliates.
- Copyright (c) 2011 Monty Program Ab
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -368,9 +368,8 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
*/
uint error;
- uchar converted_err[MYSQL_ERRMSG_SIZE];
- uint32 converted_err_len;
- uchar buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
+ char converted_err[MYSQL_ERRMSG_SIZE];
+ char buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
DBUG_ENTER("send_error_packet");
@@ -390,19 +389,16 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
{
/* The first # is to make the protocol backward compatible */
buff[2]= '#';
- pos= (uchar*) strmov((char*) buff+3, sqlstate);
+ pos= strmov(buff+3, sqlstate);
}
- converted_err_len= convert_error_message((char*)converted_err,
- sizeof(converted_err),
- thd->variables.character_set_results,
- err, strlen(err),
- system_charset_info, &error);
- length= (uint) (strmake((char*) pos, (char*)converted_err,
- MYSQL_ERRMSG_SIZE - 1) - (char*) buff);
- err= (char*) buff;
+ convert_error_message(converted_err, sizeof(converted_err),
+ thd->variables.character_set_results,
+ err, strlen(err), system_charset_info, &error);
+ /* Converted error message is always null-terminated. */
+ length= (uint) (strmake(pos, converted_err, MYSQL_ERRMSG_SIZE - 1) - buff);
- DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
+ DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
length));
}
@@ -1038,7 +1034,7 @@ bool Protocol_text::store(const char *from, size_t length,
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
#ifndef DBUG_OFF
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*s", field_pos,
- field_count, (int) length, (length == 0? "" : from)));
+ field_count, (int) length, (length == 0 ? "" : from)));
DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||
diff --git a/sql/protocol.h b/sql/protocol.h
index 7d99901ab44..d9bc48ce45d 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -1,7 +1,7 @@
#ifndef PROTOCOL_INCLUDED
#define PROTOCOL_INCLUDED
-/* Copyright (C) 2002-2006 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
diff --git a/sql/records.cc b/sql/records.cc
index d688ee675e7..a2bb49f9792 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
#pragma implementation /* gcc class implementation */
diff --git a/sql/records.h b/sql/records.h
index fa9bfe3df59..27e861cbd1e 100644
--- a/sql/records.h
+++ b/sql/records.h
@@ -1,6 +1,6 @@
#ifndef SQL_RECORDS_H
#define SQL_RECORDS_H
-/* Copyright (C) 2008 Sun/MySQL
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 9cf96e84928..e355be185db 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2006 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index 2ba1f25c591..2cc031a462d 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -1,7 +1,7 @@
#ifndef REPL_FAILSAFE_INCLUDED
#define REPL_FAILSAFE_INCLUDED
-/* Copyright (C) 2001-2005 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef HAVE_REPLICATION
diff --git a/sql/replication.h b/sql/replication.h
index 1c83025e1d6..8027c4830ec 100644
--- a/sql/replication.h
+++ b/sql/replication.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef REPLICATION_H
#define REPLICATION_H
diff --git a/sql/rpl_constants.h b/sql/rpl_constants.h
index 32fb4b8a7f2..3c605d24563 100644
--- a/sql/rpl_constants.h
+++ b/sql/rpl_constants.h
@@ -1,3 +1,19 @@
+/* Copyright (c) 2007 MySQL AB, 2008 Sun Microsystems, Inc.
+ Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
#ifndef RPL_CONSTANTS_H
#define RPL_CONSTANTS_H
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index a8ed9cfffe0..5f5473e09ab 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "mysqld.h" // system_charset_info
diff --git a/sql/rpl_filter.h b/sql/rpl_filter.h
index 3a261db6754..d32fb36d6fb 100644
--- a/sql/rpl_filter.h
+++ b/sql/rpl_filter.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef RPL_FILTER_H
#define RPL_FILTER_H
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
index 1b1b91c63e9..9267190605c 100644
--- a/sql/rpl_handler.cc
+++ b/sql/rpl_handler.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/rpl_handler.h b/sql/rpl_handler.h
index 9a181250efc..4d1bce45c54 100644
--- a/sql/rpl_handler.h
+++ b/sql/rpl_handler.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef RPL_HANDLER_H
#define RPL_HANDLER_H
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc
index 8f1f494b35a..dfa5ef95e67 100644
--- a/sql/rpl_injector.cc
+++ b/sql/rpl_injector.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h
index 3cb4fa8301e..f4790cc963a 100644
--- a/sql/rpl_injector.h
+++ b/sql/rpl_injector.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index f491db25048..164173467f1 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h> // For HAVE_REPLICATION
#include "sql_priv.h"
@@ -24,6 +25,8 @@
#define DEFAULT_CONNECT_RETRY 60
+static void init_master_log_pos(Master_info* mi);
+
Master_info::Master_info(bool is_slave_recovery)
:Slave_reporting_capability("I/O"),
ssl(0), ssl_verify_server_cert(1), fd(-1), io_thd(0),
@@ -96,6 +99,16 @@ bool Master_info::shall_ignore_server_id(ulong s_id)
!= NULL;
}
+void Master_info::clear_in_memory_info(bool all)
+{
+ init_master_log_pos(this);
+ if (all)
+ {
+ port= MYSQL_PORT;
+ host[0] = 0; user[0] = 0; password[0] = 0;
+ }
+}
+
void init_master_log_pos(Master_info* mi)
{
DBUG_ENTER("init_master_log_pos");
@@ -230,7 +243,7 @@ file '%s')", fname);
}
mi->fd = fd;
- init_master_log_pos(mi);
+ mi->clear_in_memory_info(false);
}
else // file exists
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index d9ba21eccc7..54623577e0b 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef RPL_MI_H
#define RPL_MI_H
@@ -62,6 +62,7 @@ class Master_info : public Slave_reporting_capability
Master_info(bool is_slave_recovery);
~Master_info();
bool shall_ignore_server_id(ulong s_id);
+ void clear_in_memory_info(bool all);
/* the variables below are needed because we can change masters on the fly */
char master_log_name[FN_REFLEN];
@@ -119,7 +120,6 @@ class Master_info : public Slave_reporting_capability
DYNAMIC_ARRAY ignore_server_ids;
ulong master_id;
};
-void init_master_log_pos(Master_info* mi);
int init_master_info(Master_info* mi, const char* master_info_fname,
const char* slave_info_fname,
bool abort_if_no_master_info_file,
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index cc3d16bdf85..c893dc52587 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -1,4 +1,4 @@
-/* Copyright 2007 MySQL AB.
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/rpl_record.h b/sql/rpl_record.h
index b7c99c3955c..c857c07c33b 100644
--- a/sql/rpl_record.h
+++ b/sql/rpl_record.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 MySQL AB.
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef RPL_RECORD_H
#define RPL_RECORD_H
diff --git a/sql/rpl_record_old.cc b/sql/rpl_record_old.cc
index 09d5bcacd62..b91006d46d1 100644
--- a/sql/rpl_record_old.cc
+++ b/sql/rpl_record_old.cc
@@ -1,3 +1,17 @@
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED by other includes
diff --git a/sql/rpl_record_old.h b/sql/rpl_record_old.h
index d0a9bbcb263..201f62b1946 100644
--- a/sql/rpl_record_old.h
+++ b/sql/rpl_record_old.h
@@ -1,4 +1,4 @@
-/* Copyright 2007 MySQL AB.
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef RPL_RECORD_OLD_H
#define RPL_RECORD_OLD_H
diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc
index 051a3609019..f442f3a37c0 100644
--- a/sql/rpl_reporting.cc
+++ b/sql/rpl_reporting.cc
@@ -1,5 +1,5 @@
-/* Copyright (C) 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "rpl_reporting.h"
diff --git a/sql/rpl_reporting.h b/sql/rpl_reporting.h
index 495c74170d2..2b5e0527b9b 100644
--- a/sql/rpl_reporting.h
+++ b/sql/rpl_reporting.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 63ce14c3f89..26d405306c9 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h" // HAVE_*
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index 9cea56dc907..3aa9a4f3488 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef RPL_RLI_H
#define RPL_RLI_H
diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc
index 79c8dbf7ec5..b7ac1b2d091 100644
--- a/sql/rpl_tblmap.cc
+++ b/sql/rpl_tblmap.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "my_global.h" // HAVE_REPLICATION
diff --git a/sql/rpl_tblmap.h b/sql/rpl_tblmap.h
index 3d24a47d9ae..9fb1c4afbd7 100644
--- a/sql/rpl_tblmap.h
+++ b/sql/rpl_tblmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef TABLE_MAPPING_H
#define TABLE_MAPPING_H
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 23a62b9a532..4ab4542dd13 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h
index 25f2a60bece..eebef266754 100644
--- a/sql/rpl_utility.h
+++ b/sql/rpl_utility.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/scheduler.cc b/sql/scheduler.cc
index 43d80137bac..f04fdef39f9 100644
--- a/sql/scheduler.cc
+++ b/sql/scheduler.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Implementation for the thread scheduler
diff --git a/sql/scheduler.h b/sql/scheduler.h
index 7c9cafd8a71..03e1ad385c1 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -1,7 +1,7 @@
#ifndef SCHEDULER_INCLUDED
#define SCHEDULER_INCLUDED
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Classes for the thread scheduler
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 3494d5b1694..ce4d201672c 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
- 2009-2010 Monty Program Ab
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation
diff --git a/sql/sha2.cc b/sql/sha2.cc
index 1a9de86f2e0..f2201974172 100644
--- a/sql/sha2.cc
+++ b/sql/sha2.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
diff --git a/sql/share/CMakeLists.txt b/sql/share/CMakeLists.txt
index f8fd51fda23..e0521bdd328 100644
--- a/sql/share/CMakeLists.txt
+++ b/sql/share/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/sql/share/charsets/cp1251.xml b/sql/share/charsets/cp1251.xml
index 06ba8a5a4b9..4cd584c0bf5 100644
--- a/sql/share/charsets/cp1251.xml
+++ b/sql/share/charsets/cp1251.xml
@@ -3,7 +3,7 @@
<charsets>
<copyright>
- Copyright (C) 2003 MySQL AB
+ Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</copyright>
<charset name="cp1251">
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 86700136d6c..ed9a05f3d5f 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -2494,10 +2494,10 @@ ER_TOO_BIG_SELECT 42000
cze "Zadan-Bý SELECT by procházel příliš mnoho záznamů a trval velmi dlouho. Zkontrolujte tvar WHERE a je-li SELECT v pořádku, použijte SET SQL_BIG_SELECTS=1"
dan "SELECT ville undersøge for mange poster og ville sandsynligvis tage meget lang tid. Undersøg WHERE delen og brug SET SQL_BIG_SELECTS=1 hvis udtrykket er korrekt"
nla "Het SELECT-statement zou te veel records analyseren en dus veel tijd in beslagnemen. Kijk het WHERE-gedeelte van de query na en kies SET SQL_BIG_SELECTS=1 als het stament in orde is."
- eng "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay"
+ eng "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay"
est "SELECT lause peab läbi vaatama suure hulga kirjeid ja võtaks tõenäoliselt liiga kaua aega. Tasub kontrollida WHERE klauslit ja vajadusel kasutada käsku SET SQL_BIG_SELECTS=1"
fre "SELECT va devoir examiner beaucoup d'enregistrements ce qui va prendre du temps. Vérifiez la clause WHERE et utilisez SET SQL_BIG_SELECTS=1 si SELECT se passe bien"
- ger "Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET SQL_MAX_JOIN_SIZE=# verwenden"
+ ger "Die Ausführung des SELECT würde zu viele Datensätze untersuchen und wahrscheinlich sehr lange dauern. Bitte WHERE-Klausel überprüfen und gegebenenfalls SET SQL_BIG_SELECTS=1 oder SET MAX_JOIN_SIZE=# verwenden"
greek "Το SELECT θα εξετάσει μεγάλο αÏιθμό εγγÏαφών και πιθανώς θα καθυστεÏήσει. ΠαÏακαλώ εξετάστε τις παÏαμέτÏους του WHERE και χÏησιμοποιείστε SET SQL_BIG_SELECTS=1 αν το SELECT είναι σωστό"
hun "A SELECT tul sok rekordot fog megvizsgalni es nagyon sokaig fog tartani. Ellenorizze a WHERE-t es hasznalja a SET SQL_BIG_SELECTS=1 beallitast, ha a SELECT okay"
ita "La SELECT dovrebbe esaminare troppi record e usare troppo tempo. Controllare la WHERE e usa SET SQL_BIG_SELECTS=1 se e` tutto a posto."
@@ -4701,14 +4701,14 @@ ER_NOT_SUPPORTED_YET 42000
spa "Esta versión de MySQL no soporta todavia '%s'"
swe "Denna version av MySQL kan ännu inte utföra '%s'"
ER_MASTER_FATAL_ERROR_READING_BINLOG
- nla "Kreeg fatale fout %d: '%-.128s' van master tijdens lezen van data uit binaire log"
- eng "Got fatal error %d from master when reading data from binary log: '%-.128s'"
- ger "Schwerer Fehler %d: '%-.128s vom Master beim Lesen des binären Logs"
- ita "Errore fatale %d: '%-.128s' dal master leggendo i dati dal log binario"
- por "Obteve fatal erro %d: '%-.128s' do master quando lendo dados do binary log"
- rus "Получена неиÑÐ¿Ñ€Ð°Ð²Ð¸Ð¼Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° %d: '%-.128s' от головного Ñервера в процеÑÑе выборки данных из двоичного журнала"
- spa "Recibió fatal error %d: '%-.128s' del master cuando leyendo datos del binary log"
- swe "Fick fatalt fel %d: '%-.128s' från master vid läsning av binärloggen"
+ nla "Kreeg fatale fout %d: '%-.256s' van master tijdens lezen van data uit binaire log"
+ eng "Got fatal error %d from master when reading data from binary log: '%-.256s'"
+ ger "Schwerer Fehler %d: '%-.256s vom Master beim Lesen des binären Logs"
+ ita "Errore fatale %d: '%-.256s' dal master leggendo i dati dal log binario"
+ por "Obteve fatal erro %d: '%-.256s' do master quando lendo dados do binary log"
+ rus "Получена неиÑÐ¿Ñ€Ð°Ð²Ð¸Ð¼Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° %d: '%-.256s' от головного Ñервера в процеÑÑе выборки данных из двоичного журнала"
+ spa "Recibió fatal error %d: '%-.256s' del master cuando leyendo datos del binary log"
+ swe "Fick fatalt fel %d: '%-.256s' från master vid läsning av binärloggen"
ER_SLAVE_IGNORED_TABLE
eng "Slave SQL thread ignored the query because of replicate-*-table rules"
ger "Slave-SQL-Thread hat die Abfrage aufgrund von replicate-*-table-Regeln ignoriert"
@@ -5036,7 +5036,7 @@ ER_FEATURE_DISABLED
ger "Das Feature '%s' ist ausgeschaltet, Sie müssen MySQL mit '%s' übersetzen, damit es verfügbar ist"
por "O recurso '%s' foi desativado; você necessita MySQL construído com '%s' para ter isto funcionando"
spa "El recurso '%s' fue deshabilitado; usted necesita construir MySQL con '%s' para tener eso funcionando"
- swe "'%s' är inte aktiverad; För att aktivera detta måste du bygga om MySQL med '%s' definerad"
+ swe "'%s' är inte aktiverad; För att aktivera detta måste du bygga om MySQL med '%s' definierad"
ER_OPTION_PREVENTS_STATEMENT
eng "The MySQL server is running with the %s option so it cannot execute this statement"
ger "Der MySQL-Server läuft mit der Option %s und kann diese Anweisung deswegen nicht ausführen"
@@ -5577,7 +5577,8 @@ ER_VIEW_OTHER_USER
eng "You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definer"
ger "Sie brauchen die SUPER-Berechtigung, um einen View mit dem Definierer '%-.192s'@'%-.192s' zu erzeugen"
ER_NO_SUCH_USER
- eng "The user specified as a definer ('%-.64s'@'%-.64s') does not exist"
+ eng "The user specified as a definer ('%-.64s'@'%-.64s') does not exist"
+ ger "Der als Definierer angegebene Benutzer ('%-.64s'@'%-.64s') existiert nicht"
ER_FORBID_SCHEMA_CHANGE
eng "Changing schema from '%-.192s' to '%-.192s' is not allowed."
ger "Wechsel des Schemas von '%-.192s' auf '%-.192s' ist nicht erlaubt"
@@ -5618,7 +5619,7 @@ ER_VIEW_RECURSIVE
eng "`%-.192s`.`%-.192s` contains view recursion"
ger "`%-.192s`.`%-.192s` enthält View-Rekursion"
ER_NON_GROUPING_FIELD_USED 42000
- eng "non-grouping field '%-.192s' is used in %-.64s clause"
+ eng "Non-grouping field '%-.192s' is used in %-.64s clause"
ger "In der %-.192s-Klausel wird das die Nicht-Gruppierungsspalte '%-.64s' verwendet"
ER_TABLE_CANT_HANDLE_SPKEYS
eng "The used table type doesn't support SPATIAL indexes"
@@ -5645,15 +5646,20 @@ ER_NON_INSERTABLE_TABLE
eng "The target table %-.100s of the %s is not insertable-into"
ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar"
ER_ADMIN_WRONG_MRG_TABLE
- eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist"
+ eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist"
+ ger "Tabelle '%-.64s' ist unterschiedlich definiert, nicht vom Typ MyISAM oder existiert nicht"
ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT
- eng "Too high level of nesting for select"
+ eng "Too high level of nesting for select"
+ ger "Zu tief verschachtelte SELECT-Anweisungen"
ER_NAME_BECOMES_EMPTY
- eng "Name '%-.64s' has become ''"
+ eng "Name '%-.64s' has become ''"
+ ger "Name '%-.64s' wurde zu ''"
ER_AMBIGUOUS_FIELD_TERM
- eng "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY"
+ eng "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY"
+ ger "Das erste Zeichen der Zeichenkette FIELDS TERMINATED ist mehrdeutig; bitte benutzen Sie nicht optionale und nicht leere FIELDS ENCLOSED BY"
ER_FOREIGN_SERVER_EXISTS
- eng "The foreign server, %s, you are trying to create already exists."
+ eng "The foreign server, %s, you are trying to create already exists."
+ ger "Der entfernte Server %s, den Sie versuchen zu erzeugen, existiert schon."
ER_FOREIGN_SERVER_DOESNT_EXIST
eng "The foreign server name you are trying to reference does not exist. Data source error: %-.64s"
ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s"
@@ -5678,8 +5684,8 @@ ER_PARTITION_SUBPARTITION_ERROR
swe "Subpartitioner kan bara vara hash och key partitioner"
ER_PARTITION_SUBPART_MIX_ERROR
eng "Must define subpartitions on all partitions if on one partition"
- ger "Unterpartitionen können nur Hash- oder Key-Partitionen sein"
- swe "Subpartitioner måste definieras på alla partitioner om på en"
+ ger "Wenn Sie Unterpartitionen auf einer Partition definieren, müssen Sie das für alle Partitionen tun"
+ swe "Subpartitioner måste definieras på alla partitioner om på en"
ER_PARTITION_WRONG_NO_PART_ERROR
eng "Wrong number of partitions defined, mismatch with previous setting"
ger "Falsche Anzahl von Partitionen definiert, stimmt nicht mit vorherigen Einstellungen überein"
@@ -5854,7 +5860,7 @@ ER_CREATE_FILEGROUP_FAILED
ger "Anlegen von %s fehlgeschlagen"
ER_DROP_FILEGROUP_FAILED
eng "Failed to drop %s"
- ger "Löschen (drop) von %s fehlgeschlagen"
+ ger "Löschen von %s fehlgeschlagen"
ER_TABLESPACE_AUTO_EXTEND_ERROR
eng "The handler doesn't support autoextend of tablespaces"
ger "Der Handler unterstützt keine automatische Erweiterung (Autoextend) von Tablespaces"
@@ -5898,7 +5904,8 @@ ER_EVENT_ENDS_BEFORE_STARTS
eng "ENDS is either invalid or before STARTS"
ger "ENDS ist entweder ungültig oder liegt vor STARTS"
ER_EVENT_EXEC_TIME_IN_THE_PAST
- eng "Event execution time is in the past. Event has been disabled"
+ eng "Event execution time is in the past. Event has been disabled"
+ ger "Ausführungszeit des Events liegt in der Vergangenheit. Event wurde deaktiviert"
ER_EVENT_OPEN_TABLE_FAILED
eng "Failed to open mysql.event"
ger "Öffnen von mysql.event fehlgeschlagen"
@@ -5925,7 +5932,7 @@ ER_EVENT_DATA_TOO_LONG
ger "Daten der Spalte '%s' zu lang"
ER_DROP_INDEX_FK
eng "Cannot drop index '%-.192s': needed in a foreign key constraint"
- ger "Kann Index '%-.192s' nicht löschen: wird für einen Fremdschlüssel benötigt"
+ ger "Kann Index '%-.192s' nicht löschen: wird für eine Fremdschlüsselbeschränkung benötigt"
# When using this error message, use the ER_WARN_DEPRECATED_SYNTAX error
# code.
ER_WARN_DEPRECATED_SYNTAX_WITH_VER
@@ -5936,10 +5943,10 @@ ER_CANT_WRITE_LOCK_LOG_TABLE
ger "Eine Log-Tabelle kann nicht schreibgesperrt werden. Es ist ohnehin nur Lesezugriff möglich"
ER_CANT_LOCK_LOG_TABLE
eng "You can't use locks with log tables."
- ger "Log-Tabellen können nicht mit normalen Lesesperren gesperrt werden. Verwenden Sie statt dessen READ LOCAL"
+ ger "Log-Tabellen können nicht gesperrt werden."
ER_FOREIGN_DUPLICATE_KEY 23000 S1009
eng "Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry"
- ger "Aufrechterhalten der Fremdschlüssel-Constraints für Tabelle '%.192s', Eintrag '%-.192s', Schlüssel %d würde zu einem doppelten Eintrag führen"
+ ger "Aufrechterhalten der Fremdschlüssel-Beschränkungen für Tabelle '%.192s', Eintrag '%-.192s', Schlüssel %d würde zu einem doppelten Eintrag führen"
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error."
ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie mysql_upgrade, um den Fehler zu beheben"
@@ -5995,6 +6002,7 @@ ER_CANT_ACTIVATE_LOG
ger "Kann Logdatei '%-.64s' nicht aktivieren"
ER_RBR_NOT_AVAILABLE
eng "The server was not built with row-based replication"
+ ger "Der Server wurde nicht mit zeilenbasierter Replikation gebaut"
ER_BASE64_DECODE_ERROR
eng "Decoding of base64 string failed"
swe "Avkodning av base64 sträng misslyckades"
@@ -6016,7 +6024,7 @@ ER_BAD_LOG_STATEMENT
ger "Sie können eine Logtabelle nicht '%s', wenn Loggen angeschaltet ist"
ER_CANT_RENAME_LOG_TABLE
eng "Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'"
- ger "Kann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen beim Umbenennen zu/von einer Logtabelle zwei Tabellen angegeben werden: die Logtabelle zu einer Archivtabelle und eine weitere Tabelle zurück zu '%s'"
+ ger "Kann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen zwei Tabellen umbenannt werden: die Logtabelle zu einer Archivtabelle, und eine weitere Tabelle zu '%s'"
ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 42000
eng "Incorrect parameter count in the call to native function '%-.192s'"
ger "Falsche Anzahl von Parametern beim Aufruf der nativen Funktion '%-.192s'"
@@ -6057,206 +6065,240 @@ ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009
swe "Dubbel nyckel '%-.64s' för nyckel '%-.192s'"
ukr "Дублюючий Ð·Ð°Ð¿Ð¸Ñ '%-.64s' Ð´Ð»Ñ ÐºÐ»ÑŽÑ‡Ð° '%-.192s'"
ER_BINLOG_PURGE_EMFILE
- eng "Too many files opened, please execute the command again"
- ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus"
+ eng "Too many files opened, please execute the command again"
+ ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus"
ER_EVENT_CANNOT_CREATE_IN_THE_PAST
- eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
+ eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
+ ger "Ausführungszeit des Events liegt in der Vergangenheit, und es wurde ON COMPLETION NOT PRESERVE gesetzt. Das Event wurde unmittelbar nach Erzeugung gelöscht."
ER_EVENT_CANNOT_ALTER_IN_THE_PAST
- eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
+ eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
+ ger "Ausführungszeit des Events liegt in der Vergangenheit, und es wurde ON COMPLETION NOT PRESERVE gesetzt. Das Event wurde unmittelbar nach Erzeugung gelöscht."
ER_SLAVE_INCIDENT
- eng "The incident %s occured on the master. Message: %-.64s"
+ eng "The incident %s occured on the master. Message: %-.64s"
+ ger "Der Vorfall %s passierte auf dem Master. Meldung: %-.64s"
ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT
- eng "Table has no partition for some existing values"
+ eng "Table has no partition for some existing values"
+ ger "Tabelle hat für einige bestehende Werte keine Partition"
ER_BINLOG_UNSAFE_STATEMENT
- eng "Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %s"
+ eng "Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %s"
+ swe "Detta är inte säkert att logga i statement-format, för BINLOG_FORMAT = STATEMENT. %s"
+ ger "Unsichere Anweisung ins Binärlog geschrieben, weil Anweisungsformat BINLOG_FORMAT = STATEMENT. %s"
ER_SLAVE_FATAL_ERROR
- eng "Fatal error: %s"
+ eng "Fatal error: %s"
+ ger "Fataler Fehler: %s"
ER_SLAVE_RELAY_LOG_READ_FAILURE
- eng "Relay log read failure: %s"
+ eng "Relay log read failure: %s"
+ ger "Relaylog-Lesefehler: %s"
ER_SLAVE_RELAY_LOG_WRITE_FAILURE
- eng "Relay log write failure: %s"
+ eng "Relay log write failure: %s"
+ ger "Relaylog-Schreibfehler: %s"
ER_SLAVE_CREATE_EVENT_FAILURE
- eng "Failed to create %s"
+ eng "Failed to create %s"
+ ger "Erzeugen von %s fehlgeschlagen"
ER_SLAVE_MASTER_COM_FAILURE
- eng "Master command %s failed: %s"
+ eng "Master command %s failed: %s"
+ ger "Master-Befehl %s fehlgeschlagen: %s"
ER_BINLOG_LOGGING_IMPOSSIBLE
- eng "Binary logging not possible. Message: %s"
-
+ eng "Binary logging not possible. Message: %s"
+ ger "Binärlogging nicht möglich. Meldung: %s"
ER_VIEW_NO_CREATION_CTX
eng "View `%-.64s`.`%-.64s` has no creation context"
+ ger "View `%-.64s`.`%-.64s` hat keinen Erzeugungskontext"
ER_VIEW_INVALID_CREATION_CTX
eng "Creation context of view `%-.64s`.`%-.64s' is invalid"
-
+ ger "Erzeugungskontext des Views`%-.64s`.`%-.64s' ist ungültig"
ER_SR_INVALID_CREATION_CTX
eng "Creation context of stored routine `%-.64s`.`%-.64s` is invalid"
-
+ ger "Erzeugungskontext der gespeicherten Routine`%-.64s`.`%-.64s` ist ungültig"
ER_TRG_CORRUPTED_FILE
eng "Corrupted TRG file for table `%-.64s`.`%-.64s`"
+ ger "Beschädigte TRG-Datei für Tabelle `%-.64s`.`%-.64s`"
ER_TRG_NO_CREATION_CTX
eng "Triggers for table `%-.64s`.`%-.64s` have no creation context"
+ ger "Trigger für Tabelle `%-.64s`.`%-.64s` haben keinen Erzeugungskontext"
ER_TRG_INVALID_CREATION_CTX
eng "Trigger creation context of table `%-.64s`.`%-.64s` is invalid"
-
+ ger "Trigger-Erzeugungskontext der Tabelle `%-.64s`.`%-.64s` ist ungültig"
ER_EVENT_INVALID_CREATION_CTX
eng "Creation context of event `%-.64s`.`%-.64s` is invalid"
-
+ ger "Erzeugungskontext des Events `%-.64s`.`%-.64s` ist ungültig"
ER_TRG_CANT_OPEN_TABLE
eng "Cannot open table for trigger `%-.64s`.`%-.64s`"
-
+ ger "Kann Tabelle für den Trigger `%-.64s`.`%-.64s` nicht öffnen"
ER_CANT_CREATE_SROUTINE
eng "Cannot create stored routine `%-.64s`. Check warnings"
+ ger "Kann gespeicherte Routine `%-.64s` nicht erzeugen. Beachten Sie die Warnungen"
ER_NEVER_USED
eng "Ambiguous slave modes combination. %s"
-
+ ger "Mehrdeutige Kombination von Slave-Modi. %s"
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
eng "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement."
+ ger "Der BINLOG-Anweisung vom Typ `%s` ging keine BINLOG-Anweisung zur Formatbeschreibung voran."
ER_SLAVE_CORRUPT_EVENT
eng "Corrupted replication event was detected"
-
+ ger "Beschädigtes Replikationsereignis entdeckt"
ER_LOAD_DATA_INVALID_COLUMN
eng "Invalid column reference (%-.64s) in LOAD DATA"
-
-ER_LOG_PURGE_NO_FILE
+ ger "Ungültige Spaltenreferenz (%-.64s) bei LOAD DATA"
+ER_LOG_PURGE_NO_FILE
eng "Being purged log %s was not found"
-
+ ger "Zu bereinigende Logdatei %s wurde nicht gefunden"
ER_XA_RBTIMEOUT XA106
- eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long"
-
+ eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long"
+ ger "XA_RBTIMEOUT: Transaktionszweig wurde zurückgerollt: Zeitüberschreitung"
ER_XA_RBDEADLOCK XA102
- eng "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected"
-
+ eng "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected"
+ ger "XA_RBDEADLOCK: Transaktionszweig wurde zurückgerollt: Deadlock entdeckt"
ER_NEED_REPREPARE
eng "Prepared statement needs to be re-prepared"
-
-ER_DELAYED_NOT_SUPPORTED
+ ger "Vorbereitete Anweisungen müssen noch einmal vorbereitet werden"
+ER_DELAYED_NOT_SUPPORTED
eng "DELAYED option not supported for table '%-.192s'"
-
+ ger "Die DELAYED-Option wird für Tabelle '%-.192s' nicht unterstützt"
WARN_NO_MASTER_INFO
eng "The master info structure does not exist"
-
+ ger "Die Master-Info-Struktur existiert nicht"
WARN_OPTION_IGNORED
eng "<%-.64s> option ignored"
-
+ ger "Option <%-.64s> ignoriert"
WARN_PLUGIN_DELETE_BUILTIN
eng "Built-in plugins cannot be deleted"
-
+ ger "Eingebaute Plugins können nicht gelöscht werden"
WARN_PLUGIN_BUSY
eng "Plugin is busy and will be uninstalled on shutdown"
-
+ ger "Plugin wird verwendet und wird erst beim Herunterfahren deinstalliert"
ER_VARIABLE_IS_READONLY
eng "%s variable '%s' is read-only. Use SET %s to assign the value"
-
+ ger "%s Variable '%s' ist nur lesbar. Benutzen Sie SET %s, um einen Wert zuzuweisen"
ER_WARN_ENGINE_TRANSACTION_ROLLBACK
eng "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted"
-
+ ger "Speicher-Engine %s unterstützt für diese Anweisung kein Rollback. Transaktion wurde zurückgerollt und muss neu gestartet werden"
ER_SLAVE_HEARTBEAT_FAILURE
eng "Unexpected master's heartbeat data: %s"
+ ger "Unerwartete Daten vom Heartbeat des Masters: %s"
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds)."
-
ER_NDB_REPLICATION_SCHEMA_ERROR
- eng "Bad schema for mysql.ndb_replication table. Message: %-.64s"
+ eng "Bad schema for mysql.ndb_replication table. Message: %-.64s"
+ ger "Fehlerhaftes Schema für mysql.ndb_replication table. Meldung: %-.64s"
ER_CONFLICT_FN_PARSE_ERROR
- eng "Error in parsing conflict function. Message: %-.64s"
+ eng "Error in parsing conflict function. Message: %-.64s"
+ ger "Fehler beim Parsen einer Konflikt-Funktion. Meldung: %-.64s"
ER_EXCEPTIONS_WRITE_ERROR
- eng "Write to exceptions table failed. Message: %-.128s""
-
+ eng "Write to exceptions table failed. Message: %-.128s""
+ ger "Schreiben in Ausnahme-Tabelle fehlgeschlagen. Meldung: %-.128s""
ER_TOO_LONG_TABLE_COMMENT
eng "Comment for table '%-.64s' is too long (max = %lu)"
por "Comentário para a tabela '%-.64s' é longo demais (max = %lu)"
-
+ ger "Kommentar für Tabelle '%-.64s' ist zu lang (max = %lu)"
ER_TOO_LONG_FIELD_COMMENT
eng "Comment for field '%-.64s' is too long (max = %lu)"
por "Comentário para o campo '%-.64s' é longo demais (max = %lu)"
-
+ ger "Kommentar für Feld '%-.64s' ist zu lang (max = %lu)"
ER_FUNC_INEXISTENT_NAME_COLLISION 42000
eng "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual"
-
+ ger "FUNCTION %s existiert nicht. Erläuterungen im Abschnitt 'Function Name Parsing and Resolution' im Referenzhandbuch"
# When updating these, please update EXPLAIN_FILENAME_MAX_EXTRA_LENGTH in
# sql_table.h with the new maximal additional length for explain_filename.
ER_DATABASE_NAME
eng "Database"
swe "Databas"
+ ger "Datenbank"
ER_TABLE_NAME
eng "Table"
swe "Tabell"
+ ger "Tabelle"
ER_PARTITION_NAME
eng "Partition"
swe "Partition"
+ ger "Partition"
ER_SUBPARTITION_NAME
eng "Subpartition"
swe "Subpartition"
+ ger "Unterpartition"
ER_TEMPORARY_NAME
eng "Temporary"
swe "Temporär"
+ ger "Temporär"
ER_RENAMED_NAME
eng "Renamed"
swe "Namnändrad"
+ ger "Umbenannt"
ER_TOO_MANY_CONCURRENT_TRXS
eng "Too many active concurrent transactions"
-
+ ger "Zu viele aktive simultane Transaktionen"
WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
eng "Non-ASCII separator arguments are not fully supported"
-
+ ger "Nicht-ASCII-Trennargumente werden nicht vollständig unterstützt"
ER_DEBUG_SYNC_TIMEOUT
eng "debug sync point wait timed out"
ger "Debug Sync Point Wartezeit überschritten"
ER_DEBUG_SYNC_HIT_LIMIT
eng "debug sync point hit limit reached"
ger "Debug Sync Point Hit Limit erreicht"
-
ER_DUP_SIGNAL_SET 42000
- eng "Duplicate condition information item '%s'"
-
+ eng "Duplicate condition information item '%s'"
+ ger "Informationselement '%s' für Duplikatbedingung"
# Note that the SQLSTATE is not 01000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_WARN 01000
- eng "Unhandled user-defined warning condition"
-
+ eng "Unhandled user-defined warning condition"
+ ger "Unbehandelte benutzerdefinierte Warnbedingung"
# Note that the SQLSTATE is not 02000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_NOT_FOUND 02000
- eng "Unhandled user-defined not found condition"
-
+ eng "Unhandled user-defined not found condition"
+ ger "Unbehandelte benutzerdefinierte Nicht-gefunden-Bedingung"
# Note that the SQLSTATE is not HY000, it is provided by SIGNAL/RESIGNAL
ER_SIGNAL_EXCEPTION HY000
- eng "Unhandled user-defined exception condition"
-
+ eng "Unhandled user-defined exception condition"
+ ger "Unbehandelte benutzerdefinierte Ausnahmebedingung"
ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 0K000
- eng "RESIGNAL when handler not active"
-
+ eng "RESIGNAL when handler not active"
+ ger "RESIGNAL bei nicht aktivem Handler"
ER_SIGNAL_BAD_CONDITION_TYPE
- eng "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE"
-
+ eng "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE"
+ ger "SIGNAL/RESIGNAL kann nur mit einer Bedingung (CONDITION) benutzt werden, die bei SQLSTATE definiert wurde"
WARN_COND_ITEM_TRUNCATED
- eng "Data truncated for condition item '%s'"
-
+ eng "Data truncated for condition item '%s'"
+ ger "Daten gekürzt für Bedingungselement '%s'"
ER_COND_ITEM_TOO_LONG
- eng "Data too long for condition item '%s'"
-
+ eng "Data too long for condition item '%s'"
+ ger "Daten zu lang für Bedingungselement '%s'"
ER_UNKNOWN_LOCALE
- eng "Unknown locale: '%-.64s'"
-
+ eng "Unknown locale: '%-.64s'"
+ ger "Unbekannte Locale: '%-.64s'"
ER_SLAVE_IGNORE_SERVER_IDS
eng "The requested server id %d clashes with the slave startup option --replicate-same-server-id"
+ ger "Die angeforderte Server-ID %d steht im Konflikt mit der Startoption --replicate-same-server-id für den Slave"
ER_QUERY_CACHE_DISABLED
eng "Query cache is disabled; restart the server with query_cache_type=1 to enable it"
+ ger "Abfragen-Cache ist deaktiviert. Starten Sie den Server neu mit query_cache_type=1, um ihn zu aktivieren"
ER_SAME_NAME_PARTITION_FIELD
eng "Duplicate partition field name '%-.192s'"
+ ger "Partitionsfeld '%-.192s' ist ein Duplikat"
ER_PARTITION_COLUMN_LIST_ERROR
eng "Inconsistency in usage of column lists for partitioning"
+ ger "Inkonsistenz bei der Benutzung von Spaltenlisten für Partitionierung"
ER_WRONG_TYPE_COLUMN_VALUE_ERROR
eng "Partition column values of incorrect type"
+ ger "Partitionsspaltenwerte sind vom falschen Typ"
ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR
eng "Too many fields in '%-.192s'"
+ ger "Zu viele Felder in '%-.192s'"
ER_MAXVALUE_IN_VALUES_IN
eng "Cannot use MAXVALUE as value in VALUES IN"
+ ger "MAXVALUE kann nicht als Wert in VALUES IN verwendet werden"
ER_TOO_MANY_VALUES_ERROR
eng "Cannot have more than one value for this type of %-.64s partitioning"
+ ger "Für den Partionierungstyp %-.64s darf es nicht mehr als einen Wert geben"
ER_ROW_SINGLE_PARTITION_FIELD_ERROR
eng "Row expressions in VALUES IN only allowed for multi-field column partitioning"
+ ger "Zeilenausdrücke in VALUES IN sind nur für Mehrfeld-Spaltenpartionierung erlaubt"
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
eng "Field '%-.192s' is of a not allowed type for this type of partitioning"
+ ger "Feld '%-.192s' ist für diese Art von Partitionierung von einem nicht zulässigen Typ"
ER_PARTITION_FIELDS_TOO_LONG
eng "The total length of the partitioning fields is too large"
+ ger "Die Gesamtlänge der Partitionsfelder ist zu groß"
ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE
eng "Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved."
ER_BINLOG_ROW_MODE_AND_STMT_ENGINE
@@ -6318,7 +6360,7 @@ ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT
eng "Cannot change the binlog direct flag inside a stored function or trigger"
ER_SPATIAL_MUST_HAVE_GEOM_COL 42000
eng "A SPATIAL index may only contain a geometrical type column"
-
+ ger "Ein raumbezogener Index (SPATIAL) darf nur Spalten geometrischen Typs enthalten"
ER_TOO_LONG_INDEX_COMMENT
eng "Comment for index '%-.64s' is too long (max = %lu)"
@@ -6415,6 +6457,36 @@ ER_ERROR_IN_TRIGGER_BODY
ER_ERROR_IN_UNKNOWN_TRIGGER_BODY
eng "Unknown trigger has an error in its body: '%-.256s'"
+ER_INDEX_CORRUPT
+ eng "Index %s is corrupted"
+
+ER_UNDO_RECORD_TOO_BIG
+ eng "Undo log record is too big."
+
+ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT
+ eng "INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave."
+
+ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE
+ eng "INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave."
+
+ER_BINLOG_UNSAFE_REPLACE_SELECT
+ eng "REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave."
+
+ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT
+ eng "CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave."
+
+ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT
+ eng "CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave."
+
+ER_BINLOG_UNSAFE_UPDATE_IGNORE
+ eng "UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave."
+
+ER_PLUGIN_NO_UNINSTALL
+ eng "Plugin '%s' is marked as not dynamically uninstallable. You have to stop the server to uninstall it."
+
+ER_PLUGIN_NO_INSTALL
+ eng "Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it."
+
#
# MariaDB error messages section starts here
#
diff --git a/sql/slave.cc b/sql/slave.cc
index 7e60b0ef3ec..96e9beedc5b 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@@ -4536,6 +4536,10 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
/* This one is not strictly needed but we have it here for completeness */
mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
+ /* Set MYSQL_PLUGIN_DIR in case master asks for an external authentication plugin */
+ if (opt_plugin_dir_ptr && *opt_plugin_dir_ptr)
+ mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr);
+
while (!(slave_was_killed = io_slave_killed(thd,mi)) &&
(reconnect ? mysql_reconnect(mysql) != 0 :
mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
diff --git a/sql/slave.h b/sql/slave.h
index 9e24058cbbc..6c1305e2ee0 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef SLAVE_H
#define SLAVE_H
diff --git a/sql/sp.cc b/sql/sp.cc
index 6071a60a64f..b693569753f 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002 MySQL AB
+/*
+ Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
@@ -758,6 +759,43 @@ static sp_head *sp_compile(THD *thd, String *defstr, ulong sql_mode,
}
+class Bad_db_error_handler : public Internal_error_handler
+{
+public:
+ Bad_db_error_handler()
+ :m_error_caught(false)
+ {}
+
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* message,
+ MYSQL_ERROR ** cond_hdl);
+
+ bool error_caught() const { return m_error_caught; }
+
+private:
+ bool m_error_caught;
+};
+
+bool
+Bad_db_error_handler::handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* message,
+ MYSQL_ERROR ** cond_hdl)
+{
+ if (sql_errno == ER_BAD_DB_ERROR)
+ {
+ m_error_caught= true;
+ return true;
+ }
+ return false;
+}
+
+
static int
db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
ulong sql_mode, const char *params, const char *returns,
@@ -771,7 +809,7 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
LEX_STRING saved_cur_db_name=
{ saved_cur_db_name_buf, sizeof(saved_cur_db_name_buf) };
bool cur_db_changed;
-
+ Bad_db_error_handler db_not_exists_handler;
char definer_user_name_holder[USERNAME_LENGTH + 1];
LEX_STRING definer_user_name= { definer_user_name_holder,
USERNAME_LENGTH };
@@ -810,6 +848,7 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
goto end;
}
+ thd->push_internal_handler(&db_not_exists_handler);
/*
Change the current database (if needed).
@@ -820,6 +859,15 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
&cur_db_changed))
{
ret= SP_INTERNAL_ERROR;
+ thd->pop_internal_handler();
+ goto end;
+ }
+ thd->pop_internal_handler();
+ if (db_not_exists_handler.error_caught())
+ {
+ ret= SP_INTERNAL_ERROR;
+ my_error(ER_BAD_DB_ERROR, MYF(0), name->m_db.str);
+
goto end;
}
diff --git a/sql/sp.h b/sql/sp.h
index 68c45768857..a06759663a7 100644
--- a/sql/sp.h
+++ b/sql/sp.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _SP_H_
#define _SP_H_
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index eaac4459e99..f0875b9c3f4 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/sp_cache.h b/sql/sp_cache.h
index 2d379300354..7c5d1dca6ef 100644
--- a/sql/sp_cache.h
+++ b/sql/sp_cache.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _SP_CACHE_H_
#define _SP_CACHE_H_
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 6e17c974c2c..ff104d04aec 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2584,8 +2585,9 @@ bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access)
bzero((char*) &tables,sizeof(tables));
tables.db= (char*) "mysql";
tables.table_name= tables.alias= (char*) "proc";
- *full_access= (!check_table_access(thd, SELECT_ACL, &tables, FALSE,
- 1, TRUE) ||
+ *full_access= ((!check_table_access(thd, SELECT_ACL, &tables, FALSE,
+ 1, TRUE) &&
+ (tables.grant.privilege & SELECT_ACL) != 0) ||
(!strcmp(sp->m_definer_user.str,
thd->security_ctx->priv_user) &&
!strcmp(sp->m_definer_host.str,
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 4d5e2dd95ab..0f6fddc75f0 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _SP_HEAD_H_
#define _SP_HEAD_H_
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index bbf38f52efb..4c5087eaf27 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index c27c7d22da2..f1d0d250c47 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _SP_PCONTEXT_H_
#define _SP_PCONTEXT_H_
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 7b8ade26085..74bee6e856c 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index c8903911b83..3d976f94381 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -1,5 +1,5 @@
/* -*- C++ -*- */
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _SP_RCONTEXT_H_
#define _SP_RCONTEXT_H_
diff --git a/sql/spatial.cc b/sql/spatial.cc
index b02feb722f7..ee701d82657 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2004 MySQL AB
+/*
+ Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "my_global.h" // REQUIRED for HAVE_* below
diff --git a/sql/spatial.h b/sql/spatial.h
index b0c609ceeef..e93540db862 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _spatial_h
#define _spatial_h
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 650c9d4e458..1f34712b044 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -9201,7 +9201,7 @@ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio,
create_random_string(thd->scramble, SCRAMBLE_LENGTH, &thd->rand);
/* and send it to the client */
if (mpvio->write_packet(mpvio, (uchar*)thd->scramble, SCRAMBLE_LENGTH + 1))
- return CR_ERROR;
+ DBUG_RETURN(CR_ERROR);
}
/* reply and authenticate */
@@ -9251,12 +9251,7 @@ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio,
#endif
if (pkt_len == 0) /* no password */
- {
- if (info->auth_string[0])
- DBUG_RETURN(CR_ERROR);
- else
- DBUG_RETURN(CR_OK);
- }
+ DBUG_RETURN(info->auth_string[0] ? CR_ERROR : CR_OK);
info->password_used= PASSWORD_USED_YES;
if (pkt_len == SCRAMBLE_LENGTH)
@@ -9358,7 +9353,8 @@ mysql_declare_plugin(mysql_password)
0x0100, /* Version (1.0) */
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
},
{
MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
@@ -9372,7 +9368,8 @@ mysql_declare_plugin(mysql_password)
0x0100, /* Version (1.0) */
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 3079f376bee..3169746419c 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -1,7 +1,7 @@
#ifndef SQL_ACL_INCLUDED
#define SQL_ACL_INCLUDED
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "violite.h" /* SSL_type */
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 5c529e99fac..8a2f475b6f2 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_admin.h b/sql/sql_admin.h
index fdfffec8361..f7ec76efd5e 100644
--- a/sql/sql_admin.h
+++ b/sql/sql_admin.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 2b0e0fecdaa..c6c02773286 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_alter.h b/sql/sql_alter.h
index 6a17f87f5a4..6660748f666 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 883ac3c4660..d99337bd210 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index 1ef299c5dbc..34c8e2da3d4 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -1,7 +1,7 @@
#ifndef SQL_ANALYSE_INCLUDED
#define SQL_ANALYSE_INCLUDED
-/* Copyright (C) 2000-2003, 2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Analyse database */
diff --git a/sql/sql_array.h b/sql/sql_array.h
index 19ce4e2e62b..67f1f1c2ad7 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -1,7 +1,8 @@
#ifndef SQL_ARRAY_INCLUDED
#define SQL_ARRAY_INCLUDED
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_sys.h>
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index be837ec51ba..131a71c1d6b 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "sql_audit.h"
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index da44c4a023b..51c695d091d 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -1,7 +1,7 @@
#ifndef SQL_AUDIT_INCLUDED
#define SQL_AUDIT_INCLUDED
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 49cd948791b..892757d77fe 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -91,6 +91,69 @@ bool No_such_table_error_handler::safely_trapped_errors()
return ((m_handled_errors > 0) && (m_unhandled_errors == 0));
}
+
+/**
+ This internal handler is used to trap ER_NO_SUCH_TABLE and
+ ER_WRONG_MRG_TABLE errors during CHECK/REPAIR TABLE for MERGE
+ tables.
+*/
+
+class Repair_mrg_table_error_handler : public Internal_error_handler
+{
+public:
+ Repair_mrg_table_error_handler()
+ : m_handled_errors(false), m_unhandled_errors(false)
+ {}
+
+ bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl);
+
+ /**
+ Returns TRUE if there were ER_NO_SUCH_/WRONG_MRG_TABLE and there
+ were no unhandled errors. FALSE otherwise.
+ */
+ bool safely_trapped_errors()
+ {
+ /*
+ Check for m_handled_errors is here for extra safety.
+ It can be useful in situation when call to open_table()
+ fails because some error which was suppressed by another
+ error handler (e.g. in case of MDL deadlock which we
+ decided to solve by back-off and retry).
+ */
+ return (m_handled_errors && (! m_unhandled_errors));
+ }
+
+private:
+ bool m_handled_errors;
+ bool m_unhandled_errors;
+};
+
+
+bool
+Repair_mrg_table_error_handler::handle_condition(THD *,
+ uint sql_errno,
+ const char*,
+ MYSQL_ERROR::enum_warning_level level,
+ const char*,
+ MYSQL_ERROR ** cond_hdl)
+{
+ *cond_hdl= NULL;
+ if (sql_errno == ER_NO_SUCH_TABLE || sql_errno == ER_WRONG_MRG_TABLE)
+ {
+ m_handled_errors= true;
+ return TRUE;
+ }
+
+ m_unhandled_errors= true;
+ return FALSE;
+}
+
+
/**
@defgroup Data_Dictionary Data Dictionary
@{
@@ -4410,6 +4473,20 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
thd->pop_internal_handler();
safe_to_ignore_table= no_such_table_handler.safely_trapped_errors();
}
+ else if (tables->parent_l && (thd->open_options & HA_OPEN_FOR_REPAIR))
+ {
+ /*
+ Also fail silently for underlying tables of a MERGE table if this
+ table is opened for CHECK/REPAIR TABLE statement. This is needed
+ to provide complete list of problematic underlying tables in
+ CHECK/REPAIR TABLE output.
+ */
+ Repair_mrg_table_error_handler repair_mrg_table_handler;
+ thd->push_internal_handler(&repair_mrg_table_handler);
+ error= open_table(thd, tables, new_frm_mem, ot_ctx);
+ thd->pop_internal_handler();
+ safe_to_ignore_table= repair_mrg_table_handler.safely_trapped_errors();
+ }
else
error= open_table(thd, tables, new_frm_mem, ot_ctx);
@@ -7875,7 +7952,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM &&
sum_func_list)
item->split_sum_func(thd, ref_pointer_array, *sum_func_list);
- thd->used_tables|= item->used_tables();
+ thd->lex->used_tables|= item->used_tables();
thd->lex->current_select->cur_pos_in_select_list++;
}
thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup;
@@ -8293,7 +8370,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
views and natural joins this update is performed inside the loop below.
*/
if (table)
- thd->used_tables|= table->map;
+ thd->lex->used_tables|= table->map;
/*
Initialize a generic field iterator for the current table reference.
@@ -8384,7 +8461,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
field_table= nj_col->table_ref->table;
if (field_table)
{
- thd->used_tables|= field_table->map;
+ thd->lex->used_tables|= field_table->map;
field_table->covering_keys.intersect(field->part_of_key);
field_table->merge_keys.merge(field->part_of_key);
field_table->used_fields++;
@@ -8392,7 +8469,7 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
}
}
else
- thd->used_tables|= item->used_tables();
+ thd->lex->used_tables|= item->used_tables();
thd->lex->current_select->cur_pos_in_select_list++;
}
/*
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 75a1af02bd2..5ddff949ce3 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_binlog.h b/sql/sql_binlog.h
index 50251eaac50..3a6d561701a 100644
--- a/sql/sql_binlog.h
+++ b/sql/sql_binlog.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h
index 558240ce19d..db4c7110ac7 100644
--- a/sql/sql_bitmap.h
+++ b/sql/sql_bitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Implementation of a bitmap type.
diff --git a/sql/sql_builtin.cc.in b/sql/sql_builtin.cc.in
index c4b8531fc5a..63850650ac9 100644
--- a/sql/sql_builtin.cc.in
+++ b/sql/sql_builtin.cc.in
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 9e2279d71ea..db0da4bdae6 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Description of the query cache:
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 13efcfd85e9..36a05b49fa9 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _SQL_CACHE_H
#define _SQL_CACHE_H
diff --git a/sql/sql_callback.h b/sql/sql_callback.h
index ea51c107ff9..316f94a0213 100644
--- a/sql/sql_callback.h
+++ b/sql/sql_callback.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SQL_CALLBACK_INCLUDED
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index cde5a431ec1..e1ff29e0b24 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*****************************************************************************
@@ -499,11 +501,11 @@ const char *set_thd_proc_info(THD *thd, const char *info,
thd= current_thd;
const char *old_info= thd->proc_info;
- const char *basename= calling_file ? base_name(calling_file) : NULL;
- DBUG_PRINT("proc_info", ("%s:%d %s", basename, calling_line, info));
+ DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line, info));
#if defined(ENABLED_PROFILING)
- thd->profiling.status_change(info, calling_function, basename, calling_line);
+ thd->profiling.status_change(info,
+ calling_function, calling_file, calling_line);
#endif
thd->proc_info= info;
return old_info;
@@ -620,7 +622,7 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
{
String str(buffer, length, &my_charset_latin1);
const Security_context *sctx= &thd->main_security_ctx;
- char header[64];
+ char header[256];
int len;
/*
The pointers thd->query and thd->proc_info might change since they are
@@ -634,8 +636,8 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length,
const char *proc_info= thd->proc_info;
len= my_snprintf(header, sizeof(header),
- "MySQL thread id %lu, query id %lu",
- thd->thread_id, (ulong) thd->query_id);
+ "MySQL thread id %lu, OS thread handle 0x%lx, query id %lu",
+ thd->thread_id, (ulong) thd->real_id, (ulong) thd->query_id);
str.length(0);
str.append(header, len);
@@ -777,7 +779,6 @@ THD::THD()
is_slave_error= thread_specific_used= FALSE;
my_hash_clear(&handler_tables_hash);
tmp_table=0;
- used_tables=0;
cuted_fields= 0L;
sent_row_count= 0L;
limit_found_rows= 0;
@@ -4149,16 +4150,24 @@ void THD::set_mysys_var(struct st_my_thread_var *new_mysys_var)
void THD::leave_locked_tables_mode()
{
+ if (locked_tables_mode == LTM_LOCK_TABLES)
+ {
+ /*
+ When leaving LOCK TABLES mode we have to change the duration of most
+ of the metadata locks being held, except for HANDLER and GRL locks,
+ to transactional for them to be properly released at UNLOCK TABLES.
+ */
+ mdl_context.set_transaction_duration_for_all_locks();
+ /*
+ Make sure we don't release the global read lock and commit blocker
+ when leaving LTM.
+ */
+ global_read_lock.set_explicit_lock_duration(this);
+ /* Also ensure that we don't release metadata locks for open HANDLERs. */
+ if (handler_tables_hash.records)
+ mysql_ha_set_explicit_lock_duration(this);
+ }
locked_tables_mode= LTM_NONE;
- mdl_context.set_transaction_duration_for_all_locks();
- /*
- Make sure we don't release the global read lock and commit blocker
- when leaving LTM.
- */
- global_read_lock.set_explicit_lock_duration(this);
- /* Also ensure that we don't release metadata locks for open HANDLERs. */
- if (handler_tables_hash.records)
- mysql_ha_set_explicit_lock_duration(this);
}
void THD::get_definer(LEX_USER *definer)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index e2786356ac1..284a9d9e42e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2062,13 +2062,6 @@ public:
*/
ha_rows examined_row_count;
- /*
- The set of those tables whose fields are referenced in all subqueries
- of the query.
- TODO: possibly this it is incorrect to have used tables in THD because
- with more than one subquery, it is not clear what does the field mean.
- */
- table_map used_tables;
USER_CONN *user_connect;
CHARSET_INFO *db_charset;
Warning_info *warning_info;
@@ -2955,7 +2948,19 @@ public:
{
DBUG_ASSERT(locked_tables_mode == LTM_NONE);
- mdl_context.set_explicit_duration_for_all_locks();
+ if (mode_arg == LTM_LOCK_TABLES)
+ {
+ /*
+ When entering LOCK TABLES mode we should set explicit duration
+ for all metadata locks acquired so far in order to avoid releasing
+ them till UNLOCK TABLES statement.
+ We don't do this when entering prelocked mode since sub-statements
+ don't release metadata locks and restoring status-quo after leaving
+ prelocking mode gets complicated.
+ */
+ mdl_context.set_explicit_duration_for_all_locks();
+ }
+
locked_tables_mode= mode_arg;
}
void leave_locked_tables_mode();
@@ -4036,14 +4041,6 @@ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
STATUS_VAR *dec_var);
void mark_transaction_to_rollback(THD *thd, bool all);
-/*
- This prototype is placed here instead of in item_func.h because it
- depends on the definition of enum_sql_command, which is in this
- file.
- */
-int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
- LEX_STRING &name, user_var_entry **out_entry);
-
/* Inline functions */
inline bool add_item_to_list(THD *thd, Item *item)
diff --git a/sql/sql_client.cc b/sql/sql_client.cc
index 0c16449276a..22a7867012a 100644
--- a/sql/sql_client.cc
+++ b/sql/sql_client.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This files defines some MySQL C API functions that are server specific
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index b2e37758d5b..5dde1818c27 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
Functions to autenticate and handle reqests for a connection
diff --git a/sql/sql_connect.h b/sql/sql_connect.h
index 32d6af72a92..bab171606ba 100644
--- a/sql/sql_connect.h
+++ b/sql/sql_connect.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_const.h b/sql/sql_const.h
index 1b2580a2680..cfbf077bd91 100644
--- a/sql/sql_const.h
+++ b/sql/sql_const.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc
index 0271884b5f3..bcc8ad0b10f 100644
--- a/sql/sql_crypt.cc
+++ b/sql/sql_crypt.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2003, 2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
diff --git a/sql/sql_crypt.h b/sql/sql_crypt.h
index 4dfd5e82e5a..3a12d603601 100644
--- a/sql/sql_crypt.h
+++ b/sql/sql_crypt.h
@@ -1,7 +1,7 @@
#ifndef SQL_CRYPT_INCLUDED
#define SQL_CRYPT_INCLUDED
-/* Copyright (C) 2000-2001, 2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
diff --git a/sql/sql_cursor.h b/sql/sql_cursor.h
index d19d14fa167..bff47d654b3 100644
--- a/sql/sql_cursor.h
+++ b/sql/sql_cursor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _sql_cursor_h_
#define _sql_cursor_h_
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 96ca4c10390..1cd615394fb 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,6 +41,7 @@
#ifdef __WIN__
#include <direct.h>
#endif
+#include "debug_sync.h"
#define MAX_DROP_TABLE_Q_LEN 1024
@@ -1530,6 +1532,8 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
}
#endif
+ DEBUG_SYNC(thd, "before_db_dir_check");
+
if (check_db_dir_existence(new_db_file_name.str))
{
if (force_switch)
diff --git a/sql/sql_db.h b/sql/sql_db.h
index c99bdb63fc5..1f447c11a52 100644
--- a/sql/sql_db.h
+++ b/sql/sql_db.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 9cc63f7b33d..a70f00a439c 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Delete of records tables.
diff --git a/sql/sql_delete.h b/sql/sql_delete.h
index 264991c220b..6147e0ea367 100644
--- a/sql/sql_delete.h
+++ b/sql/sql_delete.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 03cbf38d4ef..dee2f01fb15 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2003 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/sql/sql_derived.h b/sql/sql_derived.h
index e96c363d5f5..f232445879e 100644
--- a/sql/sql_derived.h
+++ b/sql/sql_derived.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_do.cc b/sql/sql_do.cc
index 085473c24b8..4ba887b5ab2 100644
--- a/sql/sql_do.cc
+++ b/sql/sql_do.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Execute DO statement */
diff --git a/sql/sql_do.h b/sql/sql_do.h
index 56479f8f88e..35130cc5836 100644
--- a/sql/sql_do.h
+++ b/sql/sql_do.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 7988523dd3b..06da6250e71 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -806,14 +806,16 @@ uint32 convert_error_message(char *to, uint32 to_length, CHARSET_INFO *to_cs,
my_wc_t wc;
const uchar *from_end= (const uchar*) from+from_length;
char *to_start= to;
- uchar *to_end= (uchar*) to+to_length;
+ uchar *to_end;
my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
my_charset_conv_wc_mb wc_mb;
uint error_count= 0;
uint length;
DBUG_ASSERT(to_length > 0);
+ /* Make room for the null terminator. */
to_length--;
+ to_end= (uchar*) (to + to_length);
if (!to_cs || from_cs == to_cs || to_cs == &my_charset_bin)
{
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 460d2f07cfd..0439a3c8265 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2001, 2011, Oracle and/or its affiliates.
Copyright (c) 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 56a16d9b668..ca0e695b3fe 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_help.h b/sql/sql_help.h
index 74cff691730..b6ae490e757 100644
--- a/sql/sql_help.h
+++ b/sql/sql_help.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index a1c016b204e..b6ab3e4a7ff 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* Insert of records */
@@ -731,7 +733,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
lock_type= table_list->lock_type;
thd_proc_info(thd, "init");
- thd->used_tables=0;
+ thd->lex->used_tables=0;
values= its++;
value_count= values->elements;
@@ -890,7 +892,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
}
else
{
- if (thd->used_tables) // Column used in values()
+ if (thd->lex->used_tables) // Column used in values()
restore_record(table,s->default_values); // Get empty record
else
{
@@ -1663,9 +1665,6 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto before_trg_err;
table->file->restore_auto_increment(prev_insert_id);
- if (table->next_number_field)
- table->file->adjust_next_insert_id_after_explicit_value(
- table->next_number_field->val_int());
info->touched++;
if (!records_are_comparable(table) || compare_record(table))
{
@@ -1702,8 +1701,6 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
if (table->next_number_field)
table->file->adjust_next_insert_id_after_explicit_value(
table->next_number_field->val_int());
- info->touched++;
-
goto ok_or_after_trg_err;
}
else /* DUP_REPLACE */
diff --git a/sql/sql_insert.h b/sql/sql_insert.h
index 9511cee8526..8564f4d103e 100644
--- a/sql/sql_insert.h
+++ b/sql/sql_insert.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 984b4c998b4..f3dfd95815e 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* A lexical scanner on a temporary buffer with a yacc interface */
@@ -60,6 +60,12 @@ Query_tables_list::binlog_stmt_unsafe_errcode[BINLOG_STMT_UNSAFE_COUNT] =
ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS,
ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE,
ER_BINLOG_UNSAFE_MIXED_STATEMENT,
+ ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT,
+ ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE,
+ ER_BINLOG_UNSAFE_REPLACE_SELECT,
+ ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT,
+ ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT,
+ ER_BINLOG_UNSAFE_UPDATE_IGNORE
};
@@ -516,6 +522,8 @@ void lex_start(THD *thd)
lex->server_options.port= -1;
lex->is_lex_started= TRUE;
+ lex->used_tables= 0;
+ lex->reset_slave_info.all= false;
DBUG_VOID_RETURN;
}
@@ -1856,8 +1864,9 @@ void st_select_lex::init_query()
exclude_from_table_unique_test= no_wrap_view_item= FALSE;
nest_level= 0;
link_next= 0;
+ m_non_agg_field_used= false;
+ m_agg_func_used= false;
is_prep_leaf_list_saved= FALSE;
-
bzero((char*) expr_cache_may_be_used, sizeof(expr_cache_may_be_used));
}
@@ -1891,7 +1900,8 @@ void st_select_lex::init_select()
non_agg_fields.empty();
cond_value= having_value= Item::COND_UNDEF;
inner_refs_list.empty();
- full_group_by_flag= 0;
+ m_non_agg_field_used= false;
+ m_agg_func_used= false;
insert_tables= 0;
merged_into= 0;
}
@@ -2275,6 +2285,9 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
if (ref_pointer_array)
DBUG_RETURN(0);
+ // find_order_in_list() may need some extra space, so multiply by two.
+ order_group_num*= 2;
+
/*
We have to create array in prepared statement memory if it is a
prepared statement
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 1c72586e5f7..bbc91c2f987 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@defgroup Semantic_Analysis Semantic Analysis
@@ -314,6 +314,10 @@ struct LEX_MASTER_INFO
}
};
+typedef struct st_lex_reset_slave
+{
+ bool all;
+} LEX_RESET_SLAVE;
enum sub_select_type
{
@@ -865,16 +869,7 @@ public:
joins on the right.
*/
List<String> *prev_join_using;
- /*
- Bitmap used in the ONLY_FULL_GROUP_BY_MODE to prevent mixture of aggregate
- functions and non aggregated fields when GROUP BY list is absent.
- Bits:
- 0 - non aggregated fields are used in this select,
- defined as NON_AGG_FIELD_USED.
- 1 - aggregate functions are used in this select,
- defined as SUM_FUNC_USED.
- */
- uint8 full_group_by_flag;
+
void init_query();
void init_select();
st_select_lex_unit* master_unit();
@@ -1015,7 +1010,22 @@ public:
bool save_leaf_tables(THD *thd);
bool save_prep_leaf_tables(THD *thd);
-private:
+ /*
+ For MODE_ONLY_FULL_GROUP_BY we need to maintain two flags:
+ - Non-aggregated fields are used in this select.
+ - Aggregate functions are used in this select.
+ In MODE_ONLY_FULL_GROUP_BY only one of these may be true.
+ */
+ bool non_agg_field_used() const { return m_non_agg_field_used; }
+ bool agg_func_used() const { return m_agg_func_used; }
+
+ void set_non_agg_field_used(bool val) { m_non_agg_field_used= val; }
+ void set_agg_func_used(bool val) { m_agg_func_used= val; }
+
+private:
+ bool m_non_agg_field_used;
+ bool m_agg_func_used;
+
/* current index hint kind. used in filling up index_hints */
enum index_hint_type current_index_hint_type;
index_clause_map current_index_hint_clause;
@@ -1341,6 +1351,48 @@ public:
*/
BINLOG_STMT_UNSAFE_MIXED_STATEMENT,
+ /**
+ INSERT...IGNORE SELECT is unsafe because which rows are ignored depends
+ on the order that rows are retrieved by SELECT. This order cannot be
+ predicted and may differ on master and the slave.
+ */
+ BINLOG_STMT_UNSAFE_INSERT_IGNORE_SELECT,
+
+ /**
+ INSERT...SELECT...UPDATE is unsafe because which rows are updated depends
+ on the order that rows are retrieved by SELECT. This order cannot be
+ predicted and may differ on master and the slave.
+ */
+ BINLOG_STMT_UNSAFE_INSERT_SELECT_UPDATE,
+
+ /**
+ INSERT...REPLACE SELECT is unsafe because which rows are replaced depends
+ on the order that rows are retrieved by SELECT. This order cannot be
+ predicted and may differ on master and the slave.
+ */
+ BINLOG_STMT_UNSAFE_REPLACE_SELECT,
+
+ /**
+ CREATE TABLE... IGNORE... SELECT is unsafe because which rows are ignored
+ depends on the order that rows are retrieved by SELECT. This order cannot
+ be predicted and may differ on master and the slave.
+ */
+ BINLOG_STMT_UNSAFE_CREATE_IGNORE_SELECT,
+
+ /**
+ CREATE TABLE...REPLACE... SELECT is unsafe because which rows are replaced
+ depends on the order that rows are retrieved from SELECT. This order
+ cannot be predicted and may differ on master and the slave
+ */
+ BINLOG_STMT_UNSAFE_CREATE_REPLACE_SELECT,
+
+ /**
+ UPDATE...IGNORE is unsafe because which rows are ignored depends on the
+ order that rows are updated. This order cannot be predicted and may differ
+ on master and the slave.
+ */
+ BINLOG_STMT_UNSAFE_UPDATE_IGNORE,
+
/* The last element of this enumeration type. */
BINLOG_STMT_UNSAFE_COUNT
};
@@ -2323,6 +2375,7 @@ struct LEX: public Query_tables_list
LEX_MASTER_INFO mi; // used by CHANGE MASTER
LEX_SERVER_OPTIONS server_options;
USER_RESOURCES mqh;
+ LEX_RESET_SLAVE reset_slave_info;
ulong type;
/*
This variable is used in post-parse stage to declare that sum-functions,
@@ -2495,6 +2548,16 @@ struct LEX: public Query_tables_list
bool escape_used;
bool is_lex_started; /* If lex_start() did run. For debugging. */
+ /*
+ The set of those tables whose fields are referenced in all subqueries
+ of the query.
+ TODO: possibly this it is incorrect to have used tables in LEX because
+ with subquery, it is not clear what does the field mean. To fix this
+ we should aggregate used tables information for selected expressions
+ into the select_lex.
+ */
+ table_map used_tables;
+
LEX();
virtual ~LEX()
diff --git a/sql/sql_list.cc b/sql/sql_list.cc
index a256212471d..2c1b3c47d55 100644
--- a/sql/sql_list.cc
+++ b/sql/sql_list.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2003, 2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_IMPLEMENTATION
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 46e9923c51a..5441fec5f63 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -1,6 +1,6 @@
#ifndef INCLUDES_MYSQL_SQL_LIST_H
#define INCLUDES_MYSQL_SQL_LIST_H
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 5acddc19bed..6f84f68eeaa 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Copy data from a textfile to table */
@@ -179,6 +180,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
#ifndef EMBEDDED_LIBRARY
LOAD_FILE_INFO lf_info;
THD::killed_state killed_status= THD::NOT_KILLED;
+ bool is_concurrent;
#endif
char *db = table_list->db; // This is never null
/*
@@ -189,7 +191,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
char *tdb= thd->db ? thd->db : db; // Result is never null
ulong skip_lines= ex->skip_lines;
bool transactional_table;
- bool is_concurrent;
DBUG_ENTER("mysql_load");
/*
@@ -261,7 +262,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table= table_list->table;
transactional_table= table->file->has_transactions();
+#ifndef EMBEDDED_LIBRARY
is_concurrent= (table_list->lock_type == TL_WRITE_CONCURRENT_INSERT);
+#endif
if (!fields_vars.elements)
{
@@ -403,8 +406,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
#if !defined(__WIN__) && ! defined(__NETWARE__)
MY_STAT stat_info;
- if (!my_stat(name,&stat_info,MYF(MY_WME)))
- DBUG_RETURN(TRUE);
+ if (!my_stat(name, &stat_info, MYF(MY_WME)))
+ DBUG_RETURN(TRUE);
// if we are not in slave thread, the file must be:
if (!thd->slave_thread &&
@@ -412,11 +415,11 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
((stat_info.st_mode & S_IFREG) == S_IFREG || // regular file
(stat_info.st_mode & S_IFIFO) == S_IFIFO))) // named pipe
{
- my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), name);
- DBUG_RETURN(TRUE);
+ my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), name);
+ DBUG_RETURN(TRUE);
}
if ((stat_info.st_mode & S_IFIFO) == S_IFIFO)
- is_fifo = 1;
+ is_fifo= 1;
#endif
if ((file= mysql_file_open(key_file_load,
name, O_RDONLY, MYF(MY_WME))) < 0)
diff --git a/sql/sql_load.h b/sql/sql_load.h
index 344b869854a..f767e39387b 100644
--- a/sql/sql_load.h
+++ b/sql/sql_load.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc
index c8aee307362..13e00c99f19 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
The beginnings of locale(7) support.
diff --git a/sql/sql_locale.h b/sql/sql_locale.h
index e62660aaa47..8357a9ecba4 100644
--- a/sql/sql_locale.h
+++ b/sql/sql_locale.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index e3929066361..221ba56130a 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
* sql_manager.cc
diff --git a/sql/sql_manager.h b/sql/sql_manager.h
index a0ef8080aa7..8debbe6ead9 100644
--- a/sql/sql_manager.h
+++ b/sql/sql_manager.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ad5aa281ea7..54b1e854ac1 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1325,7 +1325,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
length= my_snprintf(buff, buff_len - 1,
"Uptime: %lu Threads: %d Questions: %lu "
"Slow queries: %lu Opens: %lu Flush tables: %lu "
- "Open tables: %u Queries per second avg: %u.%u",
+ "Open tables: %u Queries per second avg: %u.%03u",
uptime,
(int) thread_count, (ulong) thd->query_id,
current_global_status_var->long_query_count,
@@ -2066,6 +2066,11 @@ mysql_execute_command(THD *thd)
*/
if (stmt_causes_implicit_commit(thd, CF_IMPLICT_COMMIT_BEGIN))
{
+ /*
+ Note that this should never happen inside of stored functions
+ or triggers as all such statements prohibited there.
+ */
+ DBUG_ASSERT(! thd->in_sub_stmt);
/* Commit or rollback the statement transaction. */
thd->is_error() ? trans_rollback_stmt(thd) : trans_commit_stmt(thd);
/* Commit the normal transaction if one is active. */
@@ -2366,6 +2371,12 @@ case SQLCOM_PREPARE:
goto end_with_restore_list;
#endif
/*
+ If no engine type was given, work out the default now
+ rather than at parse-time.
+ */
+ if (!(create_info.used_fields & HA_CREATE_USED_ENGINE))
+ create_info.db_type= ha_default_handlerton(thd);
+ /*
If we are using SET CHARSET without DEFAULT, add an implicit
DEFAULT to not confuse old users. (This may change).
*/
@@ -2399,6 +2410,19 @@ case SQLCOM_PREPARE:
select_result *result;
/*
+ CREATE TABLE...IGNORE/REPLACE SELECT... can be unsafe, unless
+ ORDER BY PRIMARY KEY clause is used in SELECT statement. We therefore
+ use row based logging if mixed or row based logging is available.
+ TODO: Check if the order of the output of the select statement is
+ deterministic. Waiting for BUG#42415
+ */
+ if(lex->ignore)
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_CREATE_IGNORE_SELECT);
+
+ if(lex->duplicates == DUP_REPLACE)
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_CREATE_REPLACE_SELECT);
+
+ /*
If:
a) we inside an SP and there was NAME_CONST substitution,
b) binlogging is on (STMT mode),
@@ -2705,6 +2729,16 @@ end_with_restore_list:
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if (update_precheck(thd, all_tables))
break;
+
+ /*
+ UPDATE IGNORE can be unsafe. We therefore use row based
+ logging if mixed or row based logging is available.
+ TODO: Check if the order of the output of the select statement is
+ deterministic. Waiting for BUG#42415
+ */
+ if (lex->ignore)
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_UPDATE_IGNORE);
+
DBUG_ASSERT(select_lex->offset_limit == 0);
unit->set_limit(select_lex);
MYSQL_UPDATE_START(thd->query());
@@ -2876,6 +2910,23 @@ end_with_restore_list:
DBUG_ASSERT(first_table == all_tables && first_table != 0);
if ((res= insert_precheck(thd, all_tables)))
break;
+ /*
+ INSERT...SELECT...ON DUPLICATE KEY UPDATE/REPLACE SELECT/
+ INSERT...IGNORE...SELECT can be unsafe, unless ORDER BY PRIMARY KEY
+ clause is used in SELECT statement. We therefore use row based
+ logging if mixed or row based logging is available.
+ TODO: Check if the order of the output of the select statement is
+ deterministic. Waiting for BUG#42415
+ */
+ if (lex->sql_command == SQLCOM_INSERT_SELECT &&
+ lex->duplicates == DUP_UPDATE)
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_SELECT_UPDATE);
+
+ if (lex->sql_command == SQLCOM_INSERT_SELECT && lex->ignore)
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_IGNORE_SELECT);
+
+ if (lex->sql_command == SQLCOM_REPLACE_SELECT)
+ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_REPLACE_SELECT);
/* Fix lock for first table */
if (first_table->lock_type == TL_WRITE_DELAYED)
diff --git a/sql/sql_parse.h b/sql/sql_parse.h
index d5f90b03ebf..2c31f71af53 100644
--- a/sql/sql_parse.h
+++ b/sql/sql_parse.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index c75b20e577e..646d829a51e 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1003,8 +1003,6 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
int error;
LEX *old_lex= thd->lex;
LEX lex;
- uint8 saved_full_group_by_flag;
- nesting_map saved_allow_sum_func;
DBUG_ENTER("fix_fields_part_func");
if (init_lex_with_single_table(thd, table, &lex))
@@ -1029,20 +1027,23 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
This is a tricky call to prepare for since it can have a large number
of interesting side effects, both desirable and undesirable.
*/
- saved_full_group_by_flag= thd->lex->current_select->full_group_by_flag;
- saved_allow_sum_func= thd->lex->allow_sum_func;
- thd->lex->allow_sum_func= 0;
-
- if (!(error= func_expr->fix_fields(thd, (Item**)&func_expr)))
- func_expr->walk(&Item::vcol_in_partition_func_processor, 0, NULL);
+ {
+ const bool save_agg_field= thd->lex->current_select->non_agg_field_used();
+ const bool save_agg_func= thd->lex->current_select->agg_func_used();
+ const nesting_map saved_allow_sum_func= thd->lex->allow_sum_func;
+ thd->lex->allow_sum_func= 0;
- /*
- Restore full_group_by_flag and allow_sum_func,
- fix_fields should not affect mysql_select later, see Bug#46923.
- */
- thd->lex->current_select->full_group_by_flag= saved_full_group_by_flag;
- thd->lex->allow_sum_func= saved_allow_sum_func;
+ if (!(error= func_expr->fix_fields(thd, (Item**)&func_expr)))
+ func_expr->walk(&Item::vcol_in_partition_func_processor, 0, NULL);
+ /*
+ Restore agg_field/agg_func and allow_sum_func,
+ fix_fields should not affect mysql_select later, see Bug#46923.
+ */
+ thd->lex->current_select->set_non_agg_field_used(save_agg_field);
+ thd->lex->current_select->set_agg_func_used(save_agg_func);
+ thd->lex->allow_sum_func= saved_allow_sum_func;
+ }
if (unlikely(error))
{
DBUG_PRINT("info", ("Field in partition function not part of table"));
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index c19eb5802b3..d2c15ae46d8 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -1,7 +1,7 @@
#ifndef SQL_PARTITION_INCLUDED
#define SQL_PARTITION_INCLUDED
-/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index cadfc587c1c..4edd47de855 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_partition_admin.h b/sql/sql_partition_admin.h
index 564b8676be8..479371c3b4d 100644
--- a/sql/sql_partition_admin.h
+++ b/sql/sql_partition_admin.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_plist.h b/sql/sql_plist.h
index b71136cd9ab..ca1d15f3015 100644
--- a/sql/sql_plist.h
+++ b/sql/sql_plist.h
@@ -1,6 +1,6 @@
#ifndef SQL_PLIST_H
#define SQL_PLIST_H
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index b725f1c35fc..06ead26414c 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,4 +1,6 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index ee1d43e8a2f..f0b706bc322 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _sql_plugin_h
#define _sql_plugin_h
diff --git a/sql/sql_plugin_services.h b/sql/sql_plugin_services.h
index 50c579b6c4c..7f2a4e5f955 100644
--- a/sql/sql_plugin_services.h
+++ b/sql/sql_plugin_services.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* support for Services */
#include <service_versions.h>
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 7973713cb32..ef6dd519d5d 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1503,7 +1503,7 @@ static int mysql_test_select(Prepared_statement *stmt,
DT_PREPARE | DT_CREATE))
goto error;
- thd->used_tables= 0; // Updated by setup_fields
+ thd->lex->used_tables= 0; // Updated by setup_fields
thd->thd_marker.emb_on_expr_nest= 0;
/*
@@ -1678,7 +1678,7 @@ static bool select_like_stmt_test(Prepared_statement *stmt,
if (specific_prepare && (*specific_prepare)(thd))
DBUG_RETURN(TRUE);
- thd->used_tables= 0; // Updated by setup_fields
+ thd->lex->used_tables= 0; // Updated by setup_fields
/* Calls JOIN::prepare */
DBUG_RETURN(lex->unit.prepare(thd, 0, setup_tables_done_option));
diff --git a/sql/sql_prepare.h b/sql/sql_prepare.h
index 11017b127b1..e0891bbd188 100644
--- a/sql/sql_prepare.h
+++ b/sql/sql_prepare.h
@@ -1,6 +1,7 @@
#ifndef SQL_PREPARE_H
#define SQL_PREPARE_H
-/* Copyright (C) 1995-2008 MySQL AB
+/* Copyright (c) 1995-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_error.h"
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 674366be1b7..33c5881d4f4 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2010-2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -321,13 +321,6 @@ enum enum_yes_no_unknown
#ifdef MYSQL_SERVER
/*
- A set of constants used for checking non aggregated fields and sum
- functions mixture in the ONLY_FULL_GROUP_BY_MODE.
-*/
-#define NON_AGG_FIELD_USED 1
-#define SUM_FUNC_USED 2
-
-/*
External variables
*/
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index dffc03fbc55..aee42af8b71 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2010 Oracle and/or its affiliates.
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@@ -296,7 +296,7 @@ void QUERY_PROFILE::new_status(const char *status_arg,
DBUG_ASSERT(status_arg != NULL);
if ((function_arg != NULL) && (file_arg != NULL))
- prof= new PROF_MEASUREMENT(this, status_arg, function_arg, file_arg, line_arg);
+ prof= new PROF_MEASUREMENT(this, status_arg, function_arg, base_name(file_arg), line_arg);
else
prof= new PROF_MEASUREMENT(this, status_arg);
diff --git a/sql/sql_profile.h b/sql/sql_profile.h
index 0931fb0df0c..2e93912fb25 100644
--- a/sql/sql_profile.h
+++ b/sql/sql_profile.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _SQL_PROFILE_H
#define _SQL_PROFILE_H
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 787912cdc4a..6cc08e64d86 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Atomic rename of table; RENAME TABLE t1 to t2, tmp to t1 [,...]
diff --git a/sql/sql_rename.h b/sql/sql_rename.h
index 7fbf9f1e5cd..039a3b8b4a1 100644
--- a/sql/sql_rename.h
+++ b/sql/sql_rename.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 400ca28a277..91c78944205 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h"
@@ -459,7 +459,7 @@ Increase max_allowed_packet on master";
*errmsg = "memory allocation failed reading log event";
break;
case LOG_READ_TRUNC:
- *errmsg = "binlog truncated in the middle of event";
+ *errmsg = "binlog truncated in the middle of event; consider out of disk space on master";
break;
case LOG_READ_CHECKSUM_FAILURE:
*errmsg = "event read from binlog did not pass crc check";
@@ -557,6 +557,9 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
String* packet = &thd->packet;
int error;
const char *errmsg = "Unknown error";
+ const char *fmt= "%s; the last event was read from '%s' at %s, the last byte read was read from '%s' at %s.";
+ char llbuff1[22], llbuff2[22];
+ char error_text[MAX_SLAVE_ERRMSG]; // to be send to slave via my_message()
NET* net = &thd->net;
mysql_mutex_t *log_lock;
mysql_cond_t *log_cond;
@@ -812,11 +815,9 @@ impossible position";
if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
goto err;
- my_off_t prev_pos= pos;
while (!(error = Log_event::read_log_event(&log, packet, log_lock,
current_checksum_alg)))
{
- prev_pos= my_b_tell(&log);
#ifndef DBUG_OFF
if (max_binlog_dump_events && !left_events--)
{
@@ -931,18 +932,6 @@ impossible position";
}
/*
- here we were reading binlog that was not closed properly (as a result
- of a crash ?). treat any corruption as EOF
- */
- if (binlog_can_be_corrupted &&
- (error != LOG_READ_MEM && error != LOG_READ_CHECKSUM_FAILURE &&
- error != LOG_READ_EOF))
- {
- my_b_seek(&log, prev_pos);
- error=LOG_READ_EOF;
- }
-
- /*
TODO: now that we are logging the offset, check to make sure
the recorded offset and the actual match.
Guilhem 2003-06: this is not true if this master is a slave
@@ -1190,6 +1179,21 @@ end:
err:
thd_proc_info(thd, "Waiting to finalize termination");
+ if (my_errno == ER_MASTER_FATAL_ERROR_READING_BINLOG && my_b_inited(&log))
+ {
+ /*
+ detailing the fatal error message with coordinates
+ of the last position read.
+ */
+ char b_start[FN_REFLEN], b_end[FN_REFLEN];
+ fn_format(b_start, coord->file_name, "", "", MY_REPLACE_DIR);
+ fn_format(b_end, log_file_name, "", "", MY_REPLACE_DIR);
+ my_snprintf(error_text, sizeof(error_text), fmt, errmsg,
+ b_start, (llstr(coord->pos, llbuff1), llbuff1),
+ b_end, (llstr(my_b_tell(&log), llbuff2), llbuff2));
+ }
+ else
+ strcpy(error_text, errmsg);
end_io_cache(&log);
RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
/*
@@ -1206,7 +1210,7 @@ err:
mysql_file_close(file, MYF(MY_WME));
thd->variables.max_allowed_packet= old_max_allowed_packet;
- my_message(my_errno, errmsg, MYF(0));
+ my_message(my_errno, error_text, MYF(0));
DBUG_VOID_RETURN;
}
@@ -1454,8 +1458,9 @@ int reset_slave(THD *thd, Master_info* mi)
goto err;
}
- /* Clear master's log coordinates */
- init_master_log_pos(mi);
+ /* Clear master's log coordinates and associated information */
+ mi->clear_in_memory_info(thd->lex->reset_slave_info.all);
+
/*
Reset errors (the idea is that we forget about the
old master).
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index dfe41d8e688..7dc58c47d52 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB & Sasha
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef SQL_REPL_INCLUDED
#define SQL_REPL_INCLUDED
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b514d95fca5..5499806db81 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -445,7 +445,7 @@ fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select,
if (!ref->fixed && ref->fix_fields(thd, 0))
return TRUE;
- thd->used_tables|= item->used_tables();
+ thd->lex->used_tables|= item->used_tables();
}
return false;
}
@@ -465,19 +465,18 @@ inline int setup_without_group(THD *thd, Item **ref_pointer_array,
int res;
nesting_map save_allow_sum_func=thd->lex->allow_sum_func ;
/*
- Need to save the value, so we can turn off only the new NON_AGG_FIELD
+ Need to save the value, so we can turn off only any new non_agg_field_used
additions coming from the WHERE
*/
- uint8 saved_flag= thd->lex->current_select->full_group_by_flag;
+ const bool saved_non_agg_field_used=
+ thd->lex->current_select->non_agg_field_used();
DBUG_ENTER("setup_without_group");
thd->lex->allow_sum_func&= ~(1 << thd->lex->current_select->nest_level);
res= setup_conds(thd, tables, leaves, conds);
/* it's not wrong to have non-aggregated columns in a WHERE */
- if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY)
- thd->lex->current_select->full_group_by_flag= saved_flag |
- (thd->lex->current_select->full_group_by_flag & ~NON_AGG_FIELD_USED);
+ thd->lex->current_select->set_non_agg_field_used(saved_non_agg_field_used);
thd->lex->allow_sum_func|= 1 << thd->lex->current_select->nest_level;
res= res || setup_order(thd, ref_pointer_array, tables, fields, all_fields,
@@ -715,7 +714,8 @@ JOIN::prepare(Item ***rref_pointer_array,
aggregate functions with implicit grouping (there is no GROUP BY).
*/
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY && !group_list &&
- select_lex->full_group_by_flag == (NON_AGG_FIELD_USED | SUM_FUNC_USED))
+ select_lex->non_agg_field_used() &&
+ select_lex->agg_func_used())
{
my_message(ER_MIX_OF_GROUP_FUNC_AND_FIELDS,
ER(ER_MIX_OF_GROUP_FUNC_AND_FIELDS), MYF(0));
@@ -2898,7 +2898,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
if (!(join= new JOIN(thd, fields, select_options, result)))
DBUG_RETURN(TRUE);
thd_proc_info(thd, "init");
- thd->used_tables=0; // Updated by setup_fields
+ thd->lex->used_tables=0; // Updated by setup_fields
if ((err= join->prepare(rref_pointer_array, tables, wild_num,
conds, og_num, order, group, having, proc_param,
select_lex, unit)))
@@ -3041,6 +3041,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
table_vector[i]=s->table=table=tables->table;
table->pos_in_table_list= tables;
error= tables->fetch_number_of_rows();
+
if (error)
{
table->file->print_error(error, MYF(0));
diff --git a/sql/sql_select.h b/sql/sql_select.h
index d456eab5ac5..d87504f719c 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1,7 +1,7 @@
#ifndef SQL_SELECT_INCLUDED
#define SQL_SELECT_INCLUDED
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index 7d33abc16cd..dce679a883f 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/sql/sql_servers.h b/sql/sql_servers.h
index 3c338bbe3f9..a6186a85ae2 100644
--- a/sql/sql_servers.h
+++ b/sql/sql_servers.h
@@ -1,7 +1,7 @@
#ifndef SQL_SERVERS_INCLUDED
#define SQL_SERVERS_INCLUDED
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 4485991cdaf..a65a2e40577 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -3573,6 +3573,10 @@ end:
*/
thd->temporary_tables= NULL;
close_thread_tables(thd);
+ /*
+ Release metadata lock we might have acquired.
+ See comment in fill_schema_table_from_frm() for details.
+ */
thd->mdl_context.rollback_to_savepoint(open_tables_state_backup->mdl_system_tables_svp);
thd->lex= old_lex;
@@ -3755,6 +3759,9 @@ try_acquire_high_prio_shared_mdl_lock(THD *thd, TABLE_LIST *table,
@param[in] db_name database name
@param[in] table_name table name
@param[in] schema_table_idx I_S table index
+ @param[in] open_tables_state_backup Open_tables_state object which is used
+ to save/restore original state of metadata
+ locks.
@param[in] can_deadlock Indicates that deadlocks are possible
due to metadata locks, so to avoid
them we should not wait in case if
@@ -3772,6 +3779,7 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables,
LEX_STRING *db_name,
LEX_STRING *table_name,
enum enum_schema_tables schema_table_idx,
+ Open_tables_backup *open_tables_state_backup,
bool can_deadlock)
{
TABLE *table= tables->table;
@@ -3916,13 +3924,27 @@ end_share:
end_unlock:
mysql_mutex_unlock(&LOCK_open);
- /*
- Don't release the MDL lock, it can be part of a transaction.
- If it is not, it will be released by the call to
- MDL_context::rollback_to_savepoint() in the caller.
- */
end:
+ /*
+ Release metadata lock we might have acquired.
+
+ Without this step metadata locks acquired for each table processed
+ will be accumulated. In situation when a lot of tables are processed
+ by I_S query this will result in transaction with too many metadata
+ locks. As result performance of acquisition of new lock will suffer.
+
+ Of course, the fact that we don't hold metadata lock on tables which
+ were processed till the end of I_S query makes execution less isolated
+ from concurrent DDL. Consequently one might get 'dirty' results from
+ such a query. But we have never promised serializability of I_S queries
+ anyway.
+
+ We don't have any tables open since we took backup, so rolling back to
+ savepoint is safe.
+ */
+ DBUG_ASSERT(thd->open_tables == NULL);
+ thd->mdl_context.rollback_to_savepoint(open_tables_state_backup->mdl_system_tables_svp);
thd->clear_error();
return res;
}
@@ -4173,6 +4195,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
int res= fill_schema_table_from_frm(thd, tables, schema_table,
db_name, table_name,
schema_table_idx,
+ &open_tables_state_backup,
can_deadlock);
thd->pop_internal_handler();
diff --git a/sql/sql_show.h b/sql/sql_show.h
index de8f2525baa..8ad9327c08c 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc
index ed42110f7f6..c9f1f42159f 100644
--- a/sql/sql_signal.cc
+++ b/sql/sql_signal.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Sun Microsystems, Inc
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "sp_head.h"
diff --git a/sql/sql_signal.h b/sql/sql_signal.h
index c9c1517f4ad..058457a3639 100644
--- a/sql/sql_signal.h
+++ b/sql/sql_signal.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 Sun Microsystems, Inc
+/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef SQL_SIGNAL_H
#define SQL_SIGNAL_H
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index 4cb2f30d9de..f1a3a2f9d8b 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -1,7 +1,7 @@
#ifndef SQL_SORT_INCLUDED
#define SQL_SORT_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_global.h" /* uchar */
#include "my_base.h" /* ha_rows */
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index e615bf7d4df..6c772617e7b 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is originally from the mysql distribution. Coded by monty */
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 71ad0960924..fcf04fb7690 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -1,7 +1,7 @@
#ifndef SQL_STRING_INCLUDED
#define SQL_STRING_INCLUDED
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is originally from the mysql distribution. Coded by monty */
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index a5ef2c4b7fc..1b0279c9969 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2010, 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/* drop and alter of tables */
@@ -5485,6 +5487,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (drop)
{
drop_it.remove();
+ /*
+ ALTER TABLE DROP COLUMN always changes table data even in cases
+ when new version of the table has the same structure as the old
+ one.
+ */
+ alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
continue;
}
/* Check if field is changed */
@@ -5568,7 +5576,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (!def->after)
new_create_list.push_back(def);
else if (def->after == first_keyword)
+ {
new_create_list.push_front(def);
+ /*
+ Re-ordering columns in table can't be done using in-place algorithm
+ as it always changes table data.
+ */
+ alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
+ }
else
{
Create_field *find;
@@ -5585,6 +5600,10 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
goto err;
}
find_it.after(def); // Put element after this
+ /*
+ Re-ordering columns in table can't be done using in-place algorithm
+ as it always changes table data.
+ */
alter_info->change_level= ALTER_TABLE_DATA_CHANGED;
}
}
diff --git a/sql/sql_table.h b/sql/sql_table.h
index 333fc7431c0..00de6ed1b8d 100644
--- a/sql/sql_table.h
+++ b/sql/sql_table.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
index 47b5f6c26fc..3f6daf7a9ec 100644
--- a/sql/sql_tablespace.cc
+++ b/sql/sql_tablespace.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* drop and alter of tablespaces */
diff --git a/sql/sql_tablespace.h b/sql/sql_tablespace.h
index 93544dea4af..ae77d15cbcb 100644
--- a/sql/sql_tablespace.h
+++ b/sql/sql_tablespace.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 9cf16e2bc6a..46f27f184fa 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Write some debug info */
diff --git a/sql/sql_test.h b/sql/sql_test.h
index 82d4aad838a..3c1ee188eeb 100644
--- a/sql/sql_test.h
+++ b/sql/sql_test.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index ce50fdb345b..e30c74a148e 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to handle date and time */
diff --git a/sql/sql_time.h b/sql/sql_time.h
index 937d10f5b74..7d0d9610872 100644
--- a/sql/sql_time.h
+++ b/sql/sql_time.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 526bc9f65bd..30da842e0c5 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index c2afa900b74..84637b79818 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -1,7 +1,8 @@
#ifndef SQL_TRIGGER_INCLUDED
#define SQL_TRIGGER_INCLUDED
-/* Copyright (C) 2004-2005 MySQL AB
+/*
+ Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Forward declarations */
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 3b3e96082cf..7eb0cd7ebf7 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This implements 'user defined functions' */
diff --git a/sql/sql_udf.h b/sql/sql_udf.h
index 95cb167869e..cdb15b9e0f5 100644
--- a/sql/sql_udf.h
+++ b/sql/sql_udf.h
@@ -1,7 +1,8 @@
#ifndef SQL_UDF_INCLUDED
#define SQL_UDF_INCLUDED
-/* Copyright (C) 2000-2001, 2003-2006 MySQL AB
+/* Copyright (c) 2000, 2003-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file defines structures needed by udf functions */
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 200140b5f6a..3f3d140dad8 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
@@ -474,15 +474,27 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
fake_select_lex->table_list.empty();
DBUG_RETURN(TRUE);
}
+
+ /*
+ Fake st_select_lex should have item list for correct ref_array
+ allocation.
+ */
fake_select_lex->item_list= item_list;
thd_arg->lex->current_select= fake_select_lex;
+
+ /*
+ We need to add up n_sum_items in order to make the correct
+ allocation in setup_ref_array().
+ */
+ fake_select_lex->n_child_sum_items+= global_parameters->n_sum_items;
+
saved_error= fake_select_lex->join->
prepare(&fake_select_lex->ref_pointer_array,
fake_select_lex->table_list.first,
0, 0,
- fake_select_lex->order_list.elements,
- fake_select_lex->order_list.first,
+ global_parameters->order_list.elements, // og_num
+ global_parameters->order_list.first, // order
NULL, NULL, NULL,
fake_select_lex, this);
fake_select_lex->table_list.empty();
@@ -712,11 +724,21 @@ bool st_select_lex_unit::exec()
}
fake_select_lex->join->no_const_tables= TRUE;
- /*
- Fake st_select_lex should have item list for correctref_array
- allocation.
- */
- fake_select_lex->item_list= item_list;
+ /*
+ Fake st_select_lex should have item list for correct ref_array
+ allocation.
+ */
+ fake_select_lex->item_list= item_list;
+
+ /*
+ We need to add up n_sum_items in order to make the correct
+ allocation in setup_ref_array().
+ Don't add more sum_items if we have already done JOIN::prepare
+ for this (with a different join object)
+ */
+ if (!fake_select_lex->ref_pointer_array)
+ fake_select_lex->n_child_sum_items+= global_parameters->n_sum_items;
+
saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array,
&result_table_list,
0, item_list, NULL,
diff --git a/sql/sql_union.h b/sql/sql_union.h
index 43e1b7a6910..171f607fba7 100644
--- a/sql/sql_union.h
+++ b/sql/sql_union.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 5cb8d085c33..9ab01736f66 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
diff --git a/sql/sql_update.h b/sql/sql_update.h
index 9552ff0ab2d..64029c5d634 100644
--- a/sql/sql_update.h
+++ b/sql/sql_update.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sql_view.h b/sql/sql_view.h
index c15ecffccb8..2e9c77252e8 100644
--- a/sql/sql_view.h
+++ b/sql/sql_view.h
@@ -2,7 +2,7 @@
#define SQL_VIEW_INCLUDED
/* -*- C++ -*- */
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "sql_class.h" /* Required by sql_lex.h */
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 93e2729c9fe..d82936c87a9 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2010, 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* sql_yacc.yy */
@@ -2071,7 +2072,6 @@ create:
lex->change=NullS;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
lex->create_info.options=$2 | $4;
- lex->create_info.db_type= ha_default_handlerton(thd);
lex->create_info.default_table_charset= NULL;
lex->name.str= 0;
lex->name.length= 0;
@@ -2081,7 +2081,8 @@ create:
{
LEX *lex= YYTHD->lex;
lex->current_select= &lex->select_lex;
- if (!lex->create_info.db_type)
+ if ((lex->create_info.used_fields & HA_CREATE_USED_ENGINE) &&
+ !lex->create_info.db_type)
{
lex->create_info.db_type= ha_default_handlerton(YYTHD);
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -5080,8 +5081,7 @@ create_table_option:
ENGINE_SYM opt_equal storage_engines
{
Lex->create_info.db_type= $3;
- if ($3)
- Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
+ Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
}
| MAX_ROWS opt_equal ulonglong_num
{
@@ -6976,7 +6976,13 @@ alter_list_item:
}
| create_table_options_space_separated
{
- Lex->alter_info.flags|= ALTER_OPTIONS;
+ LEX *lex=Lex;
+ lex->alter_info.flags|= ALTER_OPTIONS;
+ if ((lex->create_info.used_fields & HA_CREATE_USED_ENGINE) &&
+ !lex->create_info.db_type)
+ {
+ lex->create_info.used_fields&= ~HA_CREATE_USED_ENGINE;
+ }
}
| FORCE_SYM
{
@@ -9036,6 +9042,11 @@ function_call_generic:
Create_func *builder;
Item *item= NULL;
+ if (check_routine_name(&$1))
+ {
+ MYSQL_YYABORT;
+ }
+
/*
Implementation note:
names are resolved with the following order:
@@ -9099,6 +9110,16 @@ function_call_generic:
version() (a vendor can specify any schema).
*/
+ if (!$1.str || check_db_name(&$1))
+ {
+ my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ if (check_routine_name(&$3))
+ {
+ MYSQL_YYABORT;
+ }
+
builder= find_qualified_function_builder(thd);
DBUG_ASSERT(builder);
item= builder->create_with_db(thd, $1, $3, true, $5);
@@ -11745,7 +11766,10 @@ flush_option:
| STATUS_SYM
{ Lex->type|= REFRESH_STATUS; }
| SLAVE
- { Lex->type|= REFRESH_SLAVE; }
+ {
+ Lex->type|= REFRESH_SLAVE;
+ Lex->reset_slave_info.all= false;
+ }
| CLIENT_STATS_SYM
{ Lex->type|= REFRESH_CLIENT_STATS; }
| USER_STATS_SYM
@@ -11788,10 +11812,16 @@ reset_options:
reset_option:
SLAVE { Lex->type|= REFRESH_SLAVE; }
+ slave_reset_options { }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
| QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;}
;
+slave_reset_options:
+ /* empty */ { Lex->reset_slave_info.all= false; }
+ | ALL { Lex->reset_slave_info.all= true; }
+ ;
+
purge:
PURGE
{
diff --git a/sql/strfunc.h b/sql/strfunc.h
index 6aa446e59ac..57c5427fcd0 100644
--- a/sql/strfunc.h
+++ b/sql/strfunc.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/structs.h b/sql/structs.h
index 0d0b32e3d41..347cb97e152 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -1,7 +1,7 @@
#ifndef STRUCTS_INCLUDED
#define STRUCTS_INCLUDED
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 88a1b2f6da6..168c8a9c998 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index d2a1e2360b6..1b9a22b1db7 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006 MySQL AB, 2009-2010 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/sys_vars_shared.h b/sql/sys_vars_shared.h
index 644cc10c853..ff050f63064 100644
--- a/sql/sys_vars_shared.h
+++ b/sql/sys_vars_shared.h
@@ -1,7 +1,7 @@
#ifndef SYS_VARS_SHARED_INCLUDED
#define SYS_VARS_SHARED_INCLUDED
-/* Copyright (C) 2002-2006 MySQL AB, 2009-2010 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
diff --git a/sql/table.cc b/sql/table.cc
index ab7ab37331a..a157dbeb15a 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/sql/table.h b/sql/table.h
index 8dd1067ba49..b22cdb6e76b 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1,6 +1,6 @@
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009, 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_plist.h"
diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc
index bbcfeeda3e8..ba534e52b99 100644
--- a/sql/thr_malloc.cc
+++ b/sql/thr_malloc.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2003-2004 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Mallocs for used in threads */
diff --git a/sql/thr_malloc.h b/sql/thr_malloc.h
index 52e6752ab70..81b7d3cc238 100644
--- a/sql/thr_malloc.h
+++ b/sql/thr_malloc.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/sql/transaction.h b/sql/transaction.h
index 135e6cae73f..e002cd4a9dc 100644
--- a/sql/transaction.h
+++ b/sql/transaction.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008 Sun/MySQL
+/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef TRANSACTION_H
#define TRANSACTION_H
diff --git a/sql/tzfile.h b/sql/tzfile.h
index 1c1800ba1ed..4feba612b36 100644
--- a/sql/tzfile.h
+++ b/sql/tzfile.h
@@ -1,7 +1,8 @@
#ifndef TZFILE_INCLUDED
#define TZFILE_INCLUDED
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This file is based on public domain code from ftp://elsie.ncih.nist.gov/
diff --git a/sql/tztime.cc b/sql/tztime.cc
index f84c62d98c9..aa945687675 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Most of the following code and structures were derived from
diff --git a/sql/tztime.h b/sql/tztime.h
index c7ee0ff36cc..eb7d85c48b2 100644
--- a/sql/tztime.h
+++ b/sql/tztime.h
@@ -1,7 +1,7 @@
#ifndef TZTIME_INCLUDED
#define TZTIME_INCLUDED
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
diff --git a/sql/udf_example.c b/sql/udf_example.c
index e0b72c99d7a..d68f49e1729 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
** example file of UDF (user definable functions) that are dynamicly loaded
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 21aa66ec64d..ae50a1d3970 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Function to handle quick removal of duplicates
diff --git a/sql/unireg.cc b/sql/unireg.cc
index ef9729bcda4..b5faac3b797 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
Functions to create a unireg form-file from a FIELD and a fieldname-fieldinfo
diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c
index ab54164dcc0..eac70810e1c 100644
--- a/storage/archive/archive_reader.c
+++ b/storage/archive/archive_reader.c
@@ -1,3 +1,18 @@
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
#include "azlib.h"
#include <string.h>
#include <assert.h>
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 4112279d3c6..3ccd1e83800 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -12,8 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
@@ -1779,7 +1780,8 @@ mysql_declare_plugin(archive)
0x0300 /* 3.0 */,
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(archive)
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h
index 034b759e091..7ae6bf57a32 100644
--- a/storage/archive/ha_archive.h
+++ b/storage/archive/ha_archive.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index e758b29b024..7bdbb4349cd 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -1,4 +1,4 @@
-/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_IMPLEMENTATION
@@ -427,7 +427,8 @@ mysql_declare_plugin(blackhole)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(blackhole)
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index 17066b6edce..a7efd261ddb 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -1,4 +1,4 @@
-/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index d53f33945fa..719c7b10069 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Make sure to look at ha_tina.h for more details.
@@ -1781,7 +1781,8 @@ mysql_declare_plugin(csv)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(csv)
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index a2f12443528..837da613171 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/storage/csv/transparent_file.cc b/storage/csv/transparent_file.cc
index f92746c7b93..a307f9885c0 100644
--- a/storage/csv/transparent_file.cc
+++ b/storage/csv/transparent_file.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
diff --git a/storage/csv/transparent_file.h b/storage/csv/transparent_file.h
index 0168e271e7d..2536ad16a0f 100644
--- a/storage/csv/transparent_file.h
+++ b/storage/csv/transparent_file.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index bea8b4fb9c4..8566b013851 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file ha_example.cc
@@ -1122,7 +1122,8 @@ mysql_declare_plugin(example)
0x0001 /* 0.1 */,
func_status, /* status variables */
example_system_variables, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(example)
diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h
index 27b97395544..08af1922662 100644
--- a/storage/example/ha_example.h
+++ b/storage/example/ha_example.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/** @file ha_example.h
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 48b88060a69..b083900e7b7 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
@@ -3469,7 +3469,8 @@ mysql_declare_plugin(federated)
0x0100 /* 1.0 */,
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(federated)
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index ad74521042e..796eabf2f2d 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Please read ha_exmple.cc before reading this file.
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index c07ec92eac8..80d6b103e4c 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -3593,22 +3593,6 @@ int ha_federatedx::rollback(handlerton *hton, MYSQL_THD thd, bool all)
struct st_mysql_storage_engine federatedx_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
-mysql_declare_plugin(federatedx)
-{
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &federatedx_storage_engine,
- "FEDERATED",
- "Patrick Galbraith",
- "FederatedX pluggable storage engine",
- PLUGIN_LICENSE_GPL,
- federatedx_db_init, /* Plugin Init */
- federatedx_done, /* Plugin Deinit */
- 0x0200 /* 2.0 */,
- NULL, /* status variables */
- NULL, /* system variables */
- NULL /* config options */
-}
-mysql_declare_plugin_end;
maria_declare_plugin(federatedx)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 7c5fc133679..cf18ee29ee1 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_IMPLEMENTATION
@@ -399,6 +400,7 @@ int ha_heap::info(uint flag)
stats.index_file_length= hp_info.index_length;
stats.max_data_file_length= hp_info.max_records * hp_info.reclength;
stats.delete_length= hp_info.deleted * hp_info.reclength;
+ stats.create_time= (ulong) hp_info.create_time;
if (flag & HA_STATUS_AUTO)
stats.auto_increment_value= hp_info.auto_increment;
/*
@@ -814,7 +816,8 @@ mysql_declare_plugin(heap)
0x0100, /* 1.0 */
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(heap)
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index 42c41c69ee0..4b4e0d44d99 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -1,4 +1,6 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2009-2011 Monty Program Ab
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h
index 87866678c2f..e844f90d321 100644
--- a/storage/heap/heapdef.h
+++ b/storage/heap/heapdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is included in all heap-files */
diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c
index 41391fba060..90efeeb7924 100644
--- a/storage/heap/hp_block.c
+++ b/storage/heap/hp_block.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002, 2004 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* functions on blocks; Keys and records are saved in blocks */
diff --git a/storage/heap/hp_clear.c b/storage/heap/hp_clear.c
index 254e5d1a8ec..2b1502e6475 100644
--- a/storage/heap/hp_clear.c
+++ b/storage/heap/hp_clear.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2002, 2004, 2006 MySQL AB
+/* Copyright (c) 2000-2002, 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
remove all records from database
diff --git a/storage/heap/hp_close.c b/storage/heap/hp_close.c
index e5a826423db..52663fdaa00 100644
--- a/storage/heap/hp_close.c
+++ b/storage/heap/hp_close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* close a heap-database */
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index adc507aa28e..5ec38955664 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "heapdef.h"
@@ -198,6 +198,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
share->auto_key= create_info->auto_key;
share->auto_key_type= create_info->auto_key_type;
share->auto_increment= create_info->auto_increment;
+ share->create_time= (long) time((time_t*) 0);
/* Must be allocated separately for rename to work */
if (!(share->name= my_strdup(name,MYF(0))))
{
diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c
index fb9ea44a424..424b1de0869 100644
--- a/storage/heap/hp_hash.c
+++ b/storage/heap/hp_hash.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* The hash functions used for saveing keys */
diff --git a/storage/heap/hp_info.c b/storage/heap/hp_info.c
index ea78c53fd40..c72dbaf2065 100644
--- a/storage/heap/hp_info.c
+++ b/storage/heap/hp_info.c
@@ -53,6 +53,7 @@ int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x, int flag )
x->index_length = info->s->index_length;
x->max_records = info->s->max_records;
x->errkey = info->errkey;
+ x->create_time = info->s->create_time;
if (flag & HA_STATUS_AUTO)
x->auto_increment= info->s->auto_increment + 1;
DBUG_RETURN(0);
diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c
index 5ac4da22e0a..c456dbdfc84 100644
--- a/storage/heap/hp_open.c
+++ b/storage/heap/hp_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004, 2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* open a heap-database */
diff --git a/storage/heap/hp_panic.c b/storage/heap/hp_panic.c
index 87d982dff2a..e1e421a5115 100644
--- a/storage/heap/hp_panic.c
+++ b/storage/heap/hp_panic.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2002 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2002, 2005, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "heapdef.h"
diff --git a/storage/heap/hp_rename.c b/storage/heap/hp_rename.c
index cf0d2b2b387..34c8218e387 100644
--- a/storage/heap/hp_rename.c
+++ b/storage/heap/hp_rename.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Rename a table
diff --git a/storage/heap/hp_rkey.c b/storage/heap/hp_rkey.c
index 166ed28aed0..d0cbb94eb0e 100644
--- a/storage/heap/hp_rkey.c
+++ b/storage/heap/hp_rkey.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2004, 2006 MySQL AB
+/* Copyright (c) 2000, 2002-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "heapdef.h"
diff --git a/storage/heap/hp_static.c b/storage/heap/hp_static.c
index a58ecb8b754..c50465cd402 100644
--- a/storage/heap/hp_static.c
+++ b/storage/heap/hp_static.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Static variables for heap library. All definied here for easy making of
diff --git a/storage/heap/hp_test1.c b/storage/heap/hp_test1.c
index 535db60e237..e6283f171c4 100644
--- a/storage/heap/hp_test1.c
+++ b/storage/heap/hp_test1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003, 2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Test av heap-database */
/* Programmet skapar en heap-databas. Till denna skrivs ett antal poster.
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index 5dab8443f53..caf7ff4daa9 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) Monty Program Ab
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Test av isam-databas: stor test */
diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c
index bf27503de9b..fc6c31e324b 100644
--- a/storage/heap/hp_write.c
+++ b/storage/heap/hp_write.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2002, 2004-2006 MySQL AB
+/* Copyright (c) 2000-2002, 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Write a record to heap-databas */
diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
index fb2509a62ff..b476167af29 100644
--- a/storage/innobase/btr/btr0btr.c
+++ b/storage/innobase/btr/btr0btr.c
@@ -690,7 +690,8 @@ btr_root_block_get(
zip_size = dict_table_zip_size(index->table);
root_page_no = dict_index_get_page(index);
- block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
+ block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
+ index, mtr);
ut_a((ibool)!!page_is_comp(buf_block_get_frame(block))
== dict_table_is_comp(index->table));
#ifdef UNIV_BTR_DEBUG
@@ -891,7 +892,7 @@ btr_page_alloc_for_ibuf(
dict_table_zip_size(index->table),
node_addr.page, RW_X_LATCH, mtr);
new_page = buf_block_get_frame(new_block);
- buf_block_dbg_add_level(new_block, SYNC_TREE_NODE_NEW);
+ buf_block_dbg_add_level(new_block, SYNC_IBUF_TREE_NODE_NEW);
flst_remove(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
new_page + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST_NODE,
@@ -1139,7 +1140,7 @@ btr_node_ptr_get_child(
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
return(btr_block_get(space, dict_table_zip_size(index->table),
- page_no, RW_X_LATCH, mtr));
+ page_no, RW_X_LATCH, index, mtr));
}
/************************************************************//**
@@ -1312,7 +1313,8 @@ btr_create(
space, 0,
IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
- buf_block_dbg_add_level(ibuf_hdr_block, SYNC_TREE_NODE_NEW);
+ buf_block_dbg_add_level(
+ ibuf_hdr_block, SYNC_IBUF_TREE_NODE_NEW);
ut_ad(buf_block_get_page_no(ibuf_hdr_block)
== IBUF_HEADER_PAGE_NO);
@@ -1350,10 +1352,9 @@ btr_create(
page_no = buf_block_get_page_no(block);
frame = buf_block_get_frame(block);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
-
if (type & DICT_IBUF) {
/* It is an insert buffer tree: initialize the free list */
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
ut_ad(page_no == IBUF_TREE_ROOT_PAGE_NO);
@@ -1361,6 +1362,8 @@ btr_create(
} else {
/* It is a non-ibuf tree: create a file segment for leaf
pages */
+ buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
+
if (!fseg_create(space, page_no,
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
/* Not enough space for new segment, free root
@@ -1432,7 +1435,8 @@ btr_free_but_not_root(
leaf_loop:
mtr_start(&mtr);
- root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
+ root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
+ NULL, &mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
+ root, space));
@@ -1454,7 +1458,8 @@ leaf_loop:
top_loop:
mtr_start(&mtr);
- root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
+ root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
+ NULL, &mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
+ root, space));
@@ -1480,13 +1485,13 @@ btr_free_root(
ulint zip_size, /*!< in: compressed page size in bytes
or 0 for uncompressed pages */
ulint root_page_no, /*!< in: root page number */
- mtr_t* mtr) /*!< in: a mini-transaction which has already
- been started */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
buf_block_t* block;
fseg_header_t* header;
- block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
+ block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
+ NULL, mtr);
btr_search_drop_page_hash_index(block);
@@ -2365,9 +2370,8 @@ btr_attach_half_pages(
/* Update page links of the level */
if (prev_page_no != FIL_NULL) {
- buf_block_t* prev_block = btr_block_get(space, zip_size,
- prev_page_no,
- RW_X_LATCH, mtr);
+ buf_block_t* prev_block = btr_block_get(
+ space, zip_size, prev_page_no, RW_X_LATCH, index, mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(prev_block->frame) == page_is_comp(page));
ut_a(btr_page_get_next(prev_block->frame, mtr)
@@ -2380,9 +2384,8 @@ btr_attach_half_pages(
}
if (next_page_no != FIL_NULL) {
- buf_block_t* next_block = btr_block_get(space, zip_size,
- next_page_no,
- RW_X_LATCH, mtr);
+ buf_block_t* next_block = btr_block_get(
+ space, zip_size, next_page_no, RW_X_LATCH, index, mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(next_block->frame) == page_is_comp(page));
ut_a(btr_page_get_prev(next_block->frame, mtr)
@@ -2804,17 +2807,42 @@ func_exit:
return(rec);
}
+#ifdef UNIV_SYNC_DEBUG
+/*************************************************************//**
+Removes a page from the level list of pages.
+@param space in: space where removed
+@param zip_size in: compressed page size in bytes, or 0 for uncompressed
+@param page in/out: page to remove
+@param index in: index tree
+@param mtr in/out: mini-transaction */
+# define btr_level_list_remove(space,zip_size,page,index,mtr) \
+ btr_level_list_remove_func(space,zip_size,page,index,mtr)
+#else /* UNIV_SYNC_DEBUG */
+/*************************************************************//**
+Removes a page from the level list of pages.
+@param space in: space where removed
+@param zip_size in: compressed page size in bytes, or 0 for uncompressed
+@param page in/out: page to remove
+@param index in: index tree
+@param mtr in/out: mini-transaction */
+# define btr_level_list_remove(space,zip_size,page,index,mtr) \
+ btr_level_list_remove_func(space,zip_size,page,mtr)
+#endif /* UNIV_SYNC_DEBUG */
+
/*************************************************************//**
Removes a page from the level list of pages. */
-static
+static __attribute__((nonnull))
void
-btr_level_list_remove(
-/*==================*/
- ulint space, /*!< in: space where removed */
- ulint zip_size,/*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- page_t* page, /*!< in: page to remove */
- mtr_t* mtr) /*!< in: mtr */
+btr_level_list_remove_func(
+/*=======================*/
+ ulint space, /*!< in: space where removed */
+ ulint zip_size,/*!< in: compressed page size in bytes
+ or 0 for uncompressed pages */
+ page_t* page, /*!< in/out: page to remove */
+#ifdef UNIV_SYNC_DEBUG
+ const dict_index_t* index, /*!< in: index tree */
+#endif /* UNIV_SYNC_DEBUG */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
ulint prev_page_no;
ulint next_page_no;
@@ -2832,7 +2860,7 @@ btr_level_list_remove(
if (prev_page_no != FIL_NULL) {
buf_block_t* prev_block
= btr_block_get(space, zip_size, prev_page_no,
- RW_X_LATCH, mtr);
+ RW_X_LATCH, index, mtr);
page_t* prev_page
= buf_block_get_frame(prev_block);
#ifdef UNIV_BTR_DEBUG
@@ -2849,7 +2877,7 @@ btr_level_list_remove(
if (next_page_no != FIL_NULL) {
buf_block_t* next_block
= btr_block_get(space, zip_size, next_page_no,
- RW_X_LATCH, mtr);
+ RW_X_LATCH, index, mtr);
page_t* next_page
= buf_block_get_frame(next_block);
#ifdef UNIV_BTR_DEBUG
@@ -3164,7 +3192,7 @@ btr_compress(
if (is_left) {
merge_block = btr_block_get(space, zip_size, left_page_no,
- RW_X_LATCH, mtr);
+ RW_X_LATCH, index, mtr);
merge_page = buf_block_get_frame(merge_block);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_page_get_next(merge_page, mtr)
@@ -3173,7 +3201,7 @@ btr_compress(
} else if (right_page_no != FIL_NULL) {
merge_block = btr_block_get(space, zip_size, right_page_no,
- RW_X_LATCH, mtr);
+ RW_X_LATCH, index, mtr);
merge_page = buf_block_get_frame(merge_block);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_page_get_prev(merge_page, mtr)
@@ -3262,7 +3290,7 @@ err_exit:
btr_search_drop_page_hash_index(block);
/* Remove the page from the level list */
- btr_level_list_remove(space, zip_size, page, mtr);
+ btr_level_list_remove(space, zip_size, page, index, mtr);
btr_node_ptr_delete(index, block, mtr);
lock_update_merge_left(merge_block, orig_pred, block);
@@ -3315,7 +3343,7 @@ err_exit:
#endif /* UNIV_BTR_DEBUG */
/* Remove the page from the level list */
- btr_level_list_remove(space, zip_size, page, mtr);
+ btr_level_list_remove(space, zip_size, page, index, mtr);
/* Replace the address of the old child node (= page) with the
address of the merge page to the right */
@@ -3498,7 +3526,7 @@ btr_discard_page(
if (left_page_no != FIL_NULL) {
merge_block = btr_block_get(space, zip_size, left_page_no,
- RW_X_LATCH, mtr);
+ RW_X_LATCH, index, mtr);
merge_page = buf_block_get_frame(merge_block);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_page_get_next(merge_page, mtr)
@@ -3506,7 +3534,7 @@ btr_discard_page(
#endif /* UNIV_BTR_DEBUG */
} else if (right_page_no != FIL_NULL) {
merge_block = btr_block_get(space, zip_size, right_page_no,
- RW_X_LATCH, mtr);
+ RW_X_LATCH, index, mtr);
merge_page = buf_block_get_frame(merge_block);
#ifdef UNIV_BTR_DEBUG
ut_a(btr_page_get_prev(merge_page, mtr)
@@ -3541,7 +3569,7 @@ btr_discard_page(
btr_node_ptr_delete(index, block, mtr);
/* Remove the page from the level list */
- btr_level_list_remove(space, zip_size, page, mtr);
+ btr_level_list_remove(space, zip_size, page, index, mtr);
#ifdef UNIV_ZIP_DEBUG
{
page_zip_des_t* merge_page_zip
@@ -4059,7 +4087,7 @@ loop:
if (right_page_no != FIL_NULL) {
const rec_t* right_rec;
right_block = btr_block_get(space, zip_size, right_page_no,
- RW_X_LATCH, &mtr);
+ RW_X_LATCH, index, &mtr);
right_page = buf_block_get_frame(right_block);
if (UNIV_UNLIKELY(btr_page_get_prev(right_page, &mtr)
!= page_get_page_no(page))) {
@@ -4285,7 +4313,7 @@ node_ptr_fails:
mtr_start(&mtr);
block = btr_block_get(space, zip_size, right_page_no,
- RW_X_LATCH, &mtr);
+ RW_X_LATCH, index, &mtr);
page = buf_block_get_frame(block);
goto loop;
diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
index 69dd1e428e1..f63ca20ef24 100644
--- a/storage/innobase/btr/btr0cur.c
+++ b/storage/innobase/btr/btr0cur.c
@@ -249,7 +249,8 @@ btr_cur_latch_leaves(
case BTR_SEARCH_LEAF:
case BTR_MODIFY_LEAF:
mode = latch_mode == BTR_SEARCH_LEAF ? RW_S_LATCH : RW_X_LATCH;
- get_block = btr_block_get(space, zip_size, page_no, mode, mtr);
+ get_block = btr_block_get(
+ space, zip_size, page_no, mode, cursor->index, mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
#endif /* UNIV_BTR_DEBUG */
@@ -260,9 +261,9 @@ btr_cur_latch_leaves(
left_page_no = btr_page_get_prev(page, mtr);
if (left_page_no != FIL_NULL) {
- get_block = btr_block_get(space, zip_size,
- left_page_no,
- RW_X_LATCH, mtr);
+ get_block = btr_block_get(
+ space, zip_size, left_page_no,
+ RW_X_LATCH, cursor->index, mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame)
== page_is_comp(page));
@@ -272,8 +273,9 @@ btr_cur_latch_leaves(
get_block->check_index_page_at_flush = TRUE;
}
- get_block = btr_block_get(space, zip_size, page_no,
- RW_X_LATCH, mtr);
+ get_block = btr_block_get(
+ space, zip_size, page_no,
+ RW_X_LATCH, cursor->index, mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
#endif /* UNIV_BTR_DEBUG */
@@ -282,9 +284,9 @@ btr_cur_latch_leaves(
right_page_no = btr_page_get_next(page, mtr);
if (right_page_no != FIL_NULL) {
- get_block = btr_block_get(space, zip_size,
- right_page_no,
- RW_X_LATCH, mtr);
+ get_block = btr_block_get(
+ space, zip_size, right_page_no,
+ RW_X_LATCH, cursor->index, mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame)
== page_is_comp(page));
@@ -303,8 +305,9 @@ btr_cur_latch_leaves(
left_page_no = btr_page_get_prev(page, mtr);
if (left_page_no != FIL_NULL) {
- get_block = btr_block_get(space, zip_size,
- left_page_no, mode, mtr);
+ get_block = btr_block_get(
+ space, zip_size,
+ left_page_no, mode, cursor->index, mtr);
cursor->left_block = get_block;
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame)
@@ -315,7 +318,8 @@ btr_cur_latch_leaves(
get_block->check_index_page_at_flush = TRUE;
}
- get_block = btr_block_get(space, zip_size, page_no, mode, mtr);
+ get_block = btr_block_get(
+ space, zip_size, page_no, mode, cursor->index, mtr);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
#endif /* UNIV_BTR_DEBUG */
@@ -669,7 +673,9 @@ retry_page_get:
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_ZIP_DEBUG */
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ buf_block_dbg_add_level(
+ block, dict_index_is_ibuf(index)
+ ? SYNC_IBUF_TREE_NODE : SYNC_TREE_NODE);
}
ut_ad(index->id == btr_page_get_index_id(page));
@@ -767,7 +773,7 @@ retry_page_get:
if (level != 0) {
/* x-latch the page */
page = btr_page_get(
- space, zip_size, page_no, RW_X_LATCH, mtr);
+ space, zip_size, page_no, RW_X_LATCH, index, mtr);
ut_a((ibool)!!page_is_comp(page)
== dict_table_is_comp(index->table));
@@ -1839,6 +1845,7 @@ btr_cur_update_in_place(
roll_ptr_t roll_ptr = 0;
trx_t* trx;
ulint was_delete_marked;
+ ibool is_hashed;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
@@ -1880,7 +1887,21 @@ btr_cur_update_in_place(
return(err);
}
- if (block->is_hashed) {
+ if (!(flags & BTR_KEEP_SYS_FLAG)) {
+ row_upd_rec_sys_fields(rec, NULL,
+ index, offsets, trx, roll_ptr);
+ }
+
+ was_delete_marked = rec_get_deleted_flag(
+ rec, page_is_comp(buf_block_get_frame(block)));
+
+ is_hashed = block->is_hashed;
+
+ if (is_hashed) {
+ /* TO DO: Can we skip this if none of the fields
+ index->search_info->curr_n_fields
+ are being updated? */
+
/* The function row_upd_changes_ord_field_binary works only
if the update vector was built for a clustered index, we must
NOT call it if index is secondary */
@@ -1896,17 +1917,9 @@ btr_cur_update_in_place(
rw_lock_x_lock(&btr_search_latch);
}
- if (!(flags & BTR_KEEP_SYS_FLAG)) {
- row_upd_rec_sys_fields(rec, NULL,
- index, offsets, trx, roll_ptr);
- }
-
- was_delete_marked = rec_get_deleted_flag(
- rec, page_is_comp(buf_block_get_frame(block)));
-
row_upd_rec_in_place(rec, index, offsets, update, page_zip);
- if (block->is_hashed) {
+ if (is_hashed) {
rw_lock_x_unlock(&btr_search_latch);
}
@@ -2607,7 +2620,8 @@ btr_cur_parse_del_mark_set_clust_rec(
/* We do not need to reserve btr_search_latch, as the page
is only being recovered, and there cannot be a hash index to
- it. */
+ it. Besides, these fields are being updated in place
+ and the adaptive hash index does not depend on them. */
btr_rec_set_deleted_flag(rec, page_zip, val);
@@ -2687,9 +2701,9 @@ btr_cur_del_mark_set_clust_rec(
return(err);
}
- if (block->is_hashed) {
- rw_lock_x_lock(&btr_search_latch);
- }
+ /* The btr_search_latch is not needed here, because
+ the adaptive hash index does not depend on the delete-mark
+ and the delete-mark is being updated in place. */
page_zip = buf_block_get_page_zip(block);
@@ -2703,10 +2717,6 @@ btr_cur_del_mark_set_clust_rec(
index, offsets, trx, roll_ptr);
}
- if (block->is_hashed) {
- rw_lock_x_unlock(&btr_search_latch);
- }
-
btr_cur_del_mark_set_clust_rec_log(flags, rec, index, val, trx,
roll_ptr, mtr);
@@ -2782,7 +2792,8 @@ btr_cur_parse_del_mark_set_sec_rec(
/* We do not need to reserve btr_search_latch, as the page
is only being recovered, and there cannot be a hash index to
- it. */
+ it. Besides, the delete-mark flag is being updated in place
+ and the adaptive hash index does not depend on it. */
btr_rec_set_deleted_flag(rec, page_zip, val);
}
@@ -2830,16 +2841,11 @@ btr_cur_del_mark_set_sec_rec(
ut_ad(!!page_rec_is_comp(rec)
== dict_table_is_comp(cursor->index->table));
- if (block->is_hashed) {
- rw_lock_x_lock(&btr_search_latch);
- }
-
+ /* We do not need to reserve btr_search_latch, as the
+ delete-mark flag is being updated in place and the adaptive
+ hash index does not depend on it. */
btr_rec_set_deleted_flag(rec, buf_block_get_page_zip(block), val);
- if (block->is_hashed) {
- rw_lock_x_unlock(&btr_search_latch);
- }
-
btr_cur_del_mark_set_sec_rec_log(rec, val, mtr);
return(DB_SUCCESS);
@@ -2860,8 +2866,11 @@ btr_cur_set_deleted_flag_for_ibuf(
ibool val, /*!< in: value to set */
mtr_t* mtr) /*!< in: mtr */
{
- /* We do not need to reserve btr_search_latch, as the page has just
- been read to the buffer pool and there cannot be a hash index to it. */
+ /* We do not need to reserve btr_search_latch, as the page
+ has just been read to the buffer pool and there cannot be
+ a hash index to it. Besides, the delete-mark flag is being
+ updated in place and the adaptive hash index does not depend
+ on it. */
btr_rec_set_deleted_flag(rec, page_zip, val);
@@ -3515,7 +3524,6 @@ static
void
btr_record_not_null_field_in_rec(
/*=============================*/
- rec_t* rec, /*!< in: physical record */
ulint n_unique, /*!< in: dict_index_get_n_unique(index),
number of columns uniquely determine
an index entry */
@@ -3535,9 +3543,8 @@ btr_record_not_null_field_in_rec(
for (i = 0; i < n_unique; i++) {
ulint rec_len;
- byte* field;
- field = rec_get_nth_field(rec, offsets, i, &rec_len);
+ rec_get_nth_field_offs(offsets, i, &rec_len);
if (rec_len != UNIV_SQL_NULL) {
n_not_null[i]++;
@@ -3652,7 +3659,7 @@ btr_estimate_number_of_different_key_vals(
if (n_not_null) {
btr_record_not_null_field_in_rec(
- rec, n_cols, offsets_rec, n_not_null);
+ n_cols, offsets_rec, n_not_null);
}
}
@@ -3687,7 +3694,7 @@ btr_estimate_number_of_different_key_vals(
if (n_not_null) {
btr_record_not_null_field_in_rec(
- next_rec, n_cols, offsets_next_rec,
+ n_cols, offsets_next_rec,
n_not_null);
}
@@ -4095,7 +4102,7 @@ btr_blob_free(
&& buf_block_get_space(block) == space
&& buf_block_get_page_no(block) == page_no) {
- if (buf_LRU_free_block(&block->page, all) != BUF_LRU_FREED
+ if (!buf_LRU_free_block(&block->page, all)
&& all && block->page.zip.data) {
/* Attempt to deallocate the uncompressed page
if the whole block cannot be deallocted. */
diff --git a/storage/innobase/btr/btr0pcur.c b/storage/innobase/btr/btr0pcur.c
index 056896c7927..cbb0d21a7ed 100644
--- a/storage/innobase/btr/btr0pcur.c
+++ b/storage/innobase/btr/btr0pcur.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -266,8 +266,10 @@ btr_pcur_restore_position_func(
file, line, mtr))) {
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
- buf_block_dbg_add_level(btr_pcur_get_block(cursor),
- SYNC_TREE_NODE);
+ buf_block_dbg_add_level(
+ btr_pcur_get_block(cursor),
+ dict_index_is_ibuf(index)
+ ? SYNC_IBUF_TREE_NODE : SYNC_TREE_NODE);
if (cursor->rel_pos == BTR_PCUR_ON) {
#ifdef UNIV_DEBUG
@@ -356,33 +358,6 @@ btr_pcur_restore_position_func(
return(FALSE);
}
-/**************************************************************//**
-If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
-releases the page latch and bufferfix reserved by the cursor.
-NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
-made by the current mini-transaction to the data protected by the
-cursor latch, as then the latch must not be released until mtr_commit. */
-UNIV_INTERN
-void
-btr_pcur_release_leaf(
-/*==================*/
- btr_pcur_t* cursor, /*!< in: persistent cursor */
- mtr_t* mtr) /*!< in: mtr */
-{
- buf_block_t* block;
-
- ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
- ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
-
- block = btr_pcur_get_block(cursor);
-
- btr_leaf_page_release(block, cursor->latch_mode, mtr);
-
- cursor->latch_mode = BTR_NO_LATCHES;
-
- cursor->pos_state = BTR_PCUR_WAS_POSITIONED;
-}
-
/*********************************************************//**
Moves the persistent cursor to the first record on the next page. Releases the
latch on the current page, and bufferunfixes it. Note that there must not be
@@ -417,7 +392,8 @@ btr_pcur_move_to_next_page(
ut_ad(next_page_no != FIL_NULL);
next_block = btr_block_get(space, zip_size, next_page_no,
- cursor->latch_mode, mtr);
+ cursor->latch_mode,
+ btr_pcur_get_btr_cur(cursor)->index, mtr);
next_page = buf_block_get_frame(next_block);
#ifdef UNIV_BTR_DEBUG
ut_a(page_is_comp(next_page) == page_is_comp(page));
diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
index 93573a300e4..7070420425c 100644
--- a/storage/innobase/btr/btr0sea.c
+++ b/storage/innobase/btr/btr0sea.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -845,6 +845,7 @@ btr_search_guess_on_hash(
btr_pcur_t pcur;
#endif
ut_ad(index && info && tuple && cursor && mtr);
+ ut_ad(!dict_index_is_ibuf(index));
ut_ad((latch_mode == BTR_SEARCH_LEAF)
|| (latch_mode == BTR_MODIFY_LEAF));
diff --git a/storage/innobase/buf/buf0buddy.c b/storage/innobase/buf/buf0buddy.c
index 75ba832c7e5..30c31dd71a0 100644
--- a/storage/innobase/buf/buf0buddy.c
+++ b/storage/innobase/buf/buf0buddy.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2006, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -56,6 +56,14 @@ buf_buddy_get(
}
}
+/** Validate a given zip_free list. */
+#define BUF_BUDDY_LIST_VALIDATE(b, i) \
+ UT_LIST_VALIDATE(list, buf_page_t, \
+ b->zip_free[i], \
+ ut_ad(buf_page_get_state( \
+ ut_list_node_313) \
+ == BUF_BLOCK_ZIP_FREE))
+
/**********************************************************************//**
Add a block to the head of the appropriate buddy free list. */
UNIV_INLINE
@@ -67,21 +75,10 @@ buf_buddy_add_to_free(
ulint i) /*!< in: index of
buf_pool->zip_free[] */
{
-#ifdef UNIV_DEBUG_VALGRIND
- buf_page_t* b = UT_LIST_GET_FIRST(buf_pool->zip_free[i]);
-
- if (b) UNIV_MEM_VALID(b, BUF_BUDDY_LOW << i);
-#endif /* UNIV_DEBUG_VALGRIND */
-
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_FREE);
ut_ad(buf_pool->zip_free[i].start != bpage);
UT_LIST_ADD_FIRST(list, buf_pool->zip_free[i], bpage);
-
-#ifdef UNIV_DEBUG_VALGRIND
- if (b) UNIV_MEM_FREE(b, BUF_BUDDY_LOW << i);
- UNIV_MEM_ASSERT_AND_FREE(bpage, BUF_BUDDY_LOW << i);
-#endif /* UNIV_DEBUG_VALGRIND */
}
/**********************************************************************//**
@@ -95,25 +92,17 @@ buf_buddy_remove_from_free(
ulint i) /*!< in: index of
buf_pool->zip_free[] */
{
-#ifdef UNIV_DEBUG_VALGRIND
+#ifdef UNIV_DEBUG
buf_page_t* prev = UT_LIST_GET_PREV(list, bpage);
buf_page_t* next = UT_LIST_GET_NEXT(list, bpage);
- if (prev) UNIV_MEM_VALID(prev, BUF_BUDDY_LOW << i);
- if (next) UNIV_MEM_VALID(next, BUF_BUDDY_LOW << i);
-
ut_ad(!prev || buf_page_get_state(prev) == BUF_BLOCK_ZIP_FREE);
ut_ad(!next || buf_page_get_state(next) == BUF_BLOCK_ZIP_FREE);
-#endif /* UNIV_DEBUG_VALGRIND */
+#endif /* UNIV_DEBUG */
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_FREE);
UT_LIST_REMOVE(list, buf_pool->zip_free[i], bpage);
-
-#ifdef UNIV_DEBUG_VALGRIND
- if (prev) UNIV_MEM_FREE(prev, BUF_BUDDY_LOW << i);
- if (next) UNIV_MEM_FREE(next, BUF_BUDDY_LOW << i);
-#endif /* UNIV_DEBUG_VALGRIND */
}
/**********************************************************************//**
@@ -130,17 +119,13 @@ buf_buddy_alloc_zip(
ut_ad(buf_pool_mutex_own(buf_pool));
ut_a(i < BUF_BUDDY_SIZES);
+ ut_a(i >= buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE));
+
+ ut_d(BUF_BUDDY_LIST_VALIDATE(buf_pool, i));
-#ifndef UNIV_DEBUG_VALGRIND
- /* Valgrind would complain about accessing free memory. */
- ut_d(UT_LIST_VALIDATE(list, buf_page_t, buf_pool->zip_free[i],
- ut_ad(buf_page_get_state(ut_list_node_313)
- == BUF_BLOCK_ZIP_FREE)));
-#endif /* !UNIV_DEBUG_VALGRIND */
bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]);
if (bpage) {
- UNIV_MEM_VALID(bpage, BUF_BUDDY_LOW << i);
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_FREE);
buf_buddy_remove_from_free(buf_pool, bpage, i);
@@ -159,13 +144,10 @@ buf_buddy_alloc_zip(
}
}
-#ifdef UNIV_DEBUG
if (bpage) {
- memset(bpage, ~i, BUF_BUDDY_LOW << i);
+ ut_d(memset(bpage, ~i, BUF_BUDDY_LOW << i));
+ UNIV_MEM_ALLOC(bpage, BUF_BUDDY_SIZES << i);
}
-#endif /* UNIV_DEBUG */
-
- UNIV_MEM_ALLOC(bpage, BUF_BUDDY_SIZES << i);
return(bpage);
}
@@ -253,6 +235,7 @@ buf_buddy_alloc_from(
{
ulint offs = BUF_BUDDY_LOW << j;
ut_ad(j <= BUF_BUDDY_SIZES);
+ ut_ad(i >= buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE));
ut_ad(j >= i);
ut_ad(!ut_align_offset(buf, offs));
@@ -266,13 +249,7 @@ buf_buddy_alloc_from(
bpage = (buf_page_t*) ((byte*) buf + offs);
ut_d(memset(bpage, j, BUF_BUDDY_LOW << j));
bpage->state = BUF_BLOCK_ZIP_FREE;
-#ifndef UNIV_DEBUG_VALGRIND
- /* Valgrind would complain about accessing free memory. */
- ut_d(UT_LIST_VALIDATE(list, buf_page_t, buf_pool->zip_free[i],
- ut_ad(buf_page_get_state(
- ut_list_node_313)
- == BUF_BLOCK_ZIP_FREE)));
-#endif /* !UNIV_DEBUG_VALGRIND */
+ ut_d(BUF_BUDDY_LIST_VALIDATE(buf_pool, i));
buf_buddy_add_to_free(buf_pool, bpage, j);
}
@@ -282,26 +259,27 @@ buf_buddy_alloc_from(
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
buf_pool->mutex and must not hold buf_pool->zip_mutex or any block->mutex.
-The buf_pool->mutex may only be released and reacquired if lru != NULL.
-@return allocated block, possibly NULL if lru==NULL */
+The buf_pool_mutex may be released and reacquired.
+@return allocated block, never NULL */
UNIV_INTERN
void*
buf_buddy_alloc_low(
/*================*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
ulint i, /*!< in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
ibool* lru) /*!< in: pointer to a variable that
will be assigned TRUE if storage was
allocated from the LRU list and
buf_pool->mutex was temporarily
- released, or NULL if the LRU list
- should not be used */
+ released */
{
buf_block_t* block;
+ ut_ad(lru);
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex));
+ ut_ad(i >= buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE));
if (i < BUF_BUDDY_SIZES) {
/* Try to allocate from the buddy system. */
@@ -320,11 +298,6 @@ buf_buddy_alloc_low(
goto alloc_big;
}
- if (!lru) {
-
- return(NULL);
- }
-
/* Try replacing an uncompressed page in the buffer pool. */
buf_pool_mutex_exit(buf_pool);
block = buf_LRU_get_free_block(buf_pool);
@@ -343,63 +316,6 @@ func_exit:
}
/**********************************************************************//**
-Try to relocate the control block of a compressed page.
-@return TRUE if relocated */
-static
-ibool
-buf_buddy_relocate_block(
-/*=====================*/
- buf_page_t* bpage, /*!< in: block to relocate */
- buf_page_t* dpage) /*!< in: free block to relocate to */
-{
- buf_page_t* b;
- buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
-
- ut_ad(buf_pool_mutex_own(buf_pool));
-
- switch (buf_page_get_state(bpage)) {
- case BUF_BLOCK_ZIP_FREE:
- case BUF_BLOCK_NOT_USED:
- case BUF_BLOCK_READY_FOR_USE:
- case BUF_BLOCK_FILE_PAGE:
- case BUF_BLOCK_MEMORY:
- case BUF_BLOCK_REMOVE_HASH:
- ut_error;
- case BUF_BLOCK_ZIP_DIRTY:
- /* Cannot relocate dirty pages. */
- return(FALSE);
-
- case BUF_BLOCK_ZIP_PAGE:
- break;
- }
-
- mutex_enter(&buf_pool->zip_mutex);
-
- if (!buf_page_can_relocate(bpage)) {
- mutex_exit(&buf_pool->zip_mutex);
- return(FALSE);
- }
-
- buf_relocate(bpage, dpage);
- ut_d(bpage->state = BUF_BLOCK_ZIP_FREE);
-
- /* relocate buf_pool->zip_clean */
- b = UT_LIST_GET_PREV(list, dpage);
- UT_LIST_REMOVE(list, buf_pool->zip_clean, dpage);
-
- if (b) {
- UT_LIST_INSERT_AFTER(list, buf_pool->zip_clean, b, dpage);
- } else {
- UT_LIST_ADD_FIRST(list, buf_pool->zip_clean, dpage);
- }
-
- UNIV_MEM_INVALID(bpage, sizeof *bpage);
-
- mutex_exit(&buf_pool->zip_mutex);
- return(TRUE);
-}
-
-/**********************************************************************//**
Try to relocate a block.
@return TRUE if relocated */
static
@@ -414,109 +330,89 @@ buf_buddy_relocate(
{
buf_page_t* bpage;
const ulint size = BUF_BUDDY_LOW << i;
- ullint usec = ut_time_us(NULL);
+ mutex_t* mutex;
+ ulint space;
+ ulint page_no;
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_ad(!ut_align_offset(src, size));
ut_ad(!ut_align_offset(dst, size));
+ ut_ad(i >= buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE));
UNIV_MEM_ASSERT_W(dst, size);
/* We assume that all memory from buf_buddy_alloc()
- is used for either compressed pages or buf_page_t
- objects covering compressed pages. */
+ is used for compressed page frames. */
/* We look inside the allocated objects returned by
- buf_buddy_alloc() and assume that anything of
- PAGE_ZIP_MIN_SIZE or larger is a compressed page that contains
- a valid space_id and page_no in the page header. Should the
- fields be invalid, we will be unable to relocate the block.
- We also assume that anything that fits sizeof(buf_page_t)
- actually is a properly initialized buf_page_t object. */
-
- if (size >= PAGE_ZIP_MIN_SIZE) {
- /* This is a compressed page. */
- mutex_t* mutex;
-
- /* The src block may be split into smaller blocks,
- some of which may be free. Thus, the
- mach_read_from_4() calls below may attempt to read
- from free memory. The memory is "owned" by the buddy
- allocator (and it has been allocated from the buffer
- pool), so there is nothing wrong about this. The
- mach_read_from_4() calls here will only trigger bogus
- Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */
- ulint space = mach_read_from_4(
- (const byte*) src + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
- ulint page_no = mach_read_from_4(
- (const byte*) src + FIL_PAGE_OFFSET);
- /* Suppress Valgrind warnings about conditional jump
- on uninitialized value. */
- UNIV_MEM_VALID(&space, sizeof space);
- UNIV_MEM_VALID(&page_no, sizeof page_no);
- bpage = buf_page_hash_get(buf_pool, space, page_no);
-
- if (!bpage || bpage->zip.data != src) {
- /* The block has probably been freshly
- allocated by buf_LRU_get_free_block() but not
- added to buf_pool->page_hash yet. Obviously,
- it cannot be relocated. */
-
- return(FALSE);
- }
+ buf_buddy_alloc() and assume that each block is a compressed
+ page that contains a valid space_id and page_no in the page
+ header. Should the fields be invalid, we will be unable to
+ relocate the block. */
+
+ /* The src block may be split into smaller blocks,
+ some of which may be free. Thus, the
+ mach_read_from_4() calls below may attempt to read
+ from free memory. The memory is "owned" by the buddy
+ allocator (and it has been allocated from the buffer
+ pool), so there is nothing wrong about this. The
+ mach_read_from_4() calls here will only trigger bogus
+ Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */
+ space = mach_read_from_4((const byte *) src
+ + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
+ page_no = mach_read_from_4((const byte *) src
+ + FIL_PAGE_OFFSET);
+ /* Suppress Valgrind warnings about conditional jump
+ on uninitialized value. */
+ UNIV_MEM_VALID(&space, sizeof space);
+ UNIV_MEM_VALID(&page_no, sizeof page_no);
+ bpage = buf_page_hash_get(buf_pool, space, page_no);
+
+ if (!bpage || bpage->zip.data != src) {
+ /* The block has probably been freshly
+ allocated by buf_LRU_get_free_block() but not
+ added to buf_pool->page_hash yet. Obviously,
+ it cannot be relocated. */
- ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage));
+ return(FALSE);
+ }
- if (page_zip_get_size(&bpage->zip) != size) {
- /* The block is of different size. We would
- have to relocate all blocks covered by src.
- For the sake of simplicity, give up. */
- ut_ad(page_zip_get_size(&bpage->zip) < size);
+ if (page_zip_get_size(&bpage->zip) != size) {
+ /* The block is of different size. We would
+ have to relocate all blocks covered by src.
+ For the sake of simplicity, give up. */
+ ut_ad(page_zip_get_size(&bpage->zip) < size);
- return(FALSE);
- }
+ return(FALSE);
+ }
- /* The block must have been allocated, but it may
- contain uninitialized data. */
- UNIV_MEM_ASSERT_W(src, size);
-
- mutex = buf_page_get_mutex(bpage);
-
- mutex_enter(mutex);
-
- if (buf_page_can_relocate(bpage)) {
- /* Relocate the compressed page. */
- ut_a(bpage->zip.data == src);
- memcpy(dst, src, size);
- bpage->zip.data = dst;
- mutex_exit(mutex);
-success:
- UNIV_MEM_INVALID(src, size);
- {
- buf_buddy_stat_t* buddy_stat
- = &buf_pool->buddy_stat[i];
- buddy_stat->relocated++;
- buddy_stat->relocated_usec
- += ut_time_us(NULL) - usec;
- }
- return(TRUE);
- }
+ /* The block must have been allocated, but it may
+ contain uninitialized data. */
+ UNIV_MEM_ASSERT_W(src, size);
- mutex_exit(mutex);
- } else if (i == buf_buddy_get_slot(sizeof(buf_page_t))) {
- /* This must be a buf_page_t object. */
-#if UNIV_WORD_SIZE == 4
- /* On 32-bit systems, there is no padding in
- buf_page_t. On other systems, Valgrind could complain
- about uninitialized pad bytes. */
- UNIV_MEM_ASSERT_RW(src, size);
-#endif
- if (buf_buddy_relocate_block(src, dst)) {
+ mutex = buf_page_get_mutex(bpage);
+
+ mutex_enter(mutex);
- goto success;
+ if (buf_page_can_relocate(bpage)) {
+ /* Relocate the compressed page. */
+ ullint usec = ut_time_us(NULL);
+ ut_a(bpage->zip.data == src);
+ memcpy(dst, src, size);
+ bpage->zip.data = dst;
+ mutex_exit(mutex);
+ UNIV_MEM_INVALID(src, size);
+ {
+ buf_buddy_stat_t* buddy_stat
+ = &buf_pool->buddy_stat[i];
+ buddy_stat->relocated++;
+ buddy_stat->relocated_usec
+ += ut_time_us(NULL) - usec;
}
+ return(TRUE);
}
+ mutex_exit(mutex);
return(FALSE);
}
@@ -538,12 +434,13 @@ buf_buddy_free_low(
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_ad(i <= BUF_BUDDY_SIZES);
+ ut_ad(i >= buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE));
ut_ad(buf_pool->buddy_stat[i].used > 0);
buf_pool->buddy_stat[i].used--;
recombine:
UNIV_MEM_ASSERT_AND_ALLOC(buf, BUF_BUDDY_LOW << i);
- ut_d(((buf_page_t*) buf)->state = BUF_BLOCK_ZIP_FREE);
+ ((buf_page_t*) buf)->state = BUF_BLOCK_ZIP_FREE;
if (i == BUF_BUDDY_SIZES) {
buf_buddy_block_free(buf_pool, buf);
@@ -554,32 +451,36 @@ recombine:
ut_ad(buf == ut_align_down(buf, BUF_BUDDY_LOW << i));
ut_ad(!buf_pool_contains_zip(buf_pool, buf));
- /* Try to combine adjacent blocks. */
+ /* Do not recombine blocks if there are few free blocks.
+ We may waste up to 15360*max_len bytes to free blocks
+ (1024 + 2048 + 4096 + 8192 = 15360) */
+ if (UT_LIST_GET_LEN(buf_pool->zip_free[i]) < 16) {
+ goto func_exit;
+ }
+ /* Try to combine adjacent blocks. */
buddy = (buf_page_t*) buf_buddy_get(((byte*) buf), BUF_BUDDY_LOW << i);
#ifndef UNIV_DEBUG_VALGRIND
- /* Valgrind would complain about accessing free memory. */
+ /* When Valgrind instrumentation is not enabled, we can read
+ buddy->state to quickly determine that a block is not free.
+ When the block is not free, buddy->state belongs to a compressed
+ page frame that may be flagged uninitialized in our Valgrind
+ instrumentation. */
if (buddy->state != BUF_BLOCK_ZIP_FREE) {
goto buddy_nonfree;
}
-
- /* The field buddy->state can only be trusted for free blocks.
- If buddy->state == BUF_BLOCK_ZIP_FREE, the block is free if
- it is in the free list. */
#endif /* !UNIV_DEBUG_VALGRIND */
for (bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]); bpage; ) {
- UNIV_MEM_VALID(bpage, BUF_BUDDY_LOW << i);
ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_ZIP_FREE);
if (bpage == buddy) {
-buddy_free:
/* The buddy is free: recombine */
buf_buddy_remove_from_free(buf_pool, bpage, i);
-buddy_free2:
+buddy_is_free:
ut_ad(buf_page_get_state(buddy) == BUF_BLOCK_ZIP_FREE);
ut_ad(!buf_pool_contains_zip(buf_pool, buddy));
i++;
@@ -589,122 +490,42 @@ buddy_free2:
}
ut_a(bpage != buf);
-
- {
- buf_page_t* next = UT_LIST_GET_NEXT(list, bpage);
- UNIV_MEM_ASSERT_AND_FREE(bpage, BUF_BUDDY_LOW << i);
- bpage = next;
- }
+ UNIV_MEM_ASSERT_W(bpage, BUF_BUDDY_LOW << i);
+ bpage = UT_LIST_GET_NEXT(list, bpage);
}
#ifndef UNIV_DEBUG_VALGRIND
buddy_nonfree:
- /* Valgrind would complain about accessing free memory. */
- ut_d(UT_LIST_VALIDATE(list, buf_page_t, buf_pool->zip_free[i],
- ut_ad(buf_page_get_state(ut_list_node_313)
- == BUF_BLOCK_ZIP_FREE)));
-#endif /* UNIV_DEBUG_VALGRIND */
+#endif /* !UNIV_DEBUG_VALGRIND */
+
+ ut_d(BUF_BUDDY_LIST_VALIDATE(buf_pool, i));
/* The buddy is not free. Is there a free block of this size? */
bpage = UT_LIST_GET_FIRST(buf_pool->zip_free[i]);
if (bpage) {
+
/* Remove the block from the free list, because a successful
buf_buddy_relocate() will overwrite bpage->list. */
-
- UNIV_MEM_VALID(bpage, BUF_BUDDY_LOW << i);
buf_buddy_remove_from_free(buf_pool, bpage, i);
/* Try to relocate the buddy of buf to the free block. */
if (buf_buddy_relocate(buf_pool, buddy, bpage, i)) {
- ut_d(buddy->state = BUF_BLOCK_ZIP_FREE);
- goto buddy_free2;
+ buddy->state = BUF_BLOCK_ZIP_FREE;
+ goto buddy_is_free;
}
buf_buddy_add_to_free(buf_pool, bpage, i);
-
- /* Try to relocate the buddy of the free block to buf. */
- buddy = (buf_page_t*) buf_buddy_get(((byte*) bpage),
- BUF_BUDDY_LOW << i);
-
-#ifndef UNIV_DEBUG_VALGRIND
- /* Valgrind would complain about accessing free memory. */
-
- /* The buddy must not be (completely) free, because we
- always recombine adjacent free blocks.
-
- (Parts of the buddy can be free in
- buf_pool->zip_free[j] with j < i.) */
- ut_d(UT_LIST_VALIDATE(list, buf_page_t, buf_pool->zip_free[i],
- ut_ad(buf_page_get_state(
- ut_list_node_313)
- == BUF_BLOCK_ZIP_FREE
- && ut_list_node_313 != buddy)));
-#endif /* !UNIV_DEBUG_VALGRIND */
-
- if (buf_buddy_relocate(buf_pool, buddy, buf, i)) {
-
- buf = bpage;
- UNIV_MEM_VALID(bpage, BUF_BUDDY_LOW << i);
- ut_d(buddy->state = BUF_BLOCK_ZIP_FREE);
- goto buddy_free;
- }
}
+func_exit:
/* Free the block to the buddy list. */
bpage = buf;
-#ifdef UNIV_DEBUG
- if (i < buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE)) {
- /* This area has most likely been allocated for at
- least one compressed-only block descriptor. Check
- that there are no live objects in the area. This is
- not a complete check: it may yield false positives as
- well as false negatives. Also, due to buddy blocks
- being recombined, it is possible (although unlikely)
- that this branch is never reached. */
-
- char* c;
-
-# ifndef UNIV_DEBUG_VALGRIND
- /* Valgrind would complain about accessing
- uninitialized memory. Besides, Valgrind performs a
- more exhaustive check, at every memory access. */
- const buf_page_t* b = buf;
- const buf_page_t* const b_end = (buf_page_t*)
- ((char*) b + (BUF_BUDDY_LOW << i));
-
- for (; b < b_end; b++) {
- /* Avoid false positives (and cause false
- negatives) by checking for b->space < 1000. */
-
- if ((b->state == BUF_BLOCK_ZIP_PAGE
- || b->state == BUF_BLOCK_ZIP_DIRTY)
- && b->space > 0 && b->space < 1000) {
- fprintf(stderr,
- "buddy dirty %p %u (%u,%u) %p,%lu\n",
- (void*) b,
- b->state, b->space, b->offset,
- buf, i);
- }
- }
-# endif /* !UNIV_DEBUG_VALGRIND */
-
- /* Scramble the block. This should make any pointers
- invalid and trigger a segmentation violation. Because
- the scrambling can be reversed, it may be possible to
- track down the object pointing to the freed data by
- dereferencing the unscrambled bpage->LRU or
- bpage->list pointers. */
- for (c = (char*) buf + (BUF_BUDDY_LOW << i);
- c-- > (char*) buf; ) {
- *c = ~*c ^ i;
- }
- } else {
- /* Fill large blocks with a constant pattern. */
- memset(bpage, i, BUF_BUDDY_LOW << i);
- }
-#endif /* UNIV_DEBUG */
+
+ /* Fill large blocks with a constant pattern. */
+ ut_d(memset(bpage, i, BUF_BUDDY_LOW << i));
+ UNIV_MEM_INVALID(bpage, BUF_BUDDY_LOW << i);
bpage->state = BUF_BLOCK_ZIP_FREE;
buf_buddy_add_to_free(buf_pool, bpage, i);
}
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index 52358c52853..33b4cd40215 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -400,6 +400,7 @@ buf_get_total_stat(
tot_stat->n_pages_read += buf_stat->n_pages_read;
tot_stat->n_pages_written += buf_stat->n_pages_written;
tot_stat->n_pages_created += buf_stat->n_pages_created;
+ tot_stat->n_ra_pages_read_rnd += buf_stat->n_ra_pages_read_rnd;
tot_stat->n_ra_pages_read += buf_stat->n_ra_pages_read;
tot_stat->n_ra_pages_evicted += buf_stat->n_ra_pages_evicted;
tot_stat->n_pages_made_young += buf_stat->n_pages_made_young;
@@ -1099,70 +1100,6 @@ buf_chunk_not_freed(
return(NULL);
}
-/*********************************************************************//**
-Checks that all blocks in the buffer chunk are in BUF_BLOCK_NOT_USED state.
-@return TRUE if all freed */
-static
-ibool
-buf_chunk_all_free(
-/*===============*/
- const buf_chunk_t* chunk) /*!< in: chunk being checked */
-{
- const buf_block_t* block;
- ulint i;
-
- block = chunk->blocks;
-
- for (i = chunk->size; i--; block++) {
-
- if (buf_block_get_state(block) != BUF_BLOCK_NOT_USED) {
-
- return(FALSE);
- }
- }
-
- return(TRUE);
-}
-
-/********************************************************************//**
-Frees a chunk of buffer frames. */
-static
-void
-buf_chunk_free(
-/*===========*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
- buf_chunk_t* chunk) /*!< out: chunk of buffers */
-{
- buf_block_t* block;
- const buf_block_t* block_end;
-
- ut_ad(buf_pool_mutex_own(buf_pool));
-
- block_end = chunk->blocks + chunk->size;
-
- for (block = chunk->blocks; block < block_end; block++) {
- ut_a(buf_block_get_state(block) == BUF_BLOCK_NOT_USED);
- ut_a(!block->page.zip.data);
-
- ut_ad(!block->page.in_LRU_list);
- ut_ad(!block->in_unzip_LRU_list);
- ut_ad(!block->page.in_flush_list);
- /* Remove the block from the free list. */
- ut_ad(block->page.in_free_list);
- UT_LIST_REMOVE(list, buf_pool->free, (&block->page));
-
- /* Free the latches. */
- mutex_free(&block->mutex);
- rw_lock_free(&block->lock);
-#ifdef UNIV_SYNC_DEBUG
- rw_lock_free(&block->debug_latch);
-#endif /* UNIV_SYNC_DEBUG */
- UNIV_MEM_UNDESC(block);
- }
-
- os_mem_free_large(chunk->mem, chunk->mem_size);
-}
-
/********************************************************************//**
Set buffer pool size variables after resizing it */
static
@@ -1272,8 +1209,6 @@ buf_pool_free_instance(
chunk = chunks + buf_pool->n_chunks;
while (--chunk >= chunks) {
- /* Bypass the checks of buf_chunk_free(), since they
- would fail at shutdown. */
os_mem_free_large(chunk->mem, chunk->mem_size);
}
@@ -1533,281 +1468,6 @@ buf_relocate(
}
/********************************************************************//**
-Shrinks a buffer pool instance. */
-static
-void
-buf_pool_shrink_instance(
-/*=====================*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
- ulint chunk_size) /*!< in: number of pages to remove */
-{
- buf_chunk_t* chunks;
- buf_chunk_t* chunk;
- ulint max_size;
- ulint max_free_size;
- buf_chunk_t* max_chunk;
- buf_chunk_t* max_free_chunk;
-
- ut_ad(!buf_pool_mutex_own(buf_pool));
-
-try_again:
- btr_search_disable(); /* Empty the adaptive hash index again */
- buf_pool_mutex_enter(buf_pool);
-
-shrink_again:
- if (buf_pool->n_chunks <= 1) {
-
- /* Cannot shrink if there is only one chunk */
- goto func_done;
- }
-
- /* Search for the largest free chunk
- not larger than the size difference */
- chunks = buf_pool->chunks;
- chunk = chunks + buf_pool->n_chunks;
- max_size = max_free_size = 0;
- max_chunk = max_free_chunk = NULL;
-
- while (--chunk >= chunks) {
- if (chunk->size <= chunk_size
- && chunk->size > max_free_size) {
- if (chunk->size > max_size) {
- max_size = chunk->size;
- max_chunk = chunk;
- }
-
- if (buf_chunk_all_free(chunk)) {
- max_free_size = chunk->size;
- max_free_chunk = chunk;
- }
- }
- }
-
- if (!max_free_size) {
-
- ulint dirty = 0;
- ulint nonfree = 0;
- buf_block_t* block;
- buf_block_t* bend;
-
- /* Cannot shrink: try again later
- (do not assign srv_buf_pool_old_size) */
- if (!max_chunk) {
-
- goto func_exit;
- }
-
- block = max_chunk->blocks;
- bend = block + max_chunk->size;
-
- /* Move the blocks of chunk to the end of the
- LRU list and try to flush them. */
- for (; block < bend; block++) {
- switch (buf_block_get_state(block)) {
- case BUF_BLOCK_NOT_USED:
- continue;
- case BUF_BLOCK_FILE_PAGE:
- break;
- default:
- nonfree++;
- continue;
- }
-
- mutex_enter(&block->mutex);
- /* The following calls will temporarily
- release block->mutex and buf_pool->mutex.
- Therefore, we have to always retry,
- even if !dirty && !nonfree. */
-
- if (!buf_flush_ready_for_replace(&block->page)) {
-
- buf_LRU_make_block_old(&block->page);
- dirty++;
- } else if (buf_LRU_free_block(&block->page, TRUE)
- != BUF_LRU_FREED) {
- nonfree++;
- }
-
- mutex_exit(&block->mutex);
- }
-
- buf_pool_mutex_exit(buf_pool);
-
- /* Request for a flush of the chunk if it helps.
- Do not flush if there are non-free blocks, since
- flushing will not make the chunk freeable. */
- if (nonfree) {
- /* Avoid busy-waiting. */
- os_thread_sleep(100000);
- } else if (dirty
- && buf_flush_LRU(buf_pool, dirty)
- == ULINT_UNDEFINED) {
-
- buf_flush_wait_batch_end(buf_pool, BUF_FLUSH_LRU);
- }
-
- goto try_again;
- }
-
- max_size = max_free_size;
- max_chunk = max_free_chunk;
-
- buf_pool->old_pool_size = buf_pool->curr_pool_size;
-
- /* Rewrite buf_pool->chunks. Copy everything but max_chunk. */
- chunks = mem_alloc((buf_pool->n_chunks - 1) * sizeof *chunks);
- memcpy(chunks, buf_pool->chunks,
- (max_chunk - buf_pool->chunks) * sizeof *chunks);
- memcpy(chunks + (max_chunk - buf_pool->chunks),
- max_chunk + 1,
- buf_pool->chunks + buf_pool->n_chunks
- - (max_chunk + 1));
- ut_a(buf_pool->curr_size > max_chunk->size);
- buf_pool->curr_size -= max_chunk->size;
- buf_pool->curr_pool_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
- chunk_size -= max_chunk->size;
- buf_chunk_free(buf_pool, max_chunk);
- mem_free(buf_pool->chunks);
- buf_pool->chunks = chunks;
- buf_pool->n_chunks--;
-
- /* Allow a slack of one megabyte. */
- if (chunk_size > 1048576 / UNIV_PAGE_SIZE) {
-
- goto shrink_again;
- }
- goto func_exit;
-
-func_done:
- buf_pool->old_pool_size = buf_pool->curr_pool_size;
-func_exit:
- buf_pool_mutex_exit(buf_pool);
- btr_search_enable();
-}
-
-/********************************************************************//**
-Shrinks the buffer pool. */
-static
-void
-buf_pool_shrink(
-/*============*/
- ulint chunk_size) /*!< in: number of pages to remove */
-{
- ulint i;
-
- for (i = 0; i < srv_buf_pool_instances; i++) {
- buf_pool_t* buf_pool;
- ulint instance_chunk_size;
-
- instance_chunk_size = chunk_size / srv_buf_pool_instances;
- buf_pool = buf_pool_from_array(i);
- buf_pool_shrink_instance(buf_pool, instance_chunk_size);
- }
-
- buf_pool_set_sizes();
-}
-
-/********************************************************************//**
-Rebuild buf_pool->page_hash for a buffer pool instance. */
-static
-void
-buf_pool_page_hash_rebuild_instance(
-/*================================*/
- buf_pool_t* buf_pool) /*!< in: buffer pool instance */
-{
- ulint i;
- buf_page_t* b;
- buf_chunk_t* chunk;
- ulint n_chunks;
- hash_table_t* zip_hash;
- hash_table_t* page_hash;
-
- buf_pool_mutex_enter(buf_pool);
-
- /* Free, create, and populate the hash table. */
- hash_table_free(buf_pool->page_hash);
- buf_pool->page_hash = page_hash = hash_create(2 * buf_pool->curr_size);
- zip_hash = hash_create(2 * buf_pool->curr_size);
-
- HASH_MIGRATE(buf_pool->zip_hash, zip_hash, buf_page_t, hash,
- BUF_POOL_ZIP_FOLD_BPAGE);
-
- hash_table_free(buf_pool->zip_hash);
- buf_pool->zip_hash = zip_hash;
-
- /* Insert the uncompressed file pages to buf_pool->page_hash. */
-
- chunk = buf_pool->chunks;
- n_chunks = buf_pool->n_chunks;
-
- for (i = 0; i < n_chunks; i++, chunk++) {
- ulint j;
- buf_block_t* block = chunk->blocks;
-
- for (j = 0; j < chunk->size; j++, block++) {
- if (buf_block_get_state(block)
- == BUF_BLOCK_FILE_PAGE) {
- ut_ad(!block->page.in_zip_hash);
- ut_ad(block->page.in_page_hash);
-
- HASH_INSERT(buf_page_t, hash, page_hash,
- buf_page_address_fold(
- block->page.space,
- block->page.offset),
- &block->page);
- }
- }
- }
-
- /* Insert the compressed-only pages to buf_pool->page_hash.
- All such blocks are either in buf_pool->zip_clean or
- in buf_pool->flush_list. */
-
- for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b;
- b = UT_LIST_GET_NEXT(list, b)) {
- ut_a(buf_page_get_state(b) == BUF_BLOCK_ZIP_PAGE);
- ut_ad(!b->in_flush_list);
- ut_ad(b->in_LRU_list);
- ut_ad(b->in_page_hash);
- ut_ad(!b->in_zip_hash);
-
- HASH_INSERT(buf_page_t, hash, page_hash,
- buf_page_address_fold(b->space, b->offset), b);
- }
-
- buf_flush_list_mutex_enter(buf_pool);
- for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b;
- b = UT_LIST_GET_NEXT(list, b)) {
- ut_ad(b->in_flush_list);
- ut_ad(b->in_LRU_list);
- ut_ad(b->in_page_hash);
- ut_ad(!b->in_zip_hash);
-
- switch (buf_page_get_state(b)) {
- case BUF_BLOCK_ZIP_DIRTY:
- HASH_INSERT(buf_page_t, hash, page_hash,
- buf_page_address_fold(b->space,
- b->offset), b);
- break;
- case BUF_BLOCK_FILE_PAGE:
- /* uncompressed page */
- break;
- case BUF_BLOCK_ZIP_FREE:
- case BUF_BLOCK_ZIP_PAGE:
- case BUF_BLOCK_NOT_USED:
- case BUF_BLOCK_READY_FOR_USE:
- case BUF_BLOCK_MEMORY:
- case BUF_BLOCK_REMOVE_HASH:
- ut_error;
- break;
- }
- }
-
- buf_flush_list_mutex_exit(buf_pool);
- buf_pool_mutex_exit(buf_pool);
-}
-
-/********************************************************************
Determine if a block is a sentinel for a buffer pool watch.
@return TRUE if a sentinel for a buffer pool watch, FALSE if not */
UNIV_INTERN
@@ -1913,123 +1573,6 @@ buf_pool_watch_set(
return(NULL);
}
-/********************************************************************//**
-Rebuild buf_pool->page_hash. */
-static
-void
-buf_pool_page_hash_rebuild(void)
-/*============================*/
-{
- ulint i;
-
- for (i = 0; i < srv_buf_pool_instances; i++) {
- buf_pool_page_hash_rebuild_instance(buf_pool_from_array(i));
- }
-}
-
-/********************************************************************//**
-Increase the buffer pool size of one buffer pool instance. */
-static
-void
-buf_pool_increase_instance(
-/*=======================*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instane */
- ulint change_size) /*!< in: new size of the pool */
-{
- buf_chunk_t* chunks;
- buf_chunk_t* chunk;
-
- buf_pool_mutex_enter(buf_pool);
- chunks = mem_alloc((buf_pool->n_chunks + 1) * sizeof *chunks);
-
- memcpy(chunks, buf_pool->chunks, buf_pool->n_chunks * sizeof *chunks);
-
- chunk = &chunks[buf_pool->n_chunks];
-
- if (!buf_chunk_init(buf_pool, chunk, change_size)) {
- mem_free(chunks);
- } else {
- buf_pool->old_pool_size = buf_pool->curr_pool_size;
- buf_pool->curr_size += chunk->size;
- buf_pool->curr_pool_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
- mem_free(buf_pool->chunks);
- buf_pool->chunks = chunks;
- buf_pool->n_chunks++;
- }
-
- buf_pool_mutex_exit(buf_pool);
-}
-
-/********************************************************************//**
-Increase the buffer pool size. */
-static
-void
-buf_pool_increase(
-/*==============*/
- ulint change_size)
-{
- ulint i;
-
- for (i = 0; i < srv_buf_pool_instances; i++) {
- buf_pool_increase_instance(
- buf_pool_from_array(i),
- change_size / srv_buf_pool_instances);
- }
-
- buf_pool_set_sizes();
-}
-
-/********************************************************************//**
-Resizes the buffer pool. */
-UNIV_INTERN
-void
-buf_pool_resize(void)
-/*=================*/
-{
- ulint change_size;
- ulint min_change_size = 1048576 * srv_buf_pool_instances;
-
- buf_pool_mutex_enter_all();
-
- if (srv_buf_pool_old_size == srv_buf_pool_size) {
-
- buf_pool_mutex_exit_all();
-
- return;
-
- } else if (srv_buf_pool_curr_size + min_change_size
- > srv_buf_pool_size) {
-
- change_size = (srv_buf_pool_curr_size - srv_buf_pool_size)
- / UNIV_PAGE_SIZE;
-
- buf_pool_mutex_exit_all();
-
- /* Disable adaptive hash indexes and empty the index
- in order to free up memory in the buffer pool chunks. */
- buf_pool_shrink(change_size);
-
- } else if (srv_buf_pool_curr_size + min_change_size
- < srv_buf_pool_size) {
-
- /* Enlarge the buffer pool by at least one megabyte */
-
- change_size = srv_buf_pool_size - srv_buf_pool_curr_size;
-
- buf_pool_mutex_exit_all();
-
- buf_pool_increase(change_size);
- } else {
- srv_buf_pool_size = srv_buf_pool_old_size;
-
- buf_pool_mutex_exit_all();
-
- return;
- }
-
- buf_pool_page_hash_rebuild();
-}
-
/****************************************************************//**
Remove the sentinel block for the watch before replacing it with a real block.
buf_page_watch_clear() or buf_page_watch_occurred() will notice that
@@ -2365,7 +1908,7 @@ err_exit:
mutex_enter(block_mutex);
/* Discard the uncompressed page frame if possible. */
- if (buf_LRU_free_block(bpage, FALSE) == BUF_LRU_FREED) {
+ if (buf_LRU_free_block(bpage, FALSE)) {
mutex_exit(block_mutex);
goto lookup;
@@ -2768,12 +2311,8 @@ loop:
if (block) {
/* If the guess is a compressed page descriptor that
- has been allocated by buf_buddy_alloc(), it may have
- been invalidated by buf_buddy_relocate(). In that
- case, block could point to something that happens to
- contain the expected bits in block->page. Similarly,
- the guess may be pointing to a buffer pool chunk that
- has been released when resizing the buffer pool. */
+ has been allocated by buf_page_alloc_descriptor(),
+ it may have been freed by buf_relocate(). */
if (!buf_block_is_uncompressed(buf_pool, block)
|| offset != block->page.offset
@@ -2820,6 +2359,9 @@ loop2:
}
if (buf_read_page(space, zip_size, offset)) {
+ buf_read_ahead_random(space, zip_size, offset,
+ ibuf_inside(mtr));
+
retries = 0;
} else if (retries < BUF_PAGE_READ_MAX_RETRIES) {
++retries;
@@ -2951,8 +2493,10 @@ wait_until_unfixed:
if (buf_page_get_state(&block->page)
== BUF_BLOCK_ZIP_PAGE) {
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
UT_LIST_REMOVE(list, buf_pool->zip_clean,
&block->page);
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
ut_ad(!block->page.in_flush_list);
} else {
/* Relocate buf_pool->flush_list. */
@@ -2978,11 +2522,10 @@ wait_until_unfixed:
mutex_exit(&buf_pool->zip_mutex);
buf_pool->n_pend_unzip++;
- bpage->state = BUF_BLOCK_ZIP_FREE;
- buf_buddy_free(buf_pool, bpage, sizeof *bpage);
-
buf_pool_mutex_exit(buf_pool);
+ buf_page_free_descriptor(bpage);
+
/* Decompress the page and apply buffered operations
while not holding buf_pool->mutex or block->mutex. */
success = buf_zip_decompress(block, srv_use_checksums);
@@ -3028,7 +2571,7 @@ wait_until_unfixed:
/* Try to evict the block from the buffer pool, to use the
insert buffer (change buffer) as much as possible. */
- if (buf_LRU_free_block(&block->page, TRUE) == BUF_LRU_FREED) {
+ if (buf_LRU_free_block(&block->page, TRUE)) {
mutex_exit(&block->mutex);
if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) {
/* Set the watch, as it would have
@@ -3472,19 +3015,20 @@ buf_page_init_low(
/********************************************************************//**
Inits a page to the buffer buf_pool. */
-static
+static __attribute__((nonnull))
void
buf_page_init(
/*==========*/
+ buf_pool_t* buf_pool,/*!< in/out: buffer pool */
ulint space, /*!< in: space id */
ulint offset, /*!< in: offset of the page within space
in units of a page */
ulint fold, /*!< in: buf_page_address_fold(space,offset) */
- buf_block_t* block) /*!< in: block to init */
+ buf_block_t* block) /*!< in/out: block to init */
{
buf_page_t* hash_page;
- buf_pool_t* buf_pool = buf_pool_get(space, offset);
+ ut_ad(buf_pool == buf_pool_get(space, offset));
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(mutex_own(&(block->mutex)));
ut_a(buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE);
@@ -3643,7 +3187,7 @@ err_exit:
ut_ad(buf_pool_from_bpage(bpage) == buf_pool);
- buf_page_init(space, offset, fold, block);
+ buf_page_init(buf_pool, space, offset, fold, block);
/* The block must be put to the LRU list, to the old blocks */
buf_LRU_add_block(bpage, TRUE/* to old blocks */);
@@ -3687,20 +3231,11 @@ err_exit:
mutex_exit(&block->mutex);
} else {
- /* Defer buf_buddy_alloc() until after the block has
- been found not to exist. The buf_buddy_alloc() and
- buf_buddy_free() calls may be expensive because of
- buf_buddy_relocate(). */
-
/* The compressed page must be allocated before the
control block (bpage), in order to avoid the
invocation of buf_buddy_relocate_block() on
uninitialized data. */
data = buf_buddy_alloc(buf_pool, zip_size, &lru);
- bpage = buf_buddy_alloc(buf_pool, sizeof *bpage, &lru);
-
- /* Initialize the buf_pool pointer. */
- bpage->buf_pool_index = buf_pool_index(buf_pool);
/* If buf_buddy_alloc() allocated storage from the LRU list,
it released and reacquired buf_pool->mutex. Thus, we must
@@ -3716,8 +3251,6 @@ err_exit:
/* The block was added by some other thread. */
watch_page = NULL;
- bpage->state = BUF_BLOCK_ZIP_FREE;
- buf_buddy_free(buf_pool, bpage, sizeof *bpage);
buf_buddy_free(buf_pool, data, zip_size);
bpage = NULL;
@@ -3725,6 +3258,11 @@ err_exit:
}
}
+ bpage = buf_page_alloc_descriptor();
+
+ /* Initialize the buf_pool pointer. */
+ bpage->buf_pool_index = buf_pool_index(buf_pool);
+
page_zip_des_init(&bpage->zip);
page_zip_set_size(&bpage->zip, zip_size);
bpage->zip.data = data;
@@ -3739,7 +3277,6 @@ err_exit:
bpage->space = space;
bpage->offset = offset;
-
#ifdef UNIV_DEBUG
bpage->in_page_hash = FALSE;
bpage->in_zip_hash = FALSE;
@@ -3764,7 +3301,9 @@ err_exit:
/* The block must be put to the LRU list, to the old blocks */
buf_LRU_add_block(bpage, TRUE/* to old blocks */);
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
buf_LRU_insert_zip_clean(bpage);
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
buf_page_set_io_fix(bpage, BUF_IO_READ);
@@ -3852,7 +3391,7 @@ buf_page_create(
mutex_enter(&block->mutex);
- buf_page_init(space, offset, fold, block);
+ buf_page_init(buf_pool, space, offset, fold, block);
/* The block must be put to the LRU list */
buf_LRU_add_block(&block->page, FALSE);
@@ -3936,6 +3475,53 @@ buf_page_create(
}
/********************************************************************//**
+Mark a table with the specified space pointed by bpage->space corrupted.
+Also remove the bpage from LRU list.
+@return TRUE if successful */
+static
+ibool
+buf_mark_space_corrupt(
+/*===================*/
+ buf_page_t* bpage) /*!< in: pointer to the block in question */
+{
+ buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+ const ibool uncompressed = (buf_page_get_state(bpage)
+ == BUF_BLOCK_FILE_PAGE);
+ ulint space = bpage->space;
+ ibool ret = TRUE;
+
+ /* First unfix and release lock on the bpage */
+ buf_pool_mutex_enter(buf_pool);
+ mutex_enter(buf_page_get_mutex(bpage));
+ ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_READ);
+ ut_ad(bpage->buf_fix_count == 0);
+
+ /* Set BUF_IO_NONE before we remove the block from LRU list */
+ buf_page_set_io_fix(bpage, BUF_IO_NONE);
+
+ if (uncompressed) {
+ rw_lock_x_unlock_gen(
+ &((buf_block_t*) bpage)->lock,
+ BUF_IO_READ);
+ }
+
+ /* Find the table with specified space id, and mark it corrupted */
+ if (dict_set_corrupted_by_space(space)) {
+ buf_LRU_free_one_page(bpage);
+ } else {
+ ret = FALSE;
+ }
+
+ ut_ad(buf_pool->n_pend_reads > 0);
+ buf_pool->n_pend_reads--;
+
+ mutex_exit(buf_page_get_mutex(bpage));
+ buf_pool_mutex_exit(buf_pool);
+
+ return(ret);
+}
+
+/********************************************************************//**
Completes an asynchronous read or write request of a file page to or from
the buffer pool. */
UNIV_INTERN
@@ -4060,10 +3646,19 @@ corrupt:
"InnoDB: about forcing recovery.\n", stderr);
if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
- fputs("InnoDB: Ending processing because of"
- " a corrupt database page.\n",
- stderr);
- exit(1);
+ /* If page space id is larger than TRX_SYS_SPACE
+ (0), we will attempt to mark the corresponding
+ table as corrupted instead of crashing server */
+ if (bpage->space > TRX_SYS_SPACE
+ && buf_mark_space_corrupt(bpage)) {
+ return;
+ } else {
+ fputs("InnoDB: Ending processing"
+ " because of"
+ " a corrupt database page.\n",
+ stderr);
+ ut_error;
+ }
}
}
@@ -4847,6 +4442,7 @@ buf_stats_aggregate_pool_info(
total_info->n_pages_created += pool_info->n_pages_created;
total_info->n_pages_written += pool_info->n_pages_written;
total_info->n_page_gets += pool_info->n_page_gets;
+ total_info->n_ra_pages_read_rnd += pool_info->n_ra_pages_read_rnd;
total_info->n_ra_pages_read += pool_info->n_ra_pages_read;
total_info->n_ra_pages_evicted += pool_info->n_ra_pages_evicted;
total_info->page_made_young_rate += pool_info->page_made_young_rate;
@@ -4859,6 +4455,7 @@ buf_stats_aggregate_pool_info(
total_info->page_read_delta += pool_info->page_read_delta;
total_info->young_making_delta += pool_info->young_making_delta;
total_info->not_young_making_delta += pool_info->not_young_making_delta;
+ total_info->pages_readahead_rnd_rate += pool_info->pages_readahead_rnd_rate;
total_info->pages_readahead_rate += pool_info->pages_readahead_rate;
total_info->pages_evicted_rate += pool_info->pages_evicted_rate;
total_info->unzip_lru_len += pool_info->unzip_lru_len;
@@ -4936,6 +4533,7 @@ buf_stats_get_pool_info(
pool_info->n_page_gets = buf_pool->stat.n_page_gets;
+ pool_info->n_ra_pages_read_rnd = buf_pool->stat.n_ra_pages_read_rnd;
pool_info->n_ra_pages_read = buf_pool->stat.n_ra_pages_read;
pool_info->n_ra_pages_evicted = buf_pool->stat.n_ra_pages_evicted;
@@ -4975,6 +4573,10 @@ buf_stats_get_pool_info(
buf_pool->stat.n_pages_not_made_young
- buf_pool->old_stat.n_pages_not_made_young;
}
+ pool_info->pages_readahead_rnd_rate =
+ (buf_pool->stat.n_ra_pages_read_rnd
+ - buf_pool->old_stat.n_ra_pages_read_rnd) / time_elapsed;
+
pool_info->pages_readahead_rate =
(buf_pool->stat.n_ra_pages_read
@@ -5060,9 +4662,12 @@ buf_print_io_instance(
/* Statistics about read ahead algorithm */
fprintf(file, "Pages read ahead %.2f/s,"
- " evicted without access %.2f/s\n",
+ " evicted without access %.2f/s,"
+ " Random read ahead %.2f/s\n",
+
pool_info->pages_readahead_rate,
- pool_info->pages_evicted_rate);
+ pool_info->pages_evicted_rate,
+ pool_info->pages_readahead_rnd_rate);
/* Print some values to help us with visualizing what is
happening with LRU eviction. */
diff --git a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c
index ebe96a82a10..06b3ec393c1 100644
--- a/storage/innobase/buf/buf0flu.c
+++ b/storage/innobase/buf/buf0flu.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -524,7 +524,9 @@ buf_flush_remove(
case BUF_BLOCK_ZIP_DIRTY:
buf_page_set_state(bpage, BUF_BLOCK_ZIP_PAGE);
UT_LIST_REMOVE(list, buf_pool->flush_list, bpage);
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
buf_LRU_insert_zip_clean(bpage);
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
break;
case BUF_BLOCK_FILE_PAGE:
UT_LIST_REMOVE(list, buf_pool->flush_list, bpage);
diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
index 64afcecfe3c..b5ca21e14a6 100644
--- a/storage/innobase/buf/buf0lru.c
+++ b/storage/innobase/buf/buf0lru.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -353,31 +353,34 @@ scan_again:
while (bpage != NULL) {
buf_page_t* prev_bpage;
- ibool prev_bpage_buf_fix = FALSE;
+ mutex_t* block_mutex = NULL;
ut_a(buf_page_in_file(bpage));
prev_bpage = UT_LIST_GET_PREV(LRU, bpage);
/* bpage->space and bpage->io_fix are protected by
- buf_pool->mutex and block_mutex. It is safe to check
- them while holding buf_pool->mutex only. */
+ buf_pool_mutex and block_mutex. It is safe to check
+ them while holding buf_pool_mutex only. */
if (buf_page_get_space(bpage) != id) {
/* Skip this block, as it does not belong to
the space that is being invalidated. */
+ goto next_page;
} else if (buf_page_get_io_fix(bpage) != BUF_IO_NONE) {
/* We cannot remove this page during this scan
yet; maybe the system is currently reading it
in, or flushing the modifications to the file */
all_freed = FALSE;
+ goto next_page;
} else {
- mutex_t* block_mutex = buf_page_get_mutex(bpage);
+ block_mutex = buf_page_get_mutex(bpage);
mutex_enter(block_mutex);
if (bpage->buf_fix_count > 0) {
+ mutex_exit(block_mutex);
/* We cannot remove this page during
this scan yet; maybe the system is
currently reading it in, or flushing
@@ -387,106 +390,59 @@ scan_again:
goto next_page;
}
+ }
+
+ ut_ad(mutex_own(block_mutex));
#ifdef UNIV_DEBUG
- if (buf_debug_prints) {
- fprintf(stderr,
- "Dropping space %lu page %lu\n",
- (ulong) buf_page_get_space(bpage),
- (ulong) buf_page_get_page_no(bpage));
- }
+ if (buf_debug_prints) {
+ fprintf(stderr,
+ "Dropping space %lu page %lu\n",
+ (ulong) buf_page_get_space(bpage),
+ (ulong) buf_page_get_page_no(bpage));
+ }
#endif
- if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) {
- /* This is a compressed-only block
- descriptor. Ensure that prev_bpage
- cannot be relocated when bpage is freed. */
- if (UNIV_LIKELY(prev_bpage != NULL)) {
- switch (buf_page_get_state(
- prev_bpage)) {
- case BUF_BLOCK_FILE_PAGE:
- /* Descriptors of uncompressed
- blocks will not be relocated,
- because we are holding the
- buf_pool->mutex. */
- break;
- case BUF_BLOCK_ZIP_PAGE:
- case BUF_BLOCK_ZIP_DIRTY:
- /* Descriptors of compressed-
- only blocks can be relocated,
- unless they are buffer-fixed.
- Because both bpage and
- prev_bpage are protected by
- buf_pool_zip_mutex, it is
- not necessary to acquire
- further mutexes. */
- ut_ad(&buf_pool->zip_mutex
- == block_mutex);
- ut_ad(mutex_own(block_mutex));
- prev_bpage_buf_fix = TRUE;
- prev_bpage->buf_fix_count++;
- break;
- default:
- ut_error;
- }
- }
- } else if (((buf_block_t*) bpage)->is_hashed) {
- ulint page_no;
- ulint zip_size;
-
- buf_pool_mutex_exit(buf_pool);
+ if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) {
+ /* This is a compressed-only block
+ descriptor. Do nothing. */
+ } else if (((buf_block_t*) bpage)->is_hashed) {
+ ulint page_no;
+ ulint zip_size;
- zip_size = buf_page_get_zip_size(bpage);
- page_no = buf_page_get_page_no(bpage);
+ buf_pool_mutex_exit(buf_pool);
- mutex_exit(block_mutex);
+ zip_size = buf_page_get_zip_size(bpage);
+ page_no = buf_page_get_page_no(bpage);
- /* Note that the following call will acquire
- an S-latch on the page */
+ mutex_exit(block_mutex);
- btr_search_drop_page_hash_when_freed(
- id, zip_size, page_no);
- goto scan_again;
- }
+ /* Note that the following call will acquire
+ an S-latch on the page */
- if (bpage->oldest_modification != 0) {
+ btr_search_drop_page_hash_when_freed(
+ id, zip_size, page_no);
+ goto scan_again;
+ }
- buf_flush_remove(bpage);
- }
+ if (bpage->oldest_modification != 0) {
- /* Remove from the LRU list. */
+ buf_flush_remove(bpage);
+ }
- if (buf_LRU_block_remove_hashed_page(bpage, TRUE)
- != BUF_BLOCK_ZIP_FREE) {
- buf_LRU_block_free_hashed_page((buf_block_t*)
- bpage);
- } else {
- /* The block_mutex should have been
- released by buf_LRU_block_remove_hashed_page()
- when it returns BUF_BLOCK_ZIP_FREE. */
- ut_ad(block_mutex == &buf_pool->zip_mutex);
- ut_ad(!mutex_own(block_mutex));
-
- if (prev_bpage_buf_fix) {
- /* We temporarily buffer-fixed
- prev_bpage, so that
- buf_buddy_free() could not
- relocate it, in case it was a
- compressed-only block
- descriptor. */
-
- mutex_enter(block_mutex);
- ut_ad(prev_bpage->buf_fix_count > 0);
- prev_bpage->buf_fix_count--;
- mutex_exit(block_mutex);
- }
+ /* Remove from the LRU list. */
- goto next_page_no_mutex;
- }
-next_page:
+ if (buf_LRU_block_remove_hashed_page(bpage, TRUE)
+ != BUF_BLOCK_ZIP_FREE) {
+ buf_LRU_block_free_hashed_page((buf_block_t*) bpage);
mutex_exit(block_mutex);
+ } else {
+ /* The block_mutex should have been released
+ by buf_LRU_block_remove_hashed_page() when it
+ returns BUF_BLOCK_ZIP_FREE. */
+ ut_ad(block_mutex == &buf_pool->zip_mutex);
+ ut_ad(!mutex_own(block_mutex));
}
-
-next_page_no_mutex:
+next_page:
bpage = prev_bpage;
}
@@ -525,6 +481,7 @@ buf_LRU_invalidate_tablespace(
}
}
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/********************************************************************//**
Insert a compressed block into buf_pool->zip_clean in the LRU order. */
UNIV_INTERN
@@ -557,6 +514,7 @@ buf_LRU_insert_zip_clean(
UT_LIST_ADD_FIRST(list, buf_pool->zip_clean, bpage);
}
}
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
/******************************************************************//**
Try to free an uncompressed page of a compressed block from the unzip
@@ -600,7 +558,7 @@ buf_LRU_free_from_unzip_LRU_list(
UNIV_LIKELY(block != NULL) && UNIV_LIKELY(distance > 0);
block = UT_LIST_GET_PREV(unzip_LRU, block), distance--) {
- enum buf_lru_free_block_status freed;
+ ibool freed;
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
ut_ad(block->in_unzip_LRU_list);
@@ -610,24 +568,9 @@ buf_LRU_free_from_unzip_LRU_list(
freed = buf_LRU_free_block(&block->page, FALSE);
mutex_exit(&block->mutex);
- switch (freed) {
- case BUF_LRU_FREED:
+ if (freed) {
return(TRUE);
-
- case BUF_LRU_CANNOT_RELOCATE:
- /* If we failed to relocate, try
- regular LRU eviction. */
- return(FALSE);
-
- case BUF_LRU_NOT_FREED:
- /* The block was buffer-fixed or I/O-fixed.
- Keep looking. */
- continue;
}
-
- /* inappropriate return value from
- buf_LRU_free_block() */
- ut_error;
}
return(FALSE);
@@ -660,10 +603,9 @@ buf_LRU_free_from_common_LRU_list(
UNIV_LIKELY(bpage != NULL) && UNIV_LIKELY(distance > 0);
bpage = UT_LIST_GET_PREV(LRU, bpage), distance--) {
- enum buf_lru_free_block_status freed;
- unsigned accessed;
- mutex_t* block_mutex
- = buf_page_get_mutex(bpage);
+ ibool freed;
+ unsigned accessed;
+ mutex_t* block_mutex = buf_page_get_mutex(bpage);
ut_ad(buf_page_in_file(bpage));
ut_ad(bpage->in_LRU_list);
@@ -673,8 +615,7 @@ buf_LRU_free_from_common_LRU_list(
freed = buf_LRU_free_block(bpage, TRUE);
mutex_exit(block_mutex);
- switch (freed) {
- case BUF_LRU_FREED:
+ if (freed) {
/* Keep track of pages that are evicted without
ever being accessed. This gives us a measure of
the effectiveness of readahead */
@@ -682,21 +623,7 @@ buf_LRU_free_from_common_LRU_list(
++buf_pool->stat.n_ra_pages_evicted;
}
return(TRUE);
-
- case BUF_LRU_NOT_FREED:
- /* The block was dirty, buffer-fixed, or I/O-fixed.
- Keep looking. */
- continue;
-
- case BUF_LRU_CANNOT_RELOCATE:
- /* This should never occur, because we
- want to discard the compressed page too. */
- break;
}
-
- /* inappropriate return value from
- buf_LRU_free_block() */
- ut_error;
}
return(FALSE);
@@ -1422,17 +1349,16 @@ buf_LRU_make_block_old(
Try to free a block. If bpage is a descriptor of a compressed-only
page, the descriptor object will be freed as well.
-NOTE: If this function returns BUF_LRU_FREED, it will temporarily
+NOTE: If this function returns TRUE, it will temporarily
release buf_pool->mutex. Furthermore, the page frame will no longer be
accessible via bpage.
The caller must hold buf_pool->mutex and buf_page_get_mutex(bpage) and
release these two mutexes after the call. No other
buf_page_get_mutex() may be held when calling this function.
-@return BUF_LRU_FREED if freed, BUF_LRU_CANNOT_RELOCATE or
-BUF_LRU_NOT_FREED otherwise. */
+@return TRUE if freed, FALSE otherwise. */
UNIV_INTERN
-enum buf_lru_free_block_status
+ibool
buf_LRU_free_block(
/*===============*/
buf_page_t* bpage, /*!< in: block to be freed */
@@ -1458,7 +1384,7 @@ buf_LRU_free_block(
if (!buf_page_can_relocate(bpage)) {
/* Do not free buffer-fixed or I/O-fixed blocks. */
- return(BUF_LRU_NOT_FREED);
+ return(FALSE);
}
#ifdef UNIV_IBUF_COUNT_DEBUG
@@ -1470,7 +1396,7 @@ buf_LRU_free_block(
/* Do not completely free dirty blocks. */
if (bpage->oldest_modification) {
- return(BUF_LRU_NOT_FREED);
+ return(FALSE);
}
} else if (bpage->oldest_modification) {
/* Do not completely free dirty blocks. */
@@ -1478,7 +1404,7 @@ buf_LRU_free_block(
if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) {
ut_ad(buf_page_get_state(bpage)
== BUF_BLOCK_ZIP_DIRTY);
- return(BUF_LRU_NOT_FREED);
+ return(FALSE);
}
goto alloc;
@@ -1487,14 +1413,8 @@ buf_LRU_free_block(
If it cannot be allocated (without freeing a block
from the LRU list), refuse to free bpage. */
alloc:
- buf_pool_mutex_exit_forbid(buf_pool);
- b = buf_buddy_alloc(buf_pool, sizeof *b, NULL);
- buf_pool_mutex_exit_allow(buf_pool);
-
- if (UNIV_UNLIKELY(!b)) {
- return(BUF_LRU_CANNOT_RELOCATE);
- }
-
+ b = buf_page_alloc_descriptor();
+ ut_a(b);
memcpy(b, bpage, sizeof *b);
}
@@ -1598,7 +1518,9 @@ alloc:
}
if (b->state == BUF_BLOCK_ZIP_PAGE) {
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
buf_LRU_insert_zip_clean(b);
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
} else {
/* Relocate on buf_pool->flush_list. */
buf_flush_relocate_on_flush_list(bpage, b);
@@ -1665,7 +1587,7 @@ alloc:
mutex_enter(block_mutex);
}
- return(BUF_LRU_FREED);
+ return(TRUE);
}
/******************************************************************//**
@@ -1884,7 +1806,9 @@ buf_LRU_block_remove_hashed_page(
ut_a(bpage->zip.data);
ut_a(buf_page_get_zip_size(bpage));
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
UT_LIST_REMOVE(list, buf_pool->zip_clean, bpage);
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
mutex_exit(&buf_pool->zip_mutex);
buf_pool_mutex_exit_forbid(buf_pool);
@@ -1893,11 +1817,8 @@ buf_LRU_block_remove_hashed_page(
buf_pool, bpage->zip.data,
page_zip_get_size(&bpage->zip));
- bpage->state = BUF_BLOCK_ZIP_FREE;
- buf_buddy_free(buf_pool, bpage, sizeof(*bpage));
buf_pool_mutex_exit_allow(buf_pool);
-
- UNIV_MEM_UNDESC(bpage);
+ buf_page_free_descriptor(bpage);
return(BUF_BLOCK_ZIP_FREE);
case BUF_BLOCK_FILE_PAGE:
@@ -1964,6 +1885,22 @@ buf_LRU_block_free_hashed_page(
buf_LRU_block_free_non_file_page(block);
}
+/******************************************************************//**
+Remove one page from LRU list and put it to free list */
+UNIV_INTERN
+void
+buf_LRU_free_one_page(
+/*==================*/
+ buf_page_t* bpage) /*!< in/out: block, must contain a file page and
+ be in a state where it can be freed; there
+ may or may not be a hash index to the page */
+{
+ if (buf_LRU_block_remove_hashed_page(bpage, TRUE)
+ != BUF_BLOCK_ZIP_FREE) {
+ buf_LRU_block_free_hashed_page((buf_block_t*) bpage);
+ }
+}
+
/**********************************************************************//**
Updates buf_pool->LRU_old_ratio for one buffer pool instance.
@return updated old_pct */
diff --git a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
index eeaa21ae9ef..da804a66b29 100644
--- a/storage/innobase/buf/buf0rea.c
+++ b/storage/innobase/buf/buf0rea.c
@@ -40,8 +40,10 @@ Created 11/5/1995 Heikki Tuuri
#include "mysql/plugin.h"
#include "mysql/service_thd_wait.h"
-/** The linear read-ahead area size */
-#define BUF_READ_AHEAD_LINEAR_AREA BUF_READ_AHEAD_AREA
+/** There must be at least this many pages in buf_pool in the area to start
+a random read-ahead */
+#define BUF_READ_AHEAD_RANDOM_THRESHOLD(b) \
+ (5 + BUF_READ_AHEAD_AREA(b) / 8)
/** If there are buf_pool->curr_size per the number below pending reads, then
read-ahead is not done: this is to prevent flooding the buffer pool with
@@ -162,6 +164,171 @@ buf_read_page_low(
}
/********************************************************************//**
+Applies a random read-ahead in buf_pool if there are at least a threshold
+value of accessed pages from the random read-ahead area. Does not read any
+page, not even the one at the position (space, offset), if the read-ahead
+mechanism is not activated. NOTE 1: the calling thread may own latches on
+pages: to avoid deadlocks this function must be written such that it cannot
+end up waiting for these latches! NOTE 2: the calling thread must want
+access to the page given: this rule is set to prevent unintended read-aheads
+performed by ibuf routines, a situation which could result in a deadlock if
+the OS does not support asynchronous i/o.
+@return number of page read requests issued; NOTE that if we read ibuf
+pages, it may happen that the page at the given page number does not
+get read even if we return a positive value!
+@return number of page read requests issued */
+UNIV_INTERN
+ulint
+buf_read_ahead_random(
+/*==================*/
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes,
+ or 0 */
+ ulint offset, /*!< in: page number of a page which
+ the current thread wants to access */
+ ibool inside_ibuf) /*!< in: TRUE if we are inside ibuf
+ routine */
+{
+ buf_pool_t* buf_pool = buf_pool_get(space, offset);
+ ib_int64_t tablespace_version;
+ ulint recent_blocks = 0;
+ ulint ibuf_mode;
+ ulint count;
+ ulint low, high;
+ ulint err;
+ ulint i;
+ const ulint buf_read_ahead_random_area
+ = BUF_READ_AHEAD_AREA(buf_pool);
+
+ if (!srv_random_read_ahead) {
+ /* Disabled by user */
+ return(0);
+ }
+
+ if (srv_startup_is_before_trx_rollback_phase) {
+ /* No read-ahead to avoid thread deadlocks */
+ return(0);
+ }
+
+ if (ibuf_bitmap_page(zip_size, offset)
+ || trx_sys_hdr_page(space, offset)) {
+
+ /* If it is an ibuf bitmap page or trx sys hdr, we do
+ no read-ahead, as that could break the ibuf page access
+ order */
+
+ return(0);
+ }
+
+ /* Remember the tablespace version before we ask te tablespace size
+ below: if DISCARD + IMPORT changes the actual .ibd file meanwhile, we
+ do not try to read outside the bounds of the tablespace! */
+
+ tablespace_version = fil_space_get_version(space);
+
+ low = (offset / buf_read_ahead_random_area)
+ * buf_read_ahead_random_area;
+ high = (offset / buf_read_ahead_random_area + 1)
+ * buf_read_ahead_random_area;
+ if (high > fil_space_get_size(space)) {
+
+ high = fil_space_get_size(space);
+ }
+
+ buf_pool_mutex_enter(buf_pool);
+
+ if (buf_pool->n_pend_reads
+ > buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
+ buf_pool_mutex_exit(buf_pool);
+
+ return(0);
+ }
+
+ /* Count how many blocks in the area have been recently accessed,
+ that is, reside near the start of the LRU list. */
+
+ for (i = low; i < high; i++) {
+ const buf_page_t* bpage =
+ buf_page_hash_get(buf_pool, space, i);
+
+ if (bpage
+ && buf_page_is_accessed(bpage)
+ && buf_page_peek_if_young(bpage)) {
+
+ recent_blocks++;
+
+ if (recent_blocks
+ >= BUF_READ_AHEAD_RANDOM_THRESHOLD(buf_pool)) {
+
+ buf_pool_mutex_exit(buf_pool);
+ goto read_ahead;
+ }
+ }
+ }
+
+ buf_pool_mutex_exit(buf_pool);
+ /* Do nothing */
+ return(0);
+
+read_ahead:
+ /* Read all the suitable blocks within the area */
+
+ if (inside_ibuf) {
+ ibuf_mode = BUF_READ_IBUF_PAGES_ONLY;
+ } else {
+ ibuf_mode = BUF_READ_ANY_PAGE;
+ }
+
+ count = 0;
+
+ for (i = low; i < high; i++) {
+ /* It is only sensible to do read-ahead in the non-sync aio
+ mode: hence FALSE as the first parameter */
+
+ if (!ibuf_bitmap_page(zip_size, i)) {
+ count += buf_read_page_low(
+ &err, FALSE,
+ ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
+ space, zip_size, FALSE,
+ tablespace_version, i);
+ if (err == DB_TABLESPACE_DELETED) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Warning: in random"
+ " readahead trying to access\n"
+ "InnoDB: tablespace %lu page %lu,\n"
+ "InnoDB: but the tablespace does not"
+ " exist or is just being dropped.\n",
+ (ulong) space, (ulong) i);
+ }
+ }
+ }
+
+ /* In simulated aio we wake the aio handler threads only after
+ queuing all aio requests, in native aio the following call does
+ nothing: */
+
+ os_aio_simulated_wake_handler_threads();
+
+#ifdef UNIV_DEBUG
+ if (buf_debug_prints && (count > 0)) {
+ fprintf(stderr,
+ "Random read-ahead space %lu offset %lu pages %lu\n",
+ (ulong) space, (ulong) offset,
+ (ulong) count);
+ }
+#endif /* UNIV_DEBUG */
+
+ /* Read ahead is considered one I/O operation for the purpose of
+ LRU policy decision. */
+ buf_LRU_stat_inc_io();
+
+ buf_pool->stat.n_ra_pages_read_rnd += count;
+ srv_buf_pool_reads += count;
+ return(count);
+}
+
+/********************************************************************//**
High-level function which reads a page asynchronously from a file to the
buffer buf_pool if it is not already there. Sets the io_fix flag and sets
an exclusive lock on the buffer frame. The flag is cleared and the x-lock
@@ -257,7 +424,7 @@ buf_read_ahead_linear(
ulint err;
ulint i;
const ulint buf_read_ahead_linear_area
- = BUF_READ_AHEAD_LINEAR_AREA(buf_pool);
+ = BUF_READ_AHEAD_AREA(buf_pool);
ulint threshold;
if (UNIV_UNLIKELY(srv_startup_is_before_trx_rollback_phase)) {
diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c
index 9a528d679a7..d7373a4b8ef 100644
--- a/storage/innobase/dict/dict0crea.c
+++ b/storage/innobase/dict/dict0crea.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -827,7 +827,7 @@ dict_truncate_index_tree(
appropriate field in the SYS_INDEXES record: this mini-transaction
marks the B-tree totally truncated */
- btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
+ btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, NULL, mtr);
btr_free_root(space, zip_size, root_page_no, mtr);
create:
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index 1e3aed92cf7..2a2c7652817 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -54,6 +54,7 @@ UNIV_INTERN dict_index_t* dict_ind_compact;
#include "row0merge.h"
#include "m_ctype.h" /* my_isspace() */
#include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/
+#include "row0upd.h"
#include <ctype.h>
@@ -611,8 +612,7 @@ dict_table_get_on_id(
{
dict_table_t* table;
- if (table_id <= DICT_FIELDS_ID
- || trx->dict_operation_lock_mode == RW_X_LATCH) {
+ if (trx->dict_operation_lock_mode == RW_X_LATCH) {
/* Note: An X latch implies that the transaction
already owns the dictionary mutex. */
@@ -1714,7 +1714,8 @@ undo_size_ok:
new_index->page = page_no;
rw_lock_create(index_tree_rw_lock_key, &new_index->lock,
- SYNC_INDEX_TREE);
+ dict_index_is_ibuf(index)
+ ? SYNC_IBUF_INDEX_TREE : SYNC_INDEX_TREE);
if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
@@ -5045,4 +5046,187 @@ dict_close(void)
rw_lock_free(&dict_table_stats_latches[i]);
}
}
+
+/**********************************************************************//**
+Find a table in dict_sys->table_LRU list with specified space id
+@return table if found, NULL if not */
+static
+dict_table_t*
+dict_find_table_by_space(
+/*=====================*/
+ ulint space_id) /*!< in: space ID */
+{
+ dict_table_t* table;
+ ulint num_item;
+ ulint count = 0;
+
+ ut_ad(space_id > 0);
+
+ table = UT_LIST_GET_FIRST(dict_sys->table_LRU);
+ num_item = UT_LIST_GET_LEN(dict_sys->table_LRU);
+
+ /* This function intentionally does not acquire mutex as it is used
+ by error handling code in deep call stack as last means to avoid
+ killing the server, so it worth to risk some consequencies for
+ the action. */
+ while (table && count < num_item) {
+ if (table->space == space_id) {
+ return(table);
+ }
+
+ table = UT_LIST_GET_NEXT(table_LRU, table);
+ count++;
+ }
+
+ return(NULL);
+}
+
+/**********************************************************************//**
+Flags a table with specified space_id corrupted in the data dictionary
+cache
+@return TRUE if successful */
+UNIV_INTERN
+ibool
+dict_set_corrupted_by_space(
+/*========================*/
+ ulint space_id) /*!< in: space ID */
+{
+ dict_table_t* table;
+
+ table = dict_find_table_by_space(space_id);
+
+ if (!table) {
+ return(FALSE);
+ }
+
+ /* mark the table->corrupted bit only, since the caller
+ could be too deep in the stack for SYS_INDEXES update */
+ table->corrupted = TRUE;
+
+ return(TRUE);
+}
+
+/**********************************************************************//**
+Flags an index corrupted both in the data dictionary cache
+and in the SYS_INDEXES */
+UNIV_INTERN
+void
+dict_set_corrupted(
+/*===============*/
+ dict_index_t* index) /*!< in/out: index */
+{
+ mem_heap_t* heap;
+ mtr_t mtr;
+ dict_index_t* sys_index;
+ dtuple_t* tuple;
+ dfield_t* dfield;
+ byte* buf;
+ const char* status;
+ btr_cur_t cursor;
+
+ ut_ad(index);
+ ut_ad(mutex_own(&dict_sys->mutex));
+ ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
+ ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(sync_thread_levels_empty_except_dict());
+#endif
+
+ /* Mark the table as corrupted only if the clustered index
+ is corrupted */
+ if (dict_index_is_clust(index)) {
+ index->table->corrupted = TRUE;
+ }
+
+ if (UNIV_UNLIKELY(dict_index_is_corrupted(index))) {
+ /* The index was already flagged corrupted. */
+ ut_ad(index->table->corrupted);
+ return;
+ }
+
+ heap = mem_heap_create(sizeof(dtuple_t) + 2 * (sizeof(dfield_t)
+ + sizeof(que_fork_t) + sizeof(upd_node_t)
+ + sizeof(upd_t) + 12));
+ mtr_start(&mtr);
+ index->type |= DICT_CORRUPT;
+
+ sys_index = UT_LIST_GET_FIRST(dict_sys->sys_indexes->indexes);
+
+ /* Find the index row in SYS_INDEXES */
+ tuple = dtuple_create(heap, 2);
+
+ dfield = dtuple_get_nth_field(tuple, 0);
+ buf = mem_heap_alloc(heap, 8);
+ mach_write_to_8(buf, index->table->id);
+ dfield_set_data(dfield, buf, 8);
+
+ dfield = dtuple_get_nth_field(tuple, 1);
+ buf = mem_heap_alloc(heap, 8);
+ mach_write_to_8(buf, index->id);
+ dfield_set_data(dfield, buf, 8);
+
+ dict_index_copy_types(tuple, sys_index, 2);
+
+ btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE,
+ BTR_MODIFY_LEAF,
+ &cursor, 0, __FILE__, __LINE__, &mtr);
+
+ if (cursor.up_match == dtuple_get_n_fields(tuple)) {
+ /* UPDATE SYS_INDEXES SET TYPE=index->type
+ WHERE TABLE_ID=index->table->id AND INDEX_ID=index->id */
+ ulint len;
+ byte* field = rec_get_nth_field_old(
+ btr_cur_get_rec(&cursor),
+ DICT_SYS_INDEXES_TYPE_FIELD, &len);
+ if (len != 4) {
+ goto fail;
+ }
+ mlog_write_ulint(field, index->type, MLOG_4BYTES, &mtr);
+ status = " InnoDB: Flagged corruption of ";
+ } else {
+fail:
+ status = " InnoDB: Unable to flag corruption of ";
+ }
+
+ mtr_commit(&mtr);
+ mem_heap_free(heap);
+
+ ut_print_timestamp(stderr);
+ fputs(status, stderr);
+ dict_index_name_print(stderr, NULL, index);
+ putc('\n', stderr);
+}
+
+/**********************************************************************//**
+Flags an index corrupted in the data dictionary cache only. This
+is used mostly to mark a corrupted index when index's own dictionary
+is corrupted, and we force to load such index for repair purpose */
+UNIV_INTERN
+void
+dict_set_corrupted_index_cache_only(
+/*================================*/
+ dict_index_t* index, /*!< in/out: index */
+ dict_table_t* table) /*!< in/out: table */
+{
+ ut_ad(index);
+ ut_ad(mutex_own(&dict_sys->mutex));
+ ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
+ ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));
+
+ /* Mark the table as corrupted only if the clustered index
+ is corrupted */
+ if (dict_index_is_clust(index)) {
+ dict_table_t* corrupt_table;
+
+ corrupt_table = table ? table : index->table;
+ ut_ad(!index->table || !table || index->table == table);
+
+ if (corrupt_table) {
+ corrupt_table->corrupted = TRUE;
+ }
+ }
+
+ index->type |= DICT_CORRUPT;
+}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c
index a76f1f93202..0a5cfb87140 100644
--- a/storage/innobase/dict/dict0load.c
+++ b/storage/innobase/dict/dict0load.c
@@ -52,6 +52,11 @@ static const char* SYSTEM_TABLE_NAME[] = {
"SYS_FOREIGN",
"SYS_FOREIGN_COLS"
};
+
+/* If this flag is TRUE, then we will load the cluster index's (and tables')
+metadata even if it is marked as "corrupted". */
+UNIV_INTERN my_bool srv_load_corrupted = FALSE;
+
/****************************************************************//**
Compare the name of an index column.
@return TRUE if the i'th column of index is 'name'. */
@@ -1324,6 +1329,9 @@ err_len:
goto err_len;
}
type = mach_read_from_4(field);
+ if (UNIV_UNLIKELY(type & (~0 << DICT_IT_BITS))) {
+ return("unknown SYS_INDEXES.TYPE bits");
+ }
field = rec_get_nth_field_old(rec, 7/*SPACE*/, &len);
if (UNIV_UNLIKELY(len != 4)) {
@@ -1423,16 +1431,47 @@ dict_load_indexes(
goto next_rec;
} else if (err_msg) {
fprintf(stderr, "InnoDB: %s\n", err_msg);
+ if (ignore_err & DICT_ERR_IGNORE_CORRUPT) {
+ goto next_rec;
+ }
error = DB_CORRUPTION;
goto func_exit;
}
ut_ad(index);
+ /* Check whether the index is corrupted */
+ if (dict_index_is_corrupted(index)) {
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: ", stderr);
+ dict_index_name_print(stderr, NULL, index);
+ fputs(" is corrupted\n", stderr);
+
+ if (!srv_load_corrupted
+ && !(ignore_err & DICT_ERR_IGNORE_CORRUPT)
+ && dict_index_is_clust(index)) {
+ dict_mem_index_free(index);
+
+ error = DB_INDEX_CORRUPT;
+ goto func_exit;
+ } else {
+ /* We will load the index if
+ 1) srv_load_corrupted is TRUE
+ 2) ignore_err is set with
+ DICT_ERR_IGNORE_CORRUPT
+ 3) if the index corrupted is a secondary
+ index */
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: load corrupted index ", stderr);
+ dict_index_name_print(stderr, NULL, index);
+ putc('\n', stderr);
+ }
+ }
+
/* We check for unsupported types first, so that the
subsequent checks are relevant for the supported types. */
- if (index->type & ~(DICT_CLUSTERED | DICT_UNIQUE)) {
-
+ if (index->type & ~(DICT_CLUSTERED | DICT_UNIQUE
+ | DICT_CORRUPT)) {
fprintf(stderr,
"InnoDB: Error: unknown type %lu"
" of index %s of table %s\n",
@@ -1453,9 +1492,14 @@ dict_load_indexes(
/* If caller can tolerate this error,
we will continue to load the index and
let caller deal with this error. However
- mark the index and table corrupted */
- index->corrupted = TRUE;
- table->corrupted = TRUE;
+ mark the index and table corrupted. We
+ only need to mark such in the index
+ dictionary cache for such metadata corruption,
+ since we would always be able to set it
+ when loading the dictionary cache */
+ dict_set_corrupted_index_cache_only(
+ index, table);
+
fprintf(stderr,
"InnoDB: Index is corrupt but forcing"
" load into data dictionary\n");
@@ -1495,9 +1539,10 @@ corrupted:
index->name, table->name);
/* If the force recovery flag is set, and
- if the failed index is not the primary index, we
- will continue and open other indexes */
- if (srv_force_recovery
+ if the failed index is not the clustered index,
+ we will continue and open other indexes */
+ if ((srv_force_recovery
+ || srv_load_corrupted)
&& !dict_index_is_clust(index)) {
error = DB_SUCCESS;
goto next_rec;
@@ -1812,6 +1857,30 @@ err_exit:
err = dict_load_indexes(table, heap, ignore_err);
+ if (err == DB_INDEX_CORRUPT) {
+ /* Refuse to load the table if the table has a corrupted
+ cluster index */
+ if (!srv_load_corrupted) {
+ fprintf(stderr, "InnoDB: Error: Load table ");
+ ut_print_name(stderr, NULL, TRUE, table->name);
+ fprintf(stderr, " failed, the table has corrupted"
+ " clustered indexes. Turn on"
+ " 'innodb_force_load_corrupted'"
+ " to drop it\n");
+
+ dict_table_remove_from_cache(table);
+ table = NULL;
+ goto func_exit;
+ } else {
+ dict_index_t* clust_index;
+ clust_index = dict_table_get_first_index(table);
+
+ if (dict_index_is_corrupted(clust_index)) {
+ table->corrupted = TRUE;
+ }
+ }
+ }
+
/* Initialize table foreign_child value. Its value could be
changed when dict_load_foreigns() is called below */
table->fk_max_recusive_level = 0;
@@ -1838,9 +1907,15 @@ err_exit:
index = dict_table_get_first_index(table);
if (!srv_force_recovery || !index
- || !dict_index_is_clust(index)) {
+ || !dict_index_is_clust(index)) {
dict_table_remove_from_cache(table);
table = NULL;
+ } else if (dict_index_is_corrupted(index)) {
+
+ /* It is possible we force to load a corrupted
+ clustered index if srv_load_corrupted is set.
+ Mark the table as corrupted in this case */
+ table->corrupted = TRUE;
}
}
#if 0
@@ -1867,6 +1942,7 @@ err_exit:
mutex_exit(&dict_foreign_err_mutex);
}
#endif /* 0 */
+func_exit:
mem_heap_free(heap);
return(table);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b26a1522cf5..af730f57cb5 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2000, 2011, MySQL AB & Innobase Oy. All Rights Reserved.
+Copyright (c) 2000, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -615,6 +615,8 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_buffer_pool_pages_misc, SHOW_LONG},
{"buffer_pool_pages_total",
(char*) &export_vars.innodb_buffer_pool_pages_total, SHOW_LONG},
+ {"buffer_pool_read_ahead_rnd",
+ (char*) &export_vars.innodb_buffer_pool_read_ahead_rnd, SHOW_LONG},
{"buffer_pool_read_ahead",
(char*) &export_vars.innodb_buffer_pool_read_ahead, SHOW_LONG},
{"buffer_pool_read_ahead_evicted",
@@ -991,7 +993,6 @@ convert_error_code_to_mysql(
misleading, a new MySQL error
code should be introduced */
- case DB_COL_APPEARS_TWICE_IN_INDEX:
case DB_CORRUPTION:
return(HA_ERR_CRASHED);
@@ -1043,6 +1044,10 @@ convert_error_code_to_mysql(
#endif /* HA_ERR_TOO_MANY_CONCURRENT_TRXS */
case DB_UNSUPPORTED:
return(HA_ERR_UNSUPPORTED);
+ case DB_INDEX_CORRUPT:
+ return(HA_ERR_INDEX_CORRUPT);
+ case DB_UNDO_RECORD_TOO_BIG:
+ return(HA_ERR_UNDO_REC_TOO_BIG);
}
}
@@ -2074,6 +2079,29 @@ no_db_name:
}
+/*****************************************************************//**
+A wrapper function of innobase_convert_name(), convert a table or
+index name to the MySQL system_charset_info (UTF-8) and quote it if needed.
+@return pointer to the end of buf */
+static inline
+void
+innobase_format_name(
+/*==================*/
+ char* buf, /*!< out: buffer for converted identifier */
+ ulint buflen, /*!< in: length of buf, in bytes */
+ const char* name, /*!< in: index or table name to format */
+ ibool is_index_name) /*!< in: index name */
+{
+ const char* bufend;
+
+ bufend = innobase_convert_name(buf, buflen, name, strlen(name),
+ NULL, !is_index_name);
+
+ ut_ad((ulint) (bufend - buf) < buflen);
+
+ buf[bufend - buf] = '\0';
+}
+
/**********************************************************************//**
Determines if the currently running transaction has been interrupted.
@return TRUE if interrupted */
@@ -4089,25 +4117,6 @@ field_in_record_is_null(
return(0);
}
-/**************************************************************//**
-Sets a field in a record to SQL NULL. Uses the record format
-information in table to track the null bit in record. */
-static inline
-void
-set_field_in_record_to_null(
-/*========================*/
- TABLE* table, /*!< in: MySQL table object */
- Field* field, /*!< in: MySQL field object */
- char* record) /*!< in: a row in MySQL format */
-{
- int null_offset;
-
- null_offset = (uint) ((char*) field->null_ptr
- - (char*) table->record[0]);
-
- record[null_offset] = record[null_offset] | field->null_bit;
-}
-
/*************************************************************//**
InnoDB uses this function to compare two data fields for which the data type
is such that we must use MySQL code to compare them. NOTE that the prototype
@@ -5690,12 +5699,14 @@ ha_innobase::index_read(
index = prebuilt->index;
- if (UNIV_UNLIKELY(index == NULL)) {
+ if (UNIV_UNLIKELY(index == NULL) || dict_index_is_corrupted(index)) {
prebuilt->index_usable = FALSE;
DBUG_RETURN(HA_ERR_CRASHED);
}
if (UNIV_UNLIKELY(!prebuilt->index_usable)) {
- DBUG_RETURN(HA_ERR_TABLE_DEF_CHANGED);
+ DBUG_RETURN(dict_index_is_corrupted(index)
+ ? HA_ERR_INDEX_CORRUPT
+ : HA_ERR_TABLE_DEF_CHANGED);
}
/* Note that if the index for which the search template is built is not
@@ -5881,10 +5892,33 @@ ha_innobase::change_active_index(
prebuilt->index);
if (UNIV_UNLIKELY(!prebuilt->index_usable)) {
- push_warning_printf(user_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- HA_ERR_TABLE_DEF_CHANGED,
- "InnoDB: insufficient history for index %u",
- keynr);
+ if (dict_index_is_corrupted(prebuilt->index)) {
+ char index_name[MAX_FULL_NAME_LEN + 1];
+ char table_name[MAX_FULL_NAME_LEN + 1];
+
+ innobase_format_name(
+ index_name, sizeof index_name,
+ prebuilt->index->name, TRUE);
+
+ innobase_format_name(
+ table_name, sizeof table_name,
+ prebuilt->index->table->name, FALSE);
+
+ push_warning_printf(
+ user_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ HA_ERR_INDEX_CORRUPT,
+ "InnoDB: Index %s for table %s is"
+ " marked as corrupted",
+ index_name, table_name);
+ DBUG_RETURN(1);
+ } else {
+ push_warning_printf(
+ user_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ HA_ERR_TABLE_DEF_CHANGED,
+ "InnoDB: insufficient history for index %u",
+ keynr);
+ }
+
/* The caller seems to ignore this. Thus, we must check
this again in row_search_for_mysql(). */
DBUG_RETURN(convert_error_code_to_mysql(DB_MISSING_HISTORY,
@@ -7545,6 +7579,10 @@ ha_innobase::records_in_range(
n_rows = HA_POS_ERROR;
goto func_exit;
}
+ if (dict_index_is_corrupted(index)) {
+ n_rows = HA_ERR_INDEX_CORRUPT;
+ goto func_exit;
+ }
if (UNIV_UNLIKELY(!row_merge_is_index_usable(prebuilt->trx, index))) {
n_rows = HA_ERR_TABLE_DEF_CHANGED;
goto func_exit;
@@ -7925,6 +7963,8 @@ ha_innobase::info_low(
if (flag & HA_STATUS_VARIABLE) {
+ ulint page_size;
+
dict_table_stats_lock(ib_table, RW_S_LATCH);
n_rows = ib_table->stat_n_rows;
@@ -7967,14 +8007,19 @@ ha_innobase::info_low(
prebuilt->autoinc_last_value = 0;
}
+ page_size = dict_table_zip_size(ib_table);
+ if (page_size == 0) {
+ page_size = UNIV_PAGE_SIZE;
+ }
+
stats.records = (ha_rows)n_rows;
stats.deleted = 0;
- stats.data_file_length = ((ulonglong)
- ib_table->stat_clustered_index_size)
- * UNIV_PAGE_SIZE;
- stats.index_file_length = ((ulonglong)
- ib_table->stat_sum_of_other_index_sizes)
- * UNIV_PAGE_SIZE;
+ stats.data_file_length
+ = ((ulonglong) ib_table->stat_clustered_index_size)
+ * page_size;
+ stats.index_file_length =
+ ((ulonglong) ib_table->stat_sum_of_other_index_sizes)
+ * page_size;
dict_table_stats_unlock(ib_table, RW_S_LATCH);
@@ -8206,6 +8251,7 @@ ha_innobase::check(
ulint n_rows_in_table = ULINT_UNDEFINED;
ibool is_ok = TRUE;
ulint old_isolation_level;
+ ibool table_corrupted;
DBUG_ENTER("ha_innobase::check");
DBUG_ASSERT(thd == ha_thd());
@@ -8247,6 +8293,14 @@ ha_innobase::check(
prebuilt->trx->isolation_level = TRX_ISO_REPEATABLE_READ;
+ /* Check whether the table is already marked as corrupted
+ before running the check table */
+ table_corrupted = prebuilt->table->corrupted;
+
+ /* Reset table->corrupted bit so that check table can proceed to
+ do additional check */
+ prebuilt->table->corrupted = FALSE;
+
/* Enlarge the fatal lock wait timeout during CHECK TABLE. */
mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */
@@ -8255,6 +8309,7 @@ ha_innobase::check(
for (index = dict_table_get_first_index(prebuilt->table);
index != NULL;
index = dict_table_get_next_index(index)) {
+ char index_name[MAX_FULL_NAME_LEN + 1];
#if 0
fputs("Validating index ", stderr);
ut_print_name(stderr, trx, FALSE, index->name);
@@ -8263,11 +8318,16 @@ ha_innobase::check(
if (!btr_validate_index(index, prebuilt->trx)) {
is_ok = FALSE;
+
+ innobase_format_name(
+ index_name, sizeof index_name,
+ prebuilt->index->name, TRUE);
+
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_NOT_KEYFILE,
"InnoDB: The B-tree of"
- " index '%-.200s' is corrupted.",
- index->name);
+ " index %s is corrupted.",
+ index_name);
continue;
}
@@ -8280,11 +8340,26 @@ ha_innobase::check(
prebuilt->trx, prebuilt->index);
if (UNIV_UNLIKELY(!prebuilt->index_usable)) {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- HA_ERR_TABLE_DEF_CHANGED,
- "InnoDB: Insufficient history for"
- " index '%-.200s'",
- index->name);
+ innobase_format_name(
+ index_name, sizeof index_name,
+ prebuilt->index->name, TRUE);
+
+ if (dict_index_is_corrupted(prebuilt->index)) {
+ push_warning_printf(
+ user_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ HA_ERR_INDEX_CORRUPT,
+ "InnoDB: Index %s is marked as"
+ " corrupted",
+ index_name);
+ is_ok = FALSE;
+ } else {
+ push_warning_printf(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ HA_ERR_TABLE_DEF_CHANGED,
+ "InnoDB: Insufficient history for"
+ " index %s",
+ index_name);
+ }
continue;
}
@@ -8298,12 +8373,19 @@ ha_innobase::check(
prebuilt->select_lock_type = LOCK_NONE;
if (!row_check_index_for_mysql(prebuilt, index, &n_rows)) {
+ innobase_format_name(
+ index_name, sizeof index_name,
+ index->name, TRUE);
+
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_NOT_KEYFILE,
"InnoDB: The B-tree of"
- " index '%-.200s' is corrupted.",
- index->name);
+ " index %s is corrupted.",
+ index_name);
is_ok = FALSE;
+ row_mysql_lock_data_dictionary(prebuilt->trx);
+ dict_set_corrupted(index);
+ row_mysql_unlock_data_dictionary(prebuilt->trx);
}
if (thd_killed(user_thd)) {
@@ -8330,6 +8412,20 @@ ha_innobase::check(
}
}
+ if (table_corrupted) {
+ /* If some previous operation has marked the table as
+ corrupted in memory, and has not propagated such to
+ clustered index, we will do so here */
+ index = dict_table_get_first_index(prebuilt->table);
+
+ if (!dict_index_is_corrupted(index)) {
+ mutex_enter(&dict_sys->mutex);
+ dict_set_corrupted(index);
+ mutex_exit(&dict_sys->mutex);
+ }
+ prebuilt->table->corrupted = TRUE;
+ }
+
/* Restore the original isolation level */
prebuilt->trx->isolation_level = old_isolation_level;
@@ -11096,6 +11192,11 @@ static MYSQL_SYSVAR_BOOL(large_prefix, innobase_large_prefix,
"Support large index prefix length of REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes.",
NULL, NULL, FALSE);
+static MYSQL_SYSVAR_BOOL(force_load_corrupted, srv_load_corrupted,
+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "Force InnoDB to load metadata of corrupted table.",
+ NULL, NULL, FALSE);
+
static MYSQL_SYSVAR_BOOL(locks_unsafe_for_binlog, innobase_locks_unsafe_for_binlog,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Force InnoDB to not use next-key locking, to use only row-level locking.",
@@ -11321,6 +11422,11 @@ static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
NULL, NULL, 0, 0, 1, 0);
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+static MYSQL_SYSVAR_BOOL(random_read_ahead, srv_random_read_ahead,
+ PLUGIN_VAR_NOCMDARG,
+ "Whether to use read ahead for random access within an extent.",
+ NULL, NULL, FALSE);
+
static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold,
PLUGIN_VAR_RQCMDARG,
"Number of pages that must be accessed sequentially for InnoDB to "
@@ -11350,6 +11456,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(flush_method),
MYSQL_SYSVAR(force_recovery),
MYSQL_SYSVAR(large_prefix),
+ MYSQL_SYSVAR(force_load_corrupted),
MYSQL_SYSVAR(locks_unsafe_for_binlog),
MYSQL_SYSVAR(lock_wait_timeout),
#ifdef UNIV_LOG_ARCHIVE
@@ -11389,6 +11496,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
MYSQL_SYSVAR(change_buffering_debug),
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+ MYSQL_SYSVAR(random_read_ahead),
MYSQL_SYSVAR(read_ahead_threshold),
MYSQL_SYSVAR(io_capacity),
MYSQL_SYSVAR(purge_threads),
@@ -11410,7 +11518,8 @@ mysql_declare_plugin(innobase)
INNODB_VERSION_SHORT,
innodb_status_variables_export,/* status variables */
innobase_system_variables, /* system variables */
- NULL /* reserved */
+ NULL, /* reserved */
+ 0, /* flags */
},
i_s_innodb_trx,
i_s_innodb_locks,
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index ad413c3cacd..af168c3f848 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -638,7 +638,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_trx =
/* reserved for dependency checking */
/* void* */
- STRUCT_FLD(__reserved1, NULL)
+ STRUCT_FLD(__reserved1, NULL),
+
+ /* Plugin flags */
+ /* unsigned long */
+ STRUCT_FLD(flags, 0UL),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
@@ -904,7 +908,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_locks =
/* reserved for dependency checking */
/* void* */
- STRUCT_FLD(__reserved1, NULL)
+ STRUCT_FLD(__reserved1, NULL),
+
+ /* Plugin flags */
+ /* unsigned long */
+ STRUCT_FLD(flags, 0UL),
};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
@@ -1087,7 +1095,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits =
/* reserved for dependency checking */
/* void* */
- STRUCT_FLD(__reserved1, NULL)
+ STRUCT_FLD(__reserved1, NULL),
+
+ /* Plugin flags */
+ /* unsigned long */
+ STRUCT_FLD(flags, 0UL),
};
/*******************************************************************//**
@@ -1420,7 +1432,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp =
/* reserved for dependency checking */
/* void* */
- STRUCT_FLD(__reserved1, NULL)
+ STRUCT_FLD(__reserved1, NULL),
+
+ /* Plugin flags */
+ /* unsigned long */
+ STRUCT_FLD(flags, 0UL),
};
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
@@ -1470,7 +1486,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
/* reserved for dependency checking */
/* void* */
- STRUCT_FLD(__reserved1, NULL)
+ STRUCT_FLD(__reserved1, NULL),
+
+ /* Plugin flags */
+ /* unsigned long */
+ STRUCT_FLD(flags, 0UL),
};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
@@ -1711,7 +1731,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem =
/* reserved for dependency checking */
/* void* */
- STRUCT_FLD(__reserved1, NULL)
+ STRUCT_FLD(__reserved1, NULL),
+
+ /* Plugin flags */
+ /* unsigned long */
+ STRUCT_FLD(flags, 0UL),
};
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
@@ -1761,7 +1785,11 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
/* reserved for dependency checking */
/* void* */
- STRUCT_FLD(__reserved1, NULL)
+ STRUCT_FLD(__reserved1, NULL),
+
+ /* Plugin flags */
+ /* unsigned long */
+ STRUCT_FLD(flags, 0UL),
};
/*******************************************************************//**
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index 7d94ebc6438..7f6acb2b042 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -402,7 +402,7 @@ ibuf_tree_root_get(
block = buf_page_get(
IBUF_SPACE_ID, 0, FSP_IBUF_TREE_ROOT_PAGE_NO, RW_X_LATCH, mtr);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
root = buf_block_get_frame(block);
@@ -549,7 +549,7 @@ ibuf_init_at_db_start(void)
block = buf_page_get(
IBUF_SPACE_ID, 0, FSP_IBUF_TREE_ROOT_PAGE_NO,
RW_X_LATCH, &mtr);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
root = buf_block_get_frame(block);
}
@@ -2209,16 +2209,17 @@ ibuf_add_free_page(void)
} else {
buf_block_t* block = buf_page_get(
IBUF_SPACE_ID, 0, page_no, RW_X_LATCH, &mtr);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
- page = buf_block_get_frame(block);
- }
+ ibuf_enter(&mtr);
- ibuf_enter(&mtr);
+ mutex_enter(&ibuf_mutex);
- mutex_enter(&ibuf_mutex);
+ root = ibuf_tree_root_get(&mtr);
- root = ibuf_tree_root_get(&mtr);
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
+
+ page = buf_block_get_frame(block);
+ }
/* Add the page to the free list and update the ibuf size data */
@@ -2332,8 +2333,7 @@ ibuf_remove_free_page(void)
block = buf_page_get(
IBUF_SPACE_ID, 0, page_no, RW_X_LATCH, &mtr);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
-
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
page = buf_block_get_frame(block);
}
@@ -3022,7 +3022,7 @@ ibuf_get_volume_buffered(
IBUF_SPACE_ID, 0, prev_page_no, RW_X_LATCH,
mtr);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
prev_page = buf_block_get_frame(block);
@@ -3095,7 +3095,7 @@ count_later:
IBUF_SPACE_ID, 0, next_page_no, RW_X_LATCH,
mtr);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
next_page = buf_block_get_frame(block);
@@ -3333,7 +3333,7 @@ ibuf_set_entry_counter(
IBUF_SPACE_ID, 0, prev_page_no,
RW_X_LATCH, mtr);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
prev_page = buf_block_get_frame(block);
@@ -4419,6 +4419,7 @@ ibuf_merge_or_delete_for_page(
ut_ad(!block || buf_block_get_space(block) == space);
ut_ad(!block || buf_block_get_page_no(block) == page_no);
ut_ad(!block || buf_block_get_zip_size(block) == zip_size);
+ ut_ad(!block || buf_block_get_io_fix(block) == BUF_IO_READ);
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE
|| trx_sys_hdr_page(space, page_no)) {
@@ -4571,7 +4572,13 @@ loop:
ut_a(success);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ /* This is a user page (secondary index leaf page),
+ but we pretend that it is a change buffer page in
+ order to obey the latching order. This should be OK,
+ because buffered changes are applied immediately while
+ the block is io-fixed. Other threads must not try to
+ latch an io-fixed block. */
+ buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
}
/* Position pcur in the insert buffer at the first entry for this
@@ -4675,7 +4682,12 @@ loop:
__FILE__, __LINE__, &mtr);
ut_a(success);
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ /* This is a user page (secondary
+ index leaf page), but it should be OK
+ to use too low latching order for it,
+ as the block is io-fixed. */
+ buf_block_dbg_add_level(
+ block, SYNC_IBUF_TREE_NODE);
if (!ibuf_restore_pos(space, page_no,
search_tuple,
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
index 5b3e166371d..71e772388a0 100644
--- a/storage/innobase/include/btr0btr.h
+++ b/storage/innobase/include/btr0btr.h
@@ -199,26 +199,45 @@ btr_block_get_func(
ulint mode, /*!< in: latch mode */
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
- mtr_t* mtr) /*!< in/out: mtr */
- __attribute__((nonnull));
+# ifdef UNIV_SYNC_DEBUG
+ const dict_index_t* index, /*!< in: index tree, may be NULL
+ if it is not an insert buffer tree */
+# endif /* UNIV_SYNC_DEBUG */
+ mtr_t* mtr); /*!< in/out: mini-transaction */
+# ifdef UNIV_SYNC_DEBUG
+/** Gets a buffer page and declares its latching order level.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes or 0 for uncompressed pages
+@param page_no page number
+@param mode latch mode
+@param index index tree, may be NULL if not the insert buffer tree
+@param mtr mini-transaction handle
+@return the block descriptor */
+# define btr_block_get(space,zip_size,page_no,mode,index,mtr) \
+ btr_block_get_func(space,zip_size,page_no,mode, \
+ __FILE__,__LINE__,index,mtr)
+# else /* UNIV_SYNC_DEBUG */
/** Gets a buffer page and declares its latching order level.
@param space tablespace identifier
@param zip_size compressed page size in bytes or 0 for uncompressed pages
@param page_no page number
@param mode latch mode
+@param idx index tree, may be NULL if not the insert buffer tree
@param mtr mini-transaction handle
@return the block descriptor */
-# define btr_block_get(space,zip_size,page_no,mode,mtr) \
+# define btr_block_get(space,zip_size,page_no,mode,idx,mtr) \
btr_block_get_func(space,zip_size,page_no,mode,__FILE__,__LINE__,mtr)
+# endif /* UNIV_SYNC_DEBUG */
/** Gets a buffer page and declares its latching order level.
@param space tablespace identifier
@param zip_size compressed page size in bytes or 0 for uncompressed pages
@param page_no page number
@param mode latch mode
+@param idx index tree, may be NULL if not the insert buffer tree
@param mtr mini-transaction handle
@return the uncompressed page frame */
-# define btr_page_get(space,zip_size,page_no,mode,mtr) \
- buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,mtr))
+# define btr_page_get(space,zip_size,page_no,mode,idx,mtr) \
+ buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,idx,mtr))
#endif /* !UNIV_HOTBACKUP */
/**************************************************************//**
Gets the index id field of a page.
@@ -344,8 +363,7 @@ btr_free_root(
ulint zip_size, /*!< in: compressed page size in bytes
or 0 for uncompressed pages */
ulint root_page_no, /*!< in: root page number */
- mtr_t* mtr); /*!< in: a mini-transaction which has already
- been started */
+ mtr_t* mtr); /*!< in/out: mini-transaction */
/*************************************************************//**
Makes tree one level higher by splitting the root, and inserts
the tuple. It is assumed that mtr contains an x-latch on the tree.
diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic
index ccf41904fd0..1bd22a0ebc6 100644
--- a/storage/innobase/include/btr0btr.ic
+++ b/storage/innobase/include/btr0btr.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -48,6 +48,10 @@ btr_block_get_func(
ulint mode, /*!< in: latch mode */
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
+#ifdef UNIV_SYNC_DEBUG
+ const dict_index_t* index, /*!< in: index tree, may be NULL
+ if it is not an insert buffer tree */
+#endif /* UNIV_SYNC_DEBUG */
mtr_t* mtr) /*!< in/out: mtr */
{
buf_block_t* block;
@@ -57,7 +61,9 @@ btr_block_get_func(
if (mode != RW_NO_LATCH) {
- buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+ buf_block_dbg_add_level(
+ block, index != NULL && dict_index_is_ibuf(index)
+ ? SYNC_IBUF_TREE_NODE : SYNC_TREE_NODE);
}
return(block);
diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h
index 6c11c973fc9..f605c476844 100644
--- a/storage/innobase/include/btr0pcur.h
+++ b/storage/innobase/include/btr0pcur.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -244,18 +244,6 @@ btr_pcur_restore_position_func(
mtr_t* mtr); /*!< in: mtr */
#define btr_pcur_restore_position(l,cur,mtr) \
btr_pcur_restore_position_func(l,cur,__FILE__,__LINE__,mtr)
-/**************************************************************//**
-If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
-releases the page latch and bufferfix reserved by the cursor.
-NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
-made by the current mini-transaction to the data protected by the
-cursor latch, as then the latch must not be released until mtr_commit. */
-UNIV_INTERN
-void
-btr_pcur_release_leaf(
-/*==================*/
- btr_pcur_t* cursor, /*!< in: persistent cursor */
- mtr_t* mtr); /*!< in: mtr */
/*********************************************************//**
Gets the rel_pos field for a cursor whose position has been stored.
@return BTR_PCUR_ON, ... */
@@ -266,10 +254,9 @@ btr_pcur_get_rel_pos(
const btr_pcur_t* cursor);/*!< in: persistent cursor */
/**************************************************************//**
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
-that is, the cursor becomes detached. If there have been modifications
-to the page where pcur is positioned, this can be used instead of
-btr_pcur_release_leaf. Function btr_pcur_store_position should be used
-before calling this, if restoration of cursor is wanted later. */
+that is, the cursor becomes detached.
+Function btr_pcur_store_position should be used before calling this,
+if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit_specify_mtr(
diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic
index 59fdb21824b..d86601e5a32 100644
--- a/storage/innobase/include/btr0pcur.ic
+++ b/storage/innobase/include/btr0pcur.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -369,10 +369,9 @@ btr_pcur_move_to_next(
/**************************************************************//**
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
-that is, the cursor becomes detached. If there have been modifications
-to the page where pcur is positioned, this can be used instead of
-btr_pcur_release_leaf. Function btr_pcur_store_position should be used
-before calling this, if restoration of cursor is wanted later. */
+that is, the cursor becomes detached.
+Function btr_pcur_store_position should be used before calling this,
+if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit_specify_mtr(
diff --git a/storage/innobase/include/buf0buddy.h b/storage/innobase/include/buf0buddy.h
index b255d8c9351..2d7d6146092 100644
--- a/storage/innobase/include/buf0buddy.h
+++ b/storage/innobase/include/buf0buddy.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -37,37 +37,37 @@ Created December 2006 by Marko Makela
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
buf_pool->mutex and must not hold buf_pool->zip_mutex or any
-block->mutex. The buf_pool->mutex may only be released and reacquired
-if lru != NULL. This function should only be used for allocating
-compressed page frames or control blocks (buf_page_t). Allocated
-control blocks must be properly initialized immediately after
-buf_buddy_alloc() has returned the memory, before releasing
-buf_pool->mutex.
-@return allocated block, possibly NULL if lru == NULL */
+block->mutex. The buf_pool->mutex may be released and reacquired.
+This function should only be used for allocating compressed page frames.
+@return allocated block, never NULL */
UNIV_INLINE
-void*
+byte*
buf_buddy_alloc(
/*============*/
- buf_pool_t* buf_pool,
- /*!< buffer pool in which the block resides */
- ulint size, /*!< in: block size, up to UNIV_PAGE_SIZE */
- ibool* lru) /*!< in: pointer to a variable that will be assigned
- TRUE if storage was allocated from the LRU list
- and buf_pool->mutex was temporarily released,
- or NULL if the LRU list should not be used */
- __attribute__((malloc));
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
+ the page resides */
+ ulint size, /*!< in: compressed page size
+ (between PAGE_ZIP_MIN_SIZE and
+ UNIV_PAGE_SIZE) */
+ ibool* lru) /*!< in: pointer to a variable
+ that will be assigned TRUE if
+ storage was allocated from the
+ LRU list and buf_pool->mutex was
+ temporarily released */
+ __attribute__((malloc, nonnull));
/**********************************************************************//**
-Release a block. */
+Deallocate a block. */
UNIV_INLINE
void
buf_buddy_free(
/*===========*/
- buf_pool_t* buf_pool,
- /*!< buffer pool in which the block resides */
- void* buf, /*!< in: block to be freed, must not be
- pointed to by the buffer pool */
- ulint size) /*!< in: block size, up to UNIV_PAGE_SIZE */
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
+ the block resides */
+ void* buf, /*!< in: block to be freed, must not
+ be pointed to by the buffer pool */
+ ulint size) /*!< in: block size,
+ up to UNIV_PAGE_SIZE */
__attribute__((nonnull));
#ifndef UNIV_NONINL
diff --git a/storage/innobase/include/buf0buddy.ic b/storage/innobase/include/buf0buddy.ic
index e50c33ea15a..b8281f7341a 100644
--- a/storage/innobase/include/buf0buddy.ic
+++ b/storage/innobase/include/buf0buddy.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -36,21 +36,21 @@ Created December 2006 by Marko Makela
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
buf_pool->mutex and must not hold buf_pool->zip_mutex or any block->mutex.
-The buf_pool->mutex may only be released and reacquired if lru != NULL.
-@return allocated block, possibly NULL if lru==NULL */
+The buf_pool_mutex may be released and reacquired.
+@return allocated block, never NULL */
UNIV_INTERN
void*
buf_buddy_alloc_low(
/*================*/
- buf_pool_t* buf_pool,
- /*!< in: buffer pool in which the page resides */
- ulint i, /*!< in: index of buf_pool->zip_free[],
- or BUF_BUDDY_SIZES */
- ibool* lru) /*!< in: pointer to a variable that will be assigned
- TRUE if storage was allocated from the LRU list
- and buf_pool->mutex was temporarily released,
- or NULL if the LRU list should not be used */
- __attribute__((malloc));
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
+ ulint i, /*!< in: index of buf_pool->zip_free[],
+ or BUF_BUDDY_SIZES */
+ ibool* lru) /*!< in: pointer to a variable that
+ will be assigned TRUE if storage was
+ allocated from the LRU list and
+ buf_pool->mutex was temporarily
+ released */
+ __attribute__((malloc, nonnull));
/**********************************************************************//**
Deallocate a block. */
@@ -77,6 +77,8 @@ buf_buddy_get_slot(
ulint i;
ulint s;
+ ut_ad(size >= PAGE_ZIP_MIN_SIZE);
+
for (i = 0, s = BUF_BUDDY_LOW; s < size; i++, s <<= 1) {
}
@@ -87,31 +89,31 @@ buf_buddy_get_slot(
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
buf_pool->mutex and must not hold buf_pool->zip_mutex or any
-block->mutex. The buf_pool->mutex may only be released and reacquired
-if lru != NULL. This function should only be used for allocating
-compressed page frames or control blocks (buf_page_t). Allocated
-control blocks must be properly initialized immediately after
-buf_buddy_alloc() has returned the memory, before releasing
-buf_pool->mutex.
-@return allocated block, possibly NULL if lru == NULL */
+block->mutex. The buf_pool->mutex may be released and reacquired.
+This function should only be used for allocating compressed page frames.
+@return allocated block, never NULL */
UNIV_INLINE
-void*
+byte*
buf_buddy_alloc(
/*============*/
- buf_pool_t* buf_pool, /*!< in: buffer pool in which
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
the page resides */
- ulint size, /*!< in: block size, up to
- UNIV_PAGE_SIZE */
+ ulint size, /*!< in: compressed page size
+ (between PAGE_ZIP_MIN_SIZE and
+ UNIV_PAGE_SIZE) */
ibool* lru) /*!< in: pointer to a variable
that will be assigned TRUE if
storage was allocated from the
LRU list and buf_pool->mutex was
- temporarily released, or NULL if
- the LRU list should not be used */
+ temporarily released */
{
ut_ad(buf_pool_mutex_own(buf_pool));
+ ut_ad(ut_is_2pow(size));
+ ut_ad(size >= PAGE_ZIP_MIN_SIZE);
+ ut_ad(size <= UNIV_PAGE_SIZE);
- return(buf_buddy_alloc_low(buf_pool, buf_buddy_get_slot(size), lru));
+ return((byte*) buf_buddy_alloc_low(buf_pool, buf_buddy_get_slot(size),
+ lru));
}
/**********************************************************************//**
@@ -120,13 +122,17 @@ UNIV_INLINE
void
buf_buddy_free(
/*===========*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
- void* buf, /*!< in: block to be freed, must not be
- pointed to by the buffer pool */
- ulint size) /*!< in: block size, up to
- UNIV_PAGE_SIZE */
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool in which
+ the block resides */
+ void* buf, /*!< in: block to be freed, must not
+ be pointed to by the buffer pool */
+ ulint size) /*!< in: block size,
+ up to UNIV_PAGE_SIZE */
{
ut_ad(buf_pool_mutex_own(buf_pool));
+ ut_ad(ut_is_2pow(size));
+ ut_ad(size >= PAGE_ZIP_MIN_SIZE);
+ ut_ad(size <= UNIV_PAGE_SIZE);
buf_buddy_free_low(buf_pool, buf, buf_buddy_get_slot(size));
}
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index d83d484bace..ccebb69a4fe 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -147,6 +147,8 @@ struct buf_pool_info_struct{
ulint n_pages_created; /*!< buf_pool->n_pages_created */
ulint n_pages_written; /*!< buf_pool->n_pages_written */
ulint n_page_gets; /*!< buf_pool->n_page_gets */
+ ulint n_ra_pages_read_rnd; /*!< buf_pool->n_ra_pages_read_rnd,
+ number of pages readahead */
ulint n_ra_pages_read; /*!< buf_pool->n_ra_pages_read, number
of pages readahead */
ulint n_ra_pages_evicted; /*!< buf_pool->n_ra_pages_evicted,
@@ -171,6 +173,8 @@ struct buf_pool_info_struct{
last printout */
/* Statistics about read ahead algorithm. */
+ double pages_readahead_rnd_rate;/*!< random readahead rate in pages per
+ second */
double pages_readahead_rate; /*!< readahead rate in pages per
second */
double pages_evicted_rate; /*!< rate of readahead page evicted
@@ -246,12 +250,6 @@ buf_relocate(
BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_ZIP_PAGE */
buf_page_t* dpage) /*!< in/out: destination control block */
__attribute__((nonnull));
-/********************************************************************//**
-Resizes the buffer pool. */
-UNIV_INTERN
-void
-buf_pool_resize(void);
-/*=================*/
/*********************************************************************//**
Gets the current size of buffer buf_pool in bytes.
@return size in bytes */
@@ -275,6 +273,23 @@ ib_uint64_t
buf_pool_get_oldest_modification(void);
/*==================================*/
/********************************************************************//**
+Allocates a buf_page_t descriptor. This function must succeed. In case
+of failure we assert in this function. */
+UNIV_INLINE
+buf_page_t*
+buf_page_alloc_descriptor(void)
+/*===========================*/
+ __attribute__((malloc));
+/********************************************************************//**
+Free a buf_page_t descriptor. */
+UNIV_INLINE
+void
+buf_page_free_descriptor(
+/*=====================*/
+ buf_page_t* bpage) /*!< in: bpage descriptor to free. */
+ __attribute__((nonnull));
+
+/********************************************************************//**
Allocates a buffer block.
@return own: the allocated block, in state BUF_BLOCK_MEMORY */
UNIV_INTERN
@@ -531,6 +546,18 @@ buf_block_get_freed_page_clock(
__attribute__((pure));
/********************************************************************//**
+Tells if a block is still close enough to the MRU end of the LRU list
+meaning that it is not in danger of getting evicted and also implying
+that it has been accessed recently.
+Note that this is for heuristics only and does not reserve buffer pool
+mutex.
+@return TRUE if block is close to MRU end of LRU */
+UNIV_INLINE
+ibool
+buf_page_peek_if_young(
+/*===================*/
+ const buf_page_t* bpage); /*!< in: block */
+/********************************************************************//**
Recommends a move of a block to the start of the LRU list if there is danger
of dropping from the buffer pool. NOTE: does not reserve the buffer pool
mutex.
@@ -1196,7 +1223,7 @@ ulint
buf_get_free_list_len(void);
/*=======================*/
-/********************************************************************
+/********************************************************************//**
Determine if a block is a sentinel for a buffer pool watch.
@return TRUE if a sentinel for a buffer pool watch, FALSE if not */
UNIV_INTERN
@@ -1569,6 +1596,8 @@ struct buf_pool_stat_struct{
ulint n_pages_written;/*!< number write operations */
ulint n_pages_created;/*!< number of pages created
in the pool with no read */
+ ulint n_ra_pages_read_rnd;/*!< number of pages read in
+ as part of random read ahead */
ulint n_ra_pages_read;/*!< number of pages read in
as part of read ahead */
ulint n_ra_pages_evicted;/*!< number of read ahead
@@ -1708,7 +1737,7 @@ struct buf_pool_struct{
UT_LIST_BASE_NODE_T(buf_page_t) LRU;
/*!< base node of the LRU list */
buf_page_t* LRU_old; /*!< pointer to the about
- buf_LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV
+ LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV
oldest blocks in the LRU list;
NULL if LRU length less than
BUF_LRU_OLD_MIN_LEN;
@@ -1732,8 +1761,10 @@ struct buf_pool_struct{
frames and buf_page_t descriptors of blocks that exist
in the buffer pool only in compressed form. */
/* @{ */
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
/*!< unmodified compressed pages */
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
/*!< buddy free lists */
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index e2e83de0a78..b65b5133c15 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -125,6 +125,29 @@ buf_block_get_freed_page_clock(
}
/********************************************************************//**
+Tells if a block is still close enough to the MRU end of the LRU list
+meaning that it is not in danger of getting evicted and also implying
+that it has been accessed recently.
+Note that this is for heuristics only and does not reserve buffer pool
+mutex.
+@return TRUE if block is close to MRU end of LRU */
+UNIV_INLINE
+ibool
+buf_page_peek_if_young(
+/*===================*/
+ const buf_page_t* bpage) /*!< in: block */
+{
+ buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+
+ /* FIXME: bpage->freed_page_clock is 31 bits */
+ return((buf_pool->freed_page_clock & ((1UL << 31) - 1))
+ < ((ulint) bpage->freed_page_clock
+ + (buf_pool->curr_size
+ * (BUF_LRU_OLD_RATIO_DIV - buf_pool->LRU_old_ratio)
+ / (BUF_LRU_OLD_RATIO_DIV * 4))));
+}
+
+/********************************************************************//**
Recommends a move of a block to the start of the LRU list if there is danger
of dropping from the buffer pool. NOTE: does not reserve the buffer pool
mutex.
@@ -154,12 +177,7 @@ buf_page_peek_if_too_old(
buf_pool->stat.n_pages_not_made_young++;
return(FALSE);
} else {
- /* FIXME: bpage->freed_page_clock is 31 bits */
- return((buf_pool->freed_page_clock & ((1UL << 31) - 1))
- > ((ulint) bpage->freed_page_clock
- + (buf_pool->curr_size
- * (BUF_LRU_OLD_RATIO_DIV - buf_pool->LRU_old_ratio)
- / (BUF_LRU_OLD_RATIO_DIV * 4))));
+ return(!buf_page_peek_if_young(bpage));
}
}
@@ -754,6 +772,35 @@ buf_block_get_lock_hash_val(
}
/********************************************************************//**
+Allocates a buf_page_t descriptor. This function must succeed. In case
+of failure we assert in this function.
+@return: the allocated descriptor. */
+UNIV_INLINE
+buf_page_t*
+buf_page_alloc_descriptor(void)
+/*===========================*/
+{
+ buf_page_t* bpage;
+
+ bpage = (buf_page_t*) ut_malloc(sizeof *bpage);
+ ut_d(memset(bpage, 0, sizeof *bpage));
+ UNIV_MEM_ALLOC(bpage, sizeof *bpage);
+
+ return(bpage);
+}
+
+/********************************************************************//**
+Free a buf_page_t descriptor. */
+UNIV_INLINE
+void
+buf_page_free_descriptor(
+/*=====================*/
+ buf_page_t* bpage) /*!< in: bpage descriptor to free. */
+{
+ ut_free(bpage);
+}
+
+/********************************************************************//**
Frees a buffer block which does not contain a file page. */
UNIV_INLINE
void
diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h
index 9b150188b03..eb40621abbe 100644
--- a/storage/innobase/include/buf0lru.h
+++ b/storage/innobase/include/buf0lru.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -30,18 +30,6 @@ Created 11/5/1995 Heikki Tuuri
#include "ut0byte.h"
#include "buf0types.h"
-/** The return type of buf_LRU_free_block() */
-enum buf_lru_free_block_status {
- /** freed */
- BUF_LRU_FREED = 0,
- /** not freed because the caller asked to remove the
- uncompressed frame but the control block cannot be
- relocated */
- BUF_LRU_CANNOT_RELOCATE,
- /** not freed because of some other reason */
- BUF_LRU_NOT_FREED
-};
-
/******************************************************************//**
Tries to remove LRU flushed blocks from the end of the LRU list and put them
to the free list. This is beneficial for the efficiency of the insert buffer
@@ -85,6 +73,7 @@ void
buf_LRU_invalidate_tablespace(
/*==========================*/
ulint id); /*!< in: space id */
+#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/********************************************************************//**
Insert a compressed block into buf_pool->zip_clean in the LRU order. */
UNIV_INTERN
@@ -92,22 +81,22 @@ void
buf_LRU_insert_zip_clean(
/*=====================*/
buf_page_t* bpage); /*!< in: pointer to the block in question */
+#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
/******************************************************************//**
Try to free a block. If bpage is a descriptor of a compressed-only
page, the descriptor object will be freed as well.
-NOTE: If this function returns BUF_LRU_FREED, it will temporarily
+NOTE: If this function returns TRUE, it will temporarily
release buf_pool->mutex. Furthermore, the page frame will no longer be
accessible via bpage.
The caller must hold buf_pool->mutex and buf_page_get_mutex(bpage) and
release these two mutexes after the call. No other
buf_page_get_mutex() may be held when calling this function.
-@return BUF_LRU_FREED if freed, BUF_LRU_CANNOT_RELOCATE or
-BUF_LRU_NOT_FREED otherwise. */
+@return TRUE if freed, FALSE otherwise. */
UNIV_INTERN
-enum buf_lru_free_block_status
+ibool
buf_LRU_free_block(
/*===============*/
buf_page_t* bpage, /*!< in: block to be freed */
@@ -195,7 +184,7 @@ buf_LRU_make_block_old(
/*===================*/
buf_page_t* bpage); /*!< in: control block */
/**********************************************************************//**
-Updates buf_LRU_old_ratio.
+Updates buf_pool->LRU_old_ratio.
@return updated old_pct */
UNIV_INTERN
ulint
@@ -204,7 +193,7 @@ buf_LRU_old_ratio_update(
uint old_pct,/*!< in: Reserve this percentage of
the buffer pool for "old" blocks. */
ibool adjust);/*!< in: TRUE=adjust the LRU list;
- FALSE=just assign buf_LRU_old_ratio
+ FALSE=just assign buf_pool->LRU_old_ratio
during the initialization of InnoDB */
/********************************************************************//**
Update the historical stats that we are collecting for LRU eviction
@@ -214,6 +203,17 @@ void
buf_LRU_stat_update(void);
/*=====================*/
+/******************************************************************//**
+Remove one page from LRU list and put it to free list */
+UNIV_INTERN
+void
+buf_LRU_free_one_page(
+/*==================*/
+ buf_page_t* bpage) /*!< in/out: block, must contain a file page and
+ be in a state where it can be freed; there
+ may or may not be a hash index to the page */
+ __attribute__((nonnull));
+
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/**********************************************************************//**
Validates the LRU list.
@@ -233,18 +233,15 @@ buf_LRU_print(void);
#endif /* UNIV_DEBUG_PRINT || UNIV_DEBUG || UNIV_BUF_DEBUG */
/** @name Heuristics for detecting index scan @{ */
-/** Reserve this much/BUF_LRU_OLD_RATIO_DIV of the buffer pool for
-"old" blocks. Protected by buf_pool->mutex. */
-extern uint buf_LRU_old_ratio;
-/** The denominator of buf_LRU_old_ratio. */
+/** The denominator of buf_pool->LRU_old_ratio. */
#define BUF_LRU_OLD_RATIO_DIV 1024
-/** Maximum value of buf_LRU_old_ratio.
+/** Maximum value of buf_pool->LRU_old_ratio.
@see buf_LRU_old_adjust_len
-@see buf_LRU_old_ratio_update */
+@see buf_pool->LRU_old_ratio_update */
#define BUF_LRU_OLD_RATIO_MAX BUF_LRU_OLD_RATIO_DIV
-/** Minimum value of buf_LRU_old_ratio.
+/** Minimum value of buf_pool->LRU_old_ratio.
@see buf_LRU_old_adjust_len
-@see buf_LRU_old_ratio_update
+@see buf_pool->LRU_old_ratio_update
The minimum must exceed
(BUF_LRU_OLD_TOLERANCE + 5) * BUF_LRU_OLD_RATIO_DIV / BUF_LRU_OLD_MIN_LEN. */
#define BUF_LRU_OLD_RATIO_MIN 51
diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h
index cdf6cdba3d1..cd5eff66ee8 100644
--- a/storage/innobase/include/buf0rea.h
+++ b/storage/innobase/include/buf0rea.h
@@ -43,6 +43,31 @@ buf_read_page(
ulint zip_size,/*!< in: compressed page size in bytes, or 0 */
ulint offset);/*!< in: page number */
/********************************************************************//**
+Applies a random read-ahead in buf_pool if there are at least a threshold
+value of accessed pages from the random read-ahead area. Does not read any
+page, not even the one at the position (space, offset), if the read-ahead
+mechanism is not activated. NOTE 1: the calling thread may own latches on
+pages: to avoid deadlocks this function must be written such that it cannot
+end up waiting for these latches! NOTE 2: the calling thread must want
+access to the page given: this rule is set to prevent unintended read-aheads
+performed by ibuf routines, a situation which could result in a deadlock if
+the OS does not support asynchronous i/o.
+@return number of page read requests issued; NOTE that if we read ibuf
+pages, it may happen that the page at the given page number does not
+get read even if we return a positive value!
+@return number of page read requests issued */
+UNIV_INTERN
+ulint
+buf_read_ahead_random(
+/*==================*/
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes,
+ or 0 */
+ ulint offset, /*!< in: page number of a page which
+ the current thread wants to access */
+ ibool inside_ibuf); /*!< in: TRUE if we are inside ibuf
+ routine */
+/********************************************************************//**
Applies linear read-ahead if in the buf_pool the page is a border page of
a linear read-ahead area and all the pages in the area have been accessed.
Does not read any page if the read-ahead mechanism is not activated. Note
diff --git a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h
index a2175098704..0cc2defb3ff 100644
--- a/storage/innobase/include/buf0types.h
+++ b/storage/innobase/include/buf0types.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -26,6 +26,8 @@ Created 11/17/1995 Heikki Tuuri
#ifndef buf0types_h
#define buf0types_h
+#include "page0types.h"
+
/** Buffer page (uncompressed or compressed) */
typedef struct buf_page_struct buf_page_t;
/** Buffer block for which an uncompressed page exists */
@@ -60,17 +62,10 @@ enum buf_io_fix {
/** Parameters of binary buddy system for compressed pages (buf0buddy.h) */
/* @{ */
-#if UNIV_WORD_SIZE <= 4 /* 32-bit system */
-/** Base-2 logarithm of the smallest buddy block size */
-# define BUF_BUDDY_LOW_SHIFT 6
-#else /* 64-bit system */
-/** Base-2 logarithm of the smallest buddy block size */
-# define BUF_BUDDY_LOW_SHIFT 7
-#endif
+#define BUF_BUDDY_LOW_SHIFT PAGE_ZIP_MIN_SIZE_SHIFT
+
#define BUF_BUDDY_LOW (1 << BUF_BUDDY_LOW_SHIFT)
- /*!< minimum block size in the binary
- buddy system; must be at least
- sizeof(buf_page_t) */
+
#define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
/*!< number of buddy sizes */
diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h
index 74a2354bce3..e0952f0709d 100644
--- a/storage/innobase/include/db0err.h
+++ b/storage/innobase/include/db0err.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -64,8 +64,6 @@ enum db_err {
DB_CANNOT_ADD_CONSTRAINT, /* adding a foreign key constraint
to a table failed */
DB_CORRUPTION, /* data structure corruption noticed */
- DB_COL_APPEARS_TWICE_IN_INDEX, /* InnoDB cannot handle an index
- where same column appears twice */
DB_CANNOT_DROP_CONSTRAINT, /* dropping a foreign key constraint
from a table failed */
DB_NO_SAVEPOINT, /* no savepoint exists with the given
@@ -112,6 +110,8 @@ enum db_err {
foreign keys as its prefix columns */
DB_TOO_BIG_INDEX_COL, /* index column size exceeds maximum
limit */
+ DB_INDEX_CORRUPT, /* we have corrupted index */
+ DB_UNDO_RECORD_TOO_BIG, /* the undo log record is too big */
/* The following are partial failure codes */
DB_FAIL = 1000,
diff --git a/storage/innobase/include/dict0boot.h b/storage/innobase/include/dict0boot.h
index 22df826da65..5d136862bc6 100644
--- a/storage/innobase/include/dict0boot.h
+++ b/storage/innobase/include/dict0boot.h
@@ -137,8 +137,10 @@ dict_create(void);
header is created */
/*-------------------------------------------------------------*/
-/* The field number of the page number field in the sys_indexes table
-clustered index */
+/* The field numbers in the SYS_TABLES clustered index */
+#define DICT_SYS_TABLES_TYPE_FIELD 5
+
+/* The field numbers in the SYS_INDEXES clustered index */
#define DICT_SYS_INDEXES_PAGE_NO_FIELD 8
#define DICT_SYS_INDEXES_SPACE_NO_FIELD 7
#define DICT_SYS_INDEXES_TYPE_FIELD 6
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index f979d0fcc96..57e51cbb6ba 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -585,6 +585,20 @@ dict_table_get_next_index(
# define dict_table_get_next_index(index) UT_LIST_GET_NEXT(indexes, index)
#endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
+
+/* Skip corrupted index */
+#define dict_table_skip_corrupt_index(index) \
+ while (index && dict_index_is_corrupted(index)) { \
+ index = dict_table_get_next_index(index); \
+ }
+
+/* Get the next non-corrupt index */
+#define dict_table_next_uncorrupted_index(index) \
+do { \
+ index = dict_table_get_next_index(index); \
+ dict_table_skip_corrupt_index(index); \
+} while (0)
+
/********************************************************************//**
Check whether the index is the clustered index.
@return nonzero for clustered index, zero for other indexes */
@@ -593,7 +607,7 @@ ulint
dict_index_is_clust(
/*================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((pure));
+ __attribute__((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is unique.
@return nonzero for unique index, zero for other indexes */
@@ -602,7 +616,7 @@ ulint
dict_index_is_unique(
/*=================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((pure));
+ __attribute__((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
@@ -611,7 +625,7 @@ ulint
dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
- __attribute__((pure));
+ __attribute__((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is a secondary index or the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
@@ -620,7 +634,7 @@ ulint
dict_index_is_sec_or_ibuf(
/*======================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((pure));
+ __attribute__((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the number of user-defined columns in a table in the dictionary
@@ -630,7 +644,8 @@ UNIV_INLINE
ulint
dict_table_get_n_user_cols(
/*=======================*/
- const dict_table_t* table); /*!< in: table */
+ const dict_table_t* table) /*!< in: table */
+ __attribute__((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the number of system columns in a table in the dictionary cache.
@return number of system (e.g., ROW_ID) columns of a table */
@@ -638,7 +653,8 @@ UNIV_INLINE
ulint
dict_table_get_n_sys_cols(
/*======================*/
- const dict_table_t* table); /*!< in: table */
+ const dict_table_t* table) /*!< in: table */
+ __attribute__((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the number of all columns (also system) in a table in the dictionary
cache.
@@ -647,7 +663,8 @@ UNIV_INLINE
ulint
dict_table_get_n_cols(
/*==================*/
- const dict_table_t* table); /*!< in: table */
+ const dict_table_t* table) /*!< in: table */
+ __attribute__((nonnull, pure, warn_unused_result));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the nth column of a table.
@@ -1243,6 +1260,57 @@ void
dict_close(void);
/*============*/
+/**********************************************************************//**
+Check whether the table is corrupted.
+@return nonzero for corrupted table, zero for valid tables */
+UNIV_INLINE
+ulint
+dict_table_is_corrupted(
+/*====================*/
+ const dict_table_t* table) /*!< in: table */
+ __attribute__((nonnull, pure, warn_unused_result));
+
+/**********************************************************************//**
+Check whether the index is corrupted.
+@return nonzero for corrupted index, zero for valid indexes */
+UNIV_INLINE
+ulint
+dict_index_is_corrupted(
+/*====================*/
+ const dict_index_t* index) /*!< in: index */
+ __attribute__((nonnull, pure, warn_unused_result));
+
+/**********************************************************************//**
+Flags an index and table corrupted both in the data dictionary cache
+and in the system table SYS_INDEXES. */
+UNIV_INTERN
+void
+dict_set_corrupted(
+/*===============*/
+ dict_index_t* index) /*!< in/out: index */
+ UNIV_COLD __attribute__((nonnull));
+
+/**********************************************************************//**
+Flags an index corrupted in the data dictionary cache only. This
+is used mostly to mark a corrupted index when index's own dictionary
+is corrupted, and we force to load such index for repair purpose */
+UNIV_INTERN
+void
+dict_set_corrupted_index_cache_only(
+/*================================*/
+ dict_index_t* index, /*!< in/out: index */
+ dict_table_t* table); /*!< in/out: table */
+
+/**********************************************************************//**
+Flags a table with specified space_id corrupted in the table dictionary
+cache.
+@return TRUE if successful */
+UNIV_INTERN
+ibool
+dict_set_corrupted_by_space(
+/*========================*/
+ ulint space_id); /*!< in: space ID */
+
#ifndef UNIV_NONINL
#include "dict0dict.ic"
#endif
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index 59811568556..ade9e627e29 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -27,6 +27,7 @@ Created 1/8/1996 Heikki Tuuri
#ifndef UNIV_HOTBACKUP
#include "dict0load.h"
#include "rem0types.h"
+#include "srv0srv.h"
/*********************************************************************//**
Gets the minimum number of bytes per character.
@@ -828,7 +829,7 @@ dict_table_check_if_in_cache_low(
}
/**********************************************************************//**
-load a table into dictionary cache, ignore any error specified during load;
+load a table into dictionary cache, ignore any error specified during load;
@return table, NULL if not found */
UNIV_INLINE
dict_table_t*
@@ -872,6 +873,18 @@ dict_table_get_low(
table = dict_table_check_if_in_cache_low(table_name);
+ if (table && table->corrupted) {
+ fprintf(stderr, "InnoDB: table");
+ ut_print_name(stderr, NULL, TRUE, table->name);
+ if (srv_load_corrupted) {
+ fputs(" is corrupted, but"
+ " innodb_force_load_corrupted is set\n", stderr);
+ } else {
+ fputs(" is corrupted\n", stderr);
+ return(NULL);
+ }
+ }
+
if (table == NULL) {
table = dict_load_table(table_name, TRUE, DICT_ERR_IGNORE_NONE);
}
@@ -937,4 +950,35 @@ dict_max_field_len_store_undo(
return(prefix_len);
}
+/********************************************************************//**
+Check whether the table is corrupted.
+@return nonzero for corrupted table, zero for valid tables */
+UNIV_INLINE
+ulint
+dict_table_is_corrupted(
+/*====================*/
+ const dict_table_t* table) /*!< in: table */
+{
+ ut_ad(table);
+ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
+
+ return(UNIV_UNLIKELY(table->corrupted));
+}
+
+/********************************************************************//**
+Check whether the index is corrupted.
+@return nonzero for corrupted index, zero for valid indexes */
+UNIV_INLINE
+ulint
+dict_index_is_corrupted(
+/*====================*/
+ const dict_index_t* index) /*!< in: index */
+{
+ ut_ad(index);
+ ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
+
+ return(UNIV_UNLIKELY((index->type & DICT_CORRUPT)
+ || (index->table && index->table->corrupted)));
+}
+
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 3a475fa85fc..9ded0dba39b 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -51,7 +51,12 @@ combination of types */
#define DICT_UNIQUE 2 /*!< unique index */
#define DICT_UNIVERSAL 4 /*!< index which can contain records from any
other index */
-#define DICT_IBUF 8 /*!< insert buffer tree */
+#define DICT_IBUF 8 /*!< insert buffer tree */
+#define DICT_CORRUPT 16 /*!< bit to store the corrupted flag
+ in SYS_INDEXES.TYPE */
+
+#define DICT_IT_BITS 5 /*!< number of bits used for
+ SYS_INDEXES.TYPE */
/* @} */
/** Types for a table object */
@@ -369,8 +374,9 @@ struct dict_index_struct{
/*!< space where the index tree is placed */
unsigned page:32;/*!< index tree root page number */
#endif /* !UNIV_HOTBACKUP */
- unsigned type:4; /*!< index type (DICT_CLUSTERED, DICT_UNIQUE,
- DICT_UNIVERSAL, DICT_IBUF) */
+ unsigned type:DICT_IT_BITS;
+ /*!< index type (DICT_CLUSTERED, DICT_UNIQUE,
+ DICT_UNIVERSAL, DICT_IBUF, DICT_CORRUPT) */
unsigned trx_id_offset:10;/*!< position of the trx id column
in a clustered index record, if the fields
before it are known to be of a fixed size,
@@ -391,8 +397,6 @@ struct dict_index_struct{
/*!< TRUE if this index is marked to be
dropped in ha_innobase::prepare_drop_index(),
otherwise FALSE */
- unsigned corrupted:1;
- /*!< TRUE if the index object is corrupted */
dict_field_t* fields; /*!< array of field descriptions */
#ifndef UNIV_HOTBACKUP
UT_LIST_NODE_T(dict_index_t)
diff --git a/storage/innobase/include/dict0types.h b/storage/innobase/include/dict0types.h
index 8cbd7cd5783..f0a05a38070 100644
--- a/storage/innobase/include/dict0types.h
+++ b/storage/innobase/include/dict0types.h
@@ -51,7 +51,8 @@ be or-ed together */
enum dict_err_ignore {
DICT_ERR_IGNORE_NONE = 0, /*!< no error to ignore */
DICT_ERR_IGNORE_INDEX_ROOT = 1, /*!< ignore error if index root
- page is FIL_NUL or incorrect value */
+ page is FIL_NULL or incorrect value */
+ DICT_ERR_IGNORE_CORRUPT = 2, /*!< skip corrupted indexes */
DICT_ERR_IGNORE_ALL = 0xFFFF /*!< ignore all errors */
};
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index 5582ad63039..7f608546cc2 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -213,16 +213,6 @@ ulint
mtr_set_savepoint(
/*==============*/
mtr_t* mtr); /*!< in: mtr */
-/**********************************************************//**
-Releases the latches stored in an mtr memo down to a savepoint.
-NOTE! The mtr must not have made changes to buffer pages after the
-savepoint, as these can be handled only by mtr_commit. */
-UNIV_INTERN
-void
-mtr_rollback_to_savepoint(
-/*======================*/
- mtr_t* mtr, /*!< in: mtr */
- ulint savepoint); /*!< in: savepoint */
#ifndef UNIV_HOTBACKUP
/**********************************************************//**
Releases the (index tree) s-latch stored in an mtr memo after a
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index 7091d8c2707..6a82e820312 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -68,10 +68,7 @@ typedef byte page_header_t;
#define PAGE_MAX_TRX_ID 18 /* highest id of a trx which may have modified
a record on the page; trx_id_t; defined only
in secondary indexes and in the insert buffer
- tree; NOTE: this may be modified only
- when the thread has an x-latch to the page,
- and ALSO an x-latch to btr_search_latch
- if there is a hash index to the page! */
+ tree */
#define PAGE_HEADER_PRIV_END 26 /* end of private data structure of the page
header which are set in a page create */
/*----*/
diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h
index 75e15d67246..c2849be7c3e 100644
--- a/storage/innobase/include/row0row.h
+++ b/storage/innobase/include/row0row.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -38,27 +38,16 @@ Created 4/20/1996 Heikki Tuuri
#include "btr0types.h"
/*********************************************************************//**
-Gets the offset of the trx id field, in bytes relative to the origin of
+Gets the offset of the DB_TRX_ID field, in bytes relative to the origin of
a clustered index record.
@return offset of DATA_TRX_ID */
UNIV_INLINE
ulint
-row_get_trx_id_offset_func(
-/*=======================*/
-#ifdef UNIV_DEBUG
- const rec_t* rec, /*!< in: record */
-#endif /* UNIV_DEBUG */
+row_get_trx_id_offset(
+/*==================*/
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const ulint* offsets)/*!< in: record offsets */
__attribute__((nonnull, warn_unused_result));
-#ifdef UNIV_DEBUG
-# define row_get_trx_id_offset(rec, index, offsets) \
- row_get_trx_id_offset_func(rec, index, offsets)
-#else /* UNIV_DEBUG */
-# define row_get_trx_id_offset(rec, index, offsets) \
- row_get_trx_id_offset_func(index, offsets)
-#endif /* UNIV_DEBUG */
-
/*********************************************************************//**
Reads the trx id field from a clustered index record.
@return value of the field */
@@ -77,9 +66,10 @@ UNIV_INLINE
roll_ptr_t
row_get_rec_roll_ptr(
/*=================*/
- const rec_t* rec, /*!< in: record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets);/*!< in: rec_get_offsets(rec, index) */
+ const rec_t* rec, /*!< in: record */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ __attribute__((nonnull, warn_unused_result));
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
diff --git a/storage/innobase/include/row0row.ic b/storage/innobase/include/row0row.ic
index 9d19e430e16..0b9ca982af8 100644
--- a/storage/innobase/include/row0row.ic
+++ b/storage/innobase/include/row0row.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -28,25 +28,22 @@ Created 4/20/1996 Heikki Tuuri
#include "trx0undo.h"
/*********************************************************************//**
-Gets the offset of trx id field, in bytes relative to the origin of
+Gets the offset of the DB_TRX_ID field, in bytes relative to the origin of
a clustered index record.
@return offset of DATA_TRX_ID */
UNIV_INLINE
ulint
-row_get_trx_id_offset_func(
-/*=======================*/
-#ifdef UNIV_DEBUG
- const rec_t* rec, /*!< in: record */
-#endif /* UNIV_DEBUG */
+row_get_trx_id_offset(
+/*==================*/
const dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const ulint* offsets)/*!< in: record offsets */
{
ulint pos;
ulint offset;
ulint len;
ut_ad(dict_index_is_clust(index));
- ut_ad(rec_offs_validate(rec, index, offsets));
+ ut_ad(rec_offs_validate(NULL, index, offsets));
pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID);
@@ -76,7 +73,7 @@ row_get_rec_trx_id(
offset = index->trx_id_offset;
if (!offset) {
- offset = row_get_trx_id_offset(rec, index, offsets);
+ offset = row_get_trx_id_offset(index, offsets);
}
return(trx_read_trx_id(rec + offset));
@@ -89,9 +86,9 @@ UNIV_INLINE
roll_ptr_t
row_get_rec_roll_ptr(
/*=================*/
- const rec_t* rec, /*!< in: record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const rec_t* rec, /*!< in: record */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
{
ulint offset;
@@ -101,7 +98,7 @@ row_get_rec_roll_ptr(
offset = index->trx_id_offset;
if (!offset) {
- offset = row_get_trx_id_offset(rec, index, offsets);
+ offset = row_get_trx_id_offset(index, offsets);
}
return(trx_read_roll_ptr(rec + offset + DATA_TRX_ID_LEN));
diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.ic
index 18e22f1eca9..11db82f64da 100644
--- a/storage/innobase/include/row0upd.ic
+++ b/storage/innobase/include/row0upd.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -157,11 +157,6 @@ row_upd_rec_sys_fields(
{
ut_ad(dict_index_is_clust(index));
ut_ad(rec_offs_validate(rec, index, offsets));
-#ifdef UNIV_SYNC_DEBUG
- if (!rw_lock_own(&btr_search_latch, RW_LOCK_EX)) {
- ut_ad(!buf_block_align(rec)->is_hashed);
- }
-#endif /* UNIV_SYNC_DEBUG */
if (UNIV_LIKELY_NULL(page_zip)) {
ulint pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID);
@@ -171,7 +166,7 @@ row_upd_rec_sys_fields(
ulint offset = index->trx_id_offset;
if (!offset) {
- offset = row_get_trx_id_offset(rec, index, offsets);
+ offset = row_get_trx_id_offset(index, offsets);
}
#if DATA_TRX_ID + 1 != DATA_ROLL_PTR
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index fc9401a12f5..dfe7397d189 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -141,6 +141,10 @@ extern ulint srv_log_buffer_size;
extern ulong srv_flush_log_at_trx_commit;
extern char srv_adaptive_flushing;
+/* If this flag is TRUE, then we will load the indexes' (and tables') metadata
+even if they are marked as "corrupted". Mostly it is for DBA to process
+corrupted index and table */
+extern my_bool srv_load_corrupted;
/* The sort order table of the MySQL latin1_swedish_ci character set
collation */
@@ -158,6 +162,7 @@ extern ulint srv_mem_pool_size;
extern ulint srv_lock_table_size;
extern ulint srv_n_file_io_threads;
+extern my_bool srv_random_read_ahead;
extern ulong srv_read_ahead_threshold;
extern ulint srv_n_read_io_threads;
extern ulint srv_n_write_io_threads;
@@ -703,6 +708,7 @@ struct export_var_struct{
ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
ulint innodb_buffer_pool_pages_flushed; /*!< srv_buf_pool_flushed */
ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */
+ ulint innodb_buffer_pool_read_ahead_rnd;/*!< srv_read_ahead_rnd */
ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
ulint innodb_dblwr_pages_written; /*!< srv_dblwr_pages_written */
diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h
index 9e5c96fa323..dedf080d00a 100644
--- a/storage/innobase/include/sync0rw.h
+++ b/storage/innobase/include/sync0rw.h
@@ -542,7 +542,7 @@ mutex. */
UNIV_INTERN
void
rw_lock_debug_mutex_enter(void);
-/*==========================*/
+/*===========================*/
/******************************************************************//**
Releases the debug mutex. */
UNIV_INTERN
@@ -632,7 +632,8 @@ struct rw_lock_struct {
};
#ifdef UNIV_SYNC_DEBUG
-/** The structure for storing debug info of an rw-lock */
+/** The structure for storing debug info of an rw-lock. All access to this
+structure must be protected by rw_lock_debug_mutex_enter(). */
struct rw_lock_debug_struct {
os_thread_id_t thread_id; /*!< The thread id of the thread which
diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic
index 2ffd9fdafb5..51cf7121b4c 100644
--- a/storage/innobase/include/sync0rw.ic
+++ b/storage/innobase/include/sync0rw.ic
@@ -406,6 +406,7 @@ rw_lock_s_lock_func(
#ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED)); /* see NOTE above */
+ ut_ad(!rw_lock_own(lock, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
/* TODO: study performance of UNIV_LIKELY branch prediction hints. */
diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
index b823c9d5259..d9dea0aa63d 100644
--- a/storage/innobase/include/sync0sync.h
+++ b/storage/innobase/include/sync0sync.h
@@ -636,10 +636,6 @@ or row lock! */
#define SYNC_DICT_HEADER 995
#define SYNC_IBUF_HEADER 914
#define SYNC_IBUF_PESS_INSERT_MUTEX 912
-#define SYNC_IBUF_MUTEX 910 /* ibuf mutex is really below
- SYNC_FSP_PAGE: we assign a value this
- high only to make the program to pass
- the debug checks */
/*-------------------------------*/
#define SYNC_INDEX_TREE 900
#define SYNC_TREE_NODE_NEW 892
@@ -655,8 +651,11 @@ or row lock! */
#define SYNC_FSP 400
#define SYNC_FSP_PAGE 395
/*------------------------------------- Insert buffer headers */
-/*------------------------------------- ibuf_mutex */
+#define SYNC_IBUF_MUTEX 370 /* ibuf_mutex */
/*------------------------------------- Insert buffer tree */
+#define SYNC_IBUF_INDEX_TREE 360
+#define SYNC_IBUF_TREE_NODE_NEW 359
+#define SYNC_IBUF_TREE_NODE 358
#define SYNC_IBUF_BITMAP_MUTEX 351
#define SYNC_IBUF_BITMAP 350
/*------------------------------------- MySQL query cache mutex */
@@ -683,7 +682,6 @@ or row lock! */
#define SYNC_BUF_FLUSH_LIST 145 /* Buffer flush list mutex */
#define SYNC_DOUBLEWRITE 140
#define SYNC_ANY_LATCH 135
-#define SYNC_THR_LOCAL 133
#define SYNC_MEM_HASH 131
#define SYNC_MEM_POOL 130
diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic
index 2977f71154a..eb21f44c65e 100644
--- a/storage/innobase/include/sync0sync.ic
+++ b/storage/innobase/include/sync0sync.ic
@@ -272,11 +272,10 @@ pfs_mutex_enter_nowait_func(
ulint ret;
struct PSI_mutex_locker* locker = NULL;
PSI_mutex_locker_state state;
- int result = 0;
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
locker = PSI_server->get_thread_mutex_locker(
- &state, mutex->pfs_psi, PSI_MUTEX_LOCK);
+ &state, mutex->pfs_psi, PSI_MUTEX_TRYLOCK);
if (locker) {
PSI_server->start_mutex_wait(locker, file_name, line);
}
@@ -285,7 +284,7 @@ pfs_mutex_enter_nowait_func(
ret = mutex_enter_nowait_func(mutex, file_name, line);
if (locker) {
- PSI_server->end_mutex_wait(locker, result);
+ PSI_server->end_mutex_wait(locker, ret);
}
return(ret);
diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
index dc0ca2285b9..9cec1933e9d 100644
--- a/storage/innobase/include/trx0sys.h
+++ b/storage/innobase/include/trx0sys.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -278,6 +278,17 @@ ibool
trx_in_trx_list(
/*============*/
trx_t* in_trx);/*!< in: trx */
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+/***********************************************************//**
+Assert that a transaction has been recovered.
+@return TRUE */
+UNIV_INLINE
+ibool
+trx_assert_recovered(
+/*=================*/
+ trx_id_t trx_id) /*!< in: transaction identifier */
+ __attribute__((warn_unused_result));
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
/*****************************************************************//**
Updates the offset information about the end of the MySQL binlog entry
which corresponds to the transaction just being committed. In a MySQL
diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic
index 355f118a1ec..5e702b25325 100644
--- a/storage/innobase/include/trx0sys.ic
+++ b/storage/innobase/include/trx0sys.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -277,6 +277,28 @@ trx_get_on_id(
return(NULL);
}
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+/***********************************************************//**
+Assert that a transaction has been recovered.
+@return TRUE */
+UNIV_INLINE
+ibool
+trx_assert_recovered(
+/*=================*/
+ trx_id_t trx_id) /*!< in: transaction identifier */
+{
+ trx_t* trx;
+
+ mutex_enter(&kernel_mutex);
+ trx = trx_get_on_id(trx_id);
+ ut_a(trx);
+ ut_a(trx->is_recovered);
+ mutex_exit(&kernel_mutex);
+
+ return(TRUE);
+}
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+
/****************************************************************//**
Returns the minumum trx id in trx list. This is the smallest id for which
the trx can possibly be active. (But, you must look at the trx->conc_state to
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index df16c939070..50aa6d0ac09 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -204,17 +204,51 @@ trx_undo_add_page(
mtr_t* mtr); /*!< in: mtr which does not have a latch to any
undo log page; the caller must have reserved
the rollback segment mutex */
+/********************************************************************//**
+Frees the last undo log page.
+The caller must hold the rollback segment mutex. */
+UNIV_INTERN
+void
+trx_undo_free_last_page_func(
+/*==========================*/
+#ifdef UNIV_DEBUG
+ const trx_t* trx, /*!< in: transaction */
+#endif /* UNIV_DEBUG */
+ trx_undo_t* undo, /*!< in/out: undo log memory copy */
+ mtr_t* mtr) /*!< in/out: mini-transaction which does not
+ have a latch to any undo log page or which
+ has allocated the undo log page */
+ __attribute__((nonnull));
+#ifdef UNIV_DEBUG
+# define trx_undo_free_last_page(trx,undo,mtr) \
+ trx_undo_free_last_page_func(trx,undo,mtr)
+#else /* UNIV_DEBUG */
+# define trx_undo_free_last_page(trx,undo,mtr) \
+ trx_undo_free_last_page_func(undo,mtr)
+#endif /* UNIV_DEBUG */
+
/***********************************************************************//**
Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
-trx_undo_truncate_end(
-/*==================*/
- trx_t* trx, /*!< in: transaction whose undo log it is */
- trx_undo_t* undo, /*!< in: undo log */
- undo_no_t limit); /*!< in: all undo records with undo number
+trx_undo_truncate_end_func(
+/*=======================*/
+#ifdef UNIV_DEBUG
+ const trx_t* trx, /*!< in: transaction whose undo log it is */
+#endif /* UNIV_DEBUG */
+ trx_undo_t* undo, /*!< in/out: undo log */
+ undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
+ __attribute__((nonnull));
+#ifdef UNIV_DEBUG
+# define trx_undo_truncate_end(trx,undo,limit) \
+ trx_undo_truncate_end_func(trx,undo,limit)
+#else /* UNIV_DEBUG */
+# define trx_undo_truncate_end(trx,undo,limit) \
+ trx_undo_truncate_end_func(undo,limit)
+#endif /* UNIV_DEBUG */
+
/***********************************************************************//**
Truncates an undo log from the start. This function is used during a purge
operation. */
diff --git a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h
index 57dfb08f41c..faf6f242883 100644
--- a/storage/innobase/include/ut0mem.h
+++ b/storage/innobase/include/ut0mem.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -210,43 +210,6 @@ ut_strlcpy_rev(
ulint size); /*!< in: size of destination buffer */
/**********************************************************************//**
-Compute strlen(ut_strcpyq(str, q)).
-@return length of the string when quoted */
-UNIV_INLINE
-ulint
-ut_strlenq(
-/*=======*/
- const char* str, /*!< in: null-terminated string */
- char q); /*!< in: the quote character */
-
-/**********************************************************************//**
-Make a quoted copy of a NUL-terminated string. Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_memcpyq().
-@return pointer to end of dest */
-UNIV_INTERN
-char*
-ut_strcpyq(
-/*=======*/
- char* dest, /*!< in: output buffer */
- char q, /*!< in: the quote character */
- const char* src); /*!< in: null-terminated string */
-
-/**********************************************************************//**
-Make a quoted copy of a fixed-length string. Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_strcpyq().
-@return pointer to end of dest */
-UNIV_INTERN
-char*
-ut_memcpyq(
-/*=======*/
- char* dest, /*!< in: output buffer */
- char q, /*!< in: the quote character */
- const char* src, /*!< in: string to be quoted */
- ulint len); /*!< in: length of src */
-
-/**********************************************************************//**
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once.
@return the number of times s2 occurs in s1 */
diff --git a/storage/innobase/include/ut0mem.ic b/storage/innobase/include/ut0mem.ic
index f36c28f1989..c06e2b3ae81 100644
--- a/storage/innobase/include/ut0mem.ic
+++ b/storage/innobase/include/ut0mem.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -99,27 +99,6 @@ ut_strcmp(const char* str1, const char* str2)
}
/**********************************************************************//**
-Compute strlen(ut_strcpyq(str, q)).
-@return length of the string when quoted */
-UNIV_INLINE
-ulint
-ut_strlenq(
-/*=======*/
- const char* str, /*!< in: null-terminated string */
- char q) /*!< in: the quote character */
-{
- ulint len;
-
- for (len = 0; *str; len++, str++) {
- if (*str == q) {
- len++;
- }
- }
-
- return(len);
-}
-
-/**********************************************************************//**
Converts a raw binary data to a NUL-terminated hex string. The output is
truncated if there is not enough space in "hex", make sure "hex_size" is at
least (2 * raw_size + 1) if you do not want this to happen. Returns the
diff --git a/storage/innobase/mtr/mtr0mtr.c b/storage/innobase/mtr/mtr0mtr.c
index 439b429db43..08234609ff0 100644
--- a/storage/innobase/mtr/mtr0mtr.c
+++ b/storage/innobase/mtr/mtr0mtr.c
@@ -282,44 +282,6 @@ mtr_commit(
}
#ifndef UNIV_HOTBACKUP
-/**********************************************************//**
-Releases the latches stored in an mtr memo down to a savepoint.
-NOTE! The mtr must not have made changes to buffer pages after the
-savepoint, as these can be handled only by mtr_commit. */
-UNIV_INTERN
-void
-mtr_rollback_to_savepoint(
-/*======================*/
- mtr_t* mtr, /*!< in: mtr */
- ulint savepoint) /*!< in: savepoint */
-{
- mtr_memo_slot_t* slot;
- dyn_array_t* memo;
- ulint offset;
-
- ut_ad(mtr);
- ut_ad(mtr->magic_n == MTR_MAGIC_N);
- ut_ad(mtr->state == MTR_ACTIVE);
-
- memo = &(mtr->memo);
-
- offset = dyn_array_get_data_size(memo);
- ut_ad(offset >= savepoint);
-
- while (offset > savepoint) {
- offset -= sizeof(mtr_memo_slot_t);
-
- slot = dyn_array_get_element(memo, offset);
-
- ut_ad(slot->type != MTR_MEMO_MODIFY);
-
- /* We do not call mtr_memo_slot_note_modification()
- because there MUST be no changes made to the buffer
- pages after the savepoint */
- mtr_memo_slot_release(mtr, slot);
- }
-}
-
/***************************************************//**
Releases an object in the memo stack. */
UNIV_INTERN
diff --git a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
index c92ad9dc25b..fb618beac7e 100644
--- a/storage/innobase/page/page0zip.c
+++ b/storage/innobase/page/page0zip.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2005, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 2005, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -151,6 +151,20 @@ page_zip_empty_size(
#endif /* !UNIV_HOTBACKUP */
/*************************************************************//**
+Gets the number of elements in the dense page directory,
+including deleted records (the free list).
+@return number of elements in the dense page directory */
+UNIV_INLINE
+ulint
+page_zip_dir_elems(
+/*===============*/
+ const page_zip_des_t* page_zip) /*!< in: compressed page */
+{
+ /* Exclude the page infimum and supremum from the record count. */
+ return(page_dir_get_n_heap(page_zip->data) - PAGE_HEAP_NO_USER_LOW);
+}
+
+/*************************************************************//**
Gets the size of the compressed page trailer (the dense page directory),
including deleted records (the free list).
@return length of dense page directory, in bytes */
@@ -160,14 +174,42 @@ page_zip_dir_size(
/*==============*/
const page_zip_des_t* page_zip) /*!< in: compressed page */
{
- /* Exclude the page infimum and supremum from the record count. */
- ulint size = PAGE_ZIP_DIR_SLOT_SIZE
- * (page_dir_get_n_heap(page_zip->data)
- - PAGE_HEAP_NO_USER_LOW);
- return(size);
+ return(PAGE_ZIP_DIR_SLOT_SIZE * page_zip_dir_elems(page_zip));
+}
+
+/*************************************************************//**
+Gets an offset to the compressed page trailer (the dense page directory),
+including deleted records (the free list).
+@return offset of the dense page directory */
+UNIV_INLINE
+ulint
+page_zip_dir_start_offs(
+/*====================*/
+ const page_zip_des_t* page_zip, /*!< in: compressed page */
+ ulint n_dense) /*!< in: directory size */
+{
+ ut_ad(n_dense * PAGE_ZIP_DIR_SLOT_SIZE < page_zip_get_size(page_zip));
+
+ return(page_zip_get_size(page_zip) - n_dense * PAGE_ZIP_DIR_SLOT_SIZE);
}
/*************************************************************//**
+Gets a pointer to the compressed page trailer (the dense page directory),
+including deleted records (the free list).
+@param[in] page_zip compressed page
+@param[in] n_dense number of entries in the directory
+@return pointer to the dense page directory */
+#define page_zip_dir_start_low(page_zip, n_dense) \
+ ((page_zip)->data + page_zip_dir_start_offs(page_zip, n_dense))
+/*************************************************************//**
+Gets a pointer to the compressed page trailer (the dense page directory),
+including deleted records (the free list).
+@param[in] page_zip compressed page
+@return pointer to the dense page directory */
+#define page_zip_dir_start(page_zip) \
+ page_zip_dir_start_low(page_zip, page_zip_dir_elems(page_zip))
+
+/*************************************************************//**
Gets the size of the compressed page trailer (the dense page directory),
only including user records (excluding the free list).
@return length of dense page directory comprising existing records, in bytes */
@@ -2242,8 +2284,7 @@ zlib_done:
}
/* Restore the uncompressed columns in heap_no order. */
- storage = page_zip->data + page_zip_get_size(page_zip)
- - n_dense * PAGE_ZIP_DIR_SLOT_SIZE;
+ storage = page_zip_dir_start_low(page_zip, n_dense);
for (slot = 0; slot < n_dense; slot++) {
rec_t* rec = recs[slot];
@@ -2728,8 +2769,7 @@ zlib_done:
return(FALSE);
}
- storage = page_zip->data + page_zip_get_size(page_zip)
- - n_dense * PAGE_ZIP_DIR_SLOT_SIZE;
+ storage = page_zip_dir_start_low(page_zip, n_dense);
externs = storage - n_dense
* (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
@@ -3457,9 +3497,7 @@ page_zip_write_rec(
}
/* Write the data bytes. Store the uncompressed bytes separately. */
- storage = page_zip->data + page_zip_get_size(page_zip)
- - (page_dir_get_n_heap(page) - PAGE_HEAP_NO_USER_LOW)
- * PAGE_ZIP_DIR_SLOT_SIZE;
+ storage = page_zip_dir_start(page_zip);
if (page_is_leaf(page)) {
ulint len;
@@ -3755,9 +3793,7 @@ corrupt:
field = page + offset;
storage = page_zip->data + z_offset;
- storage_end = page_zip->data + page_zip_get_size(page_zip)
- - (page_dir_get_n_heap(page) - PAGE_HEAP_NO_USER_LOW)
- * PAGE_ZIP_DIR_SLOT_SIZE;
+ storage_end = page_zip_dir_start(page_zip);
heap_no = 1 + (storage_end - storage) / REC_NODE_PTR_SIZE;
@@ -3793,7 +3829,9 @@ page_zip_write_node_ptr(
{
byte* field;
byte* storage;
+#ifdef UNIV_DEBUG
page_t* page = page_align(rec);
+#endif /* UNIV_DEBUG */
ut_ad(PAGE_ZIP_MATCH(rec, page_zip));
ut_ad(page_simple_validate_new(page));
@@ -3810,9 +3848,7 @@ page_zip_write_node_ptr(
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
UNIV_MEM_ASSERT_RW(rec, size);
- storage = page_zip->data + page_zip_get_size(page_zip)
- - (page_dir_get_n_heap(page) - PAGE_HEAP_NO_USER_LOW)
- * PAGE_ZIP_DIR_SLOT_SIZE
+ storage = page_zip_dir_start(page_zip)
- (rec_get_heap_no_new(rec) - 1) * REC_NODE_PTR_SIZE;
field = rec + size - REC_NODE_PTR_SIZE;
@@ -3861,7 +3897,9 @@ page_zip_write_trx_id_and_roll_ptr(
{
byte* field;
byte* storage;
+#ifdef UNIV_DEBUG
page_t* page = page_align(rec);
+#endif /* UNIV_DEBUG */
ulint len;
ut_ad(PAGE_ZIP_MATCH(rec, page_zip));
@@ -3879,9 +3917,7 @@ page_zip_write_trx_id_and_roll_ptr(
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
- storage = page_zip->data + page_zip_get_size(page_zip)
- - (page_dir_get_n_heap(page) - PAGE_HEAP_NO_USER_LOW)
- * PAGE_ZIP_DIR_SLOT_SIZE
+ storage = page_zip_dir_start(page_zip)
- (rec_get_heap_no_new(rec) - 1)
* (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
@@ -3912,17 +3948,9 @@ page_zip_write_trx_id_and_roll_ptr(
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
}
-#ifdef UNIV_ZIP_DEBUG
-/** Set this variable in a debugger to disable page_zip_clear_rec().
-The only observable effect should be the compression ratio due to
-deleted records not being zeroed out. In rare cases, there can be
-page_zip_validate() failures on the node_ptr, trx_id and roll_ptr
-columns if the space is reallocated for a smaller record. */
-UNIV_INTERN ibool page_zip_clear_rec_disable;
-#endif /* UNIV_ZIP_DEBUG */
-
/**********************************************************************//**
-Clear an area on the uncompressed and compressed page, if possible. */
+Clear an area on the uncompressed and compressed page.
+Do not clear the data payload, as that would grow the modification log. */
static
void
page_zip_clear_rec(
@@ -3934,6 +3962,9 @@ page_zip_clear_rec(
{
ulint heap_no;
page_t* page = page_align(rec);
+ byte* storage;
+ byte* field;
+ ulint len;
/* page_zip_validate() would fail here if a record
containing externally stored columns is being deleted. */
ut_ad(rec_offs_validate(rec, index, offsets));
@@ -3949,60 +3980,38 @@ page_zip_clear_rec(
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
- if (
-#ifdef UNIV_ZIP_DEBUG
- !page_zip_clear_rec_disable &&
-#endif /* UNIV_ZIP_DEBUG */
- page_zip->m_end
- + 1 + ((heap_no - 1) >= 64)/* size of the log entry */
- + page_zip_get_trailer_len(page_zip,
- dict_index_is_clust(index), NULL)
- < page_zip_get_size(page_zip)) {
- byte* data;
-
- /* Clear only the data bytes, because the allocator and
- the decompressor depend on the extra bytes. */
- memset(rec, 0, rec_offs_data_size(offsets));
-
- if (!page_is_leaf(page)) {
- /* Clear node_ptr on the compressed page. */
- byte* storage = page_zip->data
- + page_zip_get_size(page_zip)
- - (page_dir_get_n_heap(page)
- - PAGE_HEAP_NO_USER_LOW)
- * PAGE_ZIP_DIR_SLOT_SIZE;
-
- memset(storage - (heap_no - 1) * REC_NODE_PTR_SIZE,
- 0, REC_NODE_PTR_SIZE);
- } else if (dict_index_is_clust(index)) {
- /* Clear trx_id and roll_ptr on the compressed page. */
- byte* storage = page_zip->data
- + page_zip_get_size(page_zip)
- - (page_dir_get_n_heap(page)
- - PAGE_HEAP_NO_USER_LOW)
- * PAGE_ZIP_DIR_SLOT_SIZE;
-
- memset(storage - (heap_no - 1)
- * (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN),
- 0, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
- }
+ if (!page_is_leaf(page)) {
+ /* Clear node_ptr. On the compressed page,
+ there is an array of node_ptr immediately before the
+ dense page directory, at the very end of the page. */
+ storage = page_zip_dir_start(page_zip);
+ ut_ad(dict_index_get_n_unique_in_tree(index) ==
+ rec_offs_n_fields(offsets) - 1);
+ field = rec_get_nth_field(rec, offsets,
+ rec_offs_n_fields(offsets) - 1,
+ &len);
+ ut_ad(len == REC_NODE_PTR_SIZE);
- /* Log that the data was zeroed out. */
- data = page_zip->data + page_zip->m_end;
- ut_ad(!*data);
- if (UNIV_UNLIKELY(heap_no - 1 >= 64)) {
- *data++ = (byte) (0x80 | (heap_no - 1) >> 7);
- ut_ad(!*data);
- }
- *data++ = (byte) ((heap_no - 1) << 1 | 1);
- ut_ad(!*data);
- ut_ad((ulint) (data - page_zip->data)
- < page_zip_get_size(page_zip));
- page_zip->m_end = data - page_zip->data;
- page_zip->m_nonempty = TRUE;
- } else if (page_is_leaf(page) && dict_index_is_clust(index)) {
- /* Do not clear the record, because there is not enough space
- to log the operation. */
+ ut_ad(!rec_offs_any_extern(offsets));
+ memset(field, 0, REC_NODE_PTR_SIZE);
+ memset(storage - (heap_no - 1) * REC_NODE_PTR_SIZE,
+ 0, REC_NODE_PTR_SIZE);
+ } else if (dict_index_is_clust(index)) {
+ /* Clear trx_id and roll_ptr. On the compressed page,
+ there is an array of these fields immediately before the
+ dense page directory, at the very end of the page. */
+ const ulint trx_id_pos
+ = dict_col_get_clust_pos(
+ dict_table_get_sys_col(
+ index->table, DATA_TRX_ID), index);
+ storage = page_zip_dir_start(page_zip);
+ field = rec_get_nth_field(rec, offsets, trx_id_pos, &len);
+ ut_ad(len == DATA_TRX_ID_LEN);
+
+ memset(field, 0, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
+ memset(storage - (heap_no - 1)
+ * (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN),
+ 0, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
if (rec_offs_any_extern(offsets)) {
ulint i;
@@ -4011,15 +4020,18 @@ page_zip_clear_rec(
/* Clear all BLOB pointers in order to make
page_zip_validate() pass. */
if (rec_offs_nth_extern(offsets, i)) {
- ulint len;
- byte* field = rec_get_nth_field(
+ field = rec_get_nth_field(
rec, offsets, i, &len);
+ ut_ad(len
+ == BTR_EXTERN_FIELD_REF_SIZE);
memset(field + len
- BTR_EXTERN_FIELD_REF_SIZE,
0, BTR_EXTERN_FIELD_REF_SIZE);
}
}
}
+ } else {
+ ut_ad(!rec_offs_any_extern(offsets));
}
#ifdef UNIV_ZIP_DEBUG
diff --git a/storage/innobase/pars/pars0opt.c b/storage/innobase/pars/pars0opt.c
index 2e392ba4836..d992805d9ef 100644
--- a/storage/innobase/pars/pars0opt.c
+++ b/storage/innobase/pars/pars0opt.c
@@ -568,7 +568,7 @@ opt_search_plan_for_table(
best_last_op = last_op;
}
- index = dict_table_get_next_index(index);
+ dict_table_next_uncorrupted_index(index);
}
plan->index = best_index;
diff --git a/storage/innobase/rem/rem0rec.c b/storage/innobase/rem/rem0rec.c
index 5a96e608ab5..30fc28561fa 100644
--- a/storage/innobase/rem/rem0rec.c
+++ b/storage/innobase/rem/rem0rec.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -408,7 +408,7 @@ rec_init_offsets(
do {
ulint len;
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
- len = offs += 4;
+ len = offs += REC_NODE_PTR_SIZE;
goto resolved;
}
@@ -640,7 +640,7 @@ rec_get_offsets_reverse(
do {
ulint len;
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
- len = offs += 4;
+ len = offs += REC_NODE_PTR_SIZE;
goto resolved;
}
@@ -1131,9 +1131,9 @@ rec_convert_dtuple_to_rec_comp(
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
ut_ad(dtype_get_prtype(type) & DATA_NOT_NULL);
- ut_ad(len == 4);
+ ut_ad(len == REC_NODE_PTR_SIZE);
memcpy(end, dfield_get_data(field), len);
- end += 4;
+ end += REC_NODE_PTR_SIZE;
break;
}
diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
index e0414cde80d..2925feb2904 100644
--- a/storage/innobase/row/row0ins.c
+++ b/storage/innobase/row/row0ins.c
@@ -118,6 +118,9 @@ ins_node_create_entry_list(
node->entry_sys_heap);
UT_LIST_ADD_LAST(tuple_list, node->entry_list, entry);
+ /* We will include all indexes (include those corrupted
+ secondary indexes) in the entry list. Filteration of
+ these corrupted index will be done in row_ins() */
index = dict_table_get_next_index(index);
}
}
@@ -2045,7 +2048,6 @@ row_ins_index_entry_low(
mtr_start(&mtr);
if (err != DB_SUCCESS) {
-
goto function_exit;
}
@@ -2395,6 +2397,13 @@ row_ins(
node->index = dict_table_get_next_index(node->index);
node->entry = UT_LIST_GET_NEXT(tuple_list, node->entry);
+
+ /* Skip corrupted secondar index and its entry */
+ while (node->index && dict_index_is_corrupted(node->index)) {
+
+ node->index = dict_table_get_next_index(node->index);
+ node->entry = UT_LIST_GET_NEXT(tuple_list, node->entry);
+ }
}
ut_ad(node->entry == NULL);
diff --git a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
index 5be437add5a..d42f21241ca 100644
--- a/storage/innobase/row/row0merge.c
+++ b/storage/innobase/row/row0merge.c
@@ -2554,8 +2554,9 @@ row_merge_is_index_usable(
const trx_t* trx, /*!< in: transaction */
const dict_index_t* index) /*!< in: index to check */
{
- return(!trx->read_view
- || read_view_sees_trx_id(trx->read_view, index->trx_id));
+ return(!dict_index_is_corrupted(index)
+ && (!trx->read_view
+ || read_view_sees_trx_id(trx->read_view, index->trx_id)));
}
/*********************************************************************//**
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index e1ada387729..d0bedd69842 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -576,6 +576,7 @@ handle_new_error:
case DB_DUPLICATE_KEY:
case DB_FOREIGN_DUPLICATE_KEY:
case DB_TOO_BIG_RECORD:
+ case DB_UNDO_RECORD_TOO_BIG:
case DB_ROW_IS_REFERENCED:
case DB_NO_REFERENCED_ROW:
case DB_CANNOT_ADD_CONSTRAINT:
@@ -2015,41 +2016,13 @@ row_create_index_for_mysql(
trx_start_if_not_started(trx);
- /* Check that the same column does not appear twice in the index.
- Starting from 4.0.14, InnoDB should be able to cope with that, but
- safer not to allow them. */
-
- for (i = 0; i < dict_index_get_n_fields(index); i++) {
- ulint j;
-
- for (j = 0; j < i; j++) {
- if (0 == ut_strcmp(
- dict_index_get_nth_field(index, j)->name,
- dict_index_get_nth_field(index, i)->name)) {
- ut_print_timestamp(stderr);
-
- fputs(" InnoDB: Error: column ", stderr);
- ut_print_name(stderr, trx, FALSE,
- dict_index_get_nth_field(
- index, i)->name);
- fputs(" appears twice in ", stderr);
- dict_index_name_print(stderr, trx, index);
- fputs("\n"
- "InnoDB: This is not allowed"
- " in InnoDB.\n", stderr);
-
- err = DB_COL_APPEARS_TWICE_IN_INDEX;
-
- goto error_handling;
- }
- }
-
- /* Check also that prefix_len and actual length
- is less than that from DICT_MAX_FIELD_LEN_BY_FORMAT() */
+ for (i = 0; i < index->n_def; i++) {
+ /* Check that prefix_len and actual length
+ < DICT_MAX_INDEX_COL_LEN */
len = dict_index_get_nth_field(index, i)->prefix_len;
- if (field_lengths) {
+ if (field_lengths && field_lengths[i]) {
len = ut_max(len, field_lengths[i]);
}
@@ -2057,6 +2030,7 @@ row_create_index_for_mysql(
if (len > (ulint) DICT_MAX_FIELD_LEN_BY_FORMAT(table)) {
err = DB_TOO_BIG_INDEX_COL;
+ dict_mem_index_free(index);
goto error_handling;
}
}
@@ -3125,7 +3099,8 @@ row_drop_table_for_mysql(
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
- table = dict_table_get_low_ignore_err(name, DICT_ERR_IGNORE_INDEX_ROOT);
+ table = dict_table_get_low_ignore_err(
+ name, DICT_ERR_IGNORE_INDEX_ROOT | DICT_ERR_IGNORE_CORRUPT);
if (!table) {
err = DB_TABLE_NOT_FOUND;
@@ -3272,6 +3247,19 @@ check_next_foreign:
"index_id CHAR;\n"
"foreign_id CHAR;\n"
"found INT;\n"
+
+ "DECLARE CURSOR cur_fk IS\n"
+ "SELECT ID FROM SYS_FOREIGN\n"
+ "WHERE FOR_NAME = :table_name\n"
+ "AND TO_BINARY(FOR_NAME)\n"
+ " = TO_BINARY(:table_name)\n"
+ "LOCK IN SHARE MODE;\n"
+
+ "DECLARE CURSOR cur_idx IS\n"
+ "SELECT ID FROM SYS_INDEXES\n"
+ "WHERE TABLE_ID = table_id\n"
+ "LOCK IN SHARE MODE;\n"
+
"BEGIN\n"
"SELECT ID INTO table_id\n"
"FROM SYS_TABLES\n"
@@ -3294,13 +3282,9 @@ check_next_foreign:
"IF (:table_name = 'SYS_FOREIGN_COLS') THEN\n"
" found := 0;\n"
"END IF;\n"
+ "OPEN cur_fk;\n"
"WHILE found = 1 LOOP\n"
- " SELECT ID INTO foreign_id\n"
- " FROM SYS_FOREIGN\n"
- " WHERE FOR_NAME = :table_name\n"
- " AND TO_BINARY(FOR_NAME)\n"
- " = TO_BINARY(:table_name)\n"
- " LOCK IN SHARE MODE;\n"
+ " FETCH cur_fk INTO foreign_id;\n"
" IF (SQL % NOTFOUND) THEN\n"
" found := 0;\n"
" ELSE\n"
@@ -3310,12 +3294,11 @@ check_next_foreign:
" WHERE ID = foreign_id;\n"
" END IF;\n"
"END LOOP;\n"
+ "CLOSE cur_fk;\n"
"found := 1;\n"
+ "OPEN cur_idx;\n"
"WHILE found = 1 LOOP\n"
- " SELECT ID INTO index_id\n"
- " FROM SYS_INDEXES\n"
- " WHERE TABLE_ID = table_id\n"
- " LOCK IN SHARE MODE;\n"
+ " FETCH cur_idx INTO index_id;\n"
" IF (SQL % NOTFOUND) THEN\n"
" found := 0;\n"
" ELSE\n"
@@ -3326,6 +3309,7 @@ check_next_foreign:
" AND TABLE_ID = table_id;\n"
" END IF;\n"
"END LOOP;\n"
+ "CLOSE cur_idx;\n"
"DELETE FROM SYS_COLUMNS\n"
"WHERE TABLE_ID = table_id;\n"
"DELETE FROM SYS_TABLES\n"
diff --git a/storage/innobase/row/row0purge.c b/storage/innobase/row/row0purge.c
index 83e7c9e4857..efcfdc3bac5 100644
--- a/storage/innobase/row/row0purge.c
+++ b/storage/innobase/row/row0purge.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
@@ -469,6 +469,13 @@ row_purge_del_mark(
heap = mem_heap_create(1024);
while (node->index != NULL) {
+ /* skip corrupted secondary index */
+ dict_table_skip_corrupt_index(node->index);
+
+ if (!node->index) {
+ break;
+ }
+
index = node->index;
/* Build the index entry */
@@ -508,7 +515,8 @@ row_purge_upd_exist_or_extern_func(
ut_ad(node);
- if (node->rec_type == TRX_UNDO_UPD_DEL_REC) {
+ if (node->rec_type == TRX_UNDO_UPD_DEL_REC
+ || (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
goto skip_secondaries;
}
@@ -516,6 +524,12 @@ row_purge_upd_exist_or_extern_func(
heap = mem_heap_create(1024);
while (node->index != NULL) {
+ dict_table_skip_corrupt_index(node->index);
+
+ if (!node->index) {
+ break;
+ }
+
index = node->index;
if (row_upd_changes_ord_field_binary(node->index, node->update,
@@ -632,14 +646,14 @@ row_purge_parse_undo_rec(
roll_ptr_t roll_ptr;
ulint info_bits;
ulint type;
- ulint cmpl_info;
ut_ad(node && thr);
trx = thr_get_trx(thr);
- ptr = trx_undo_rec_get_pars(node->undo_rec, &type, &cmpl_info,
- updated_extern, &undo_no, &table_id);
+ ptr = trx_undo_rec_get_pars(
+ node->undo_rec, &type, &node->cmpl_info,
+ updated_extern, &undo_no, &table_id);
node->rec_type = type;
if (type == TRX_UNDO_UPD_DEL_REC && !(*updated_extern)) {
@@ -652,7 +666,8 @@ row_purge_parse_undo_rec(
node->table = NULL;
if (type == TRX_UNDO_UPD_EXIST_REC
- && cmpl_info & UPD_NODE_NO_ORD_CHANGE && !(*updated_extern)) {
+ && node->cmpl_info & UPD_NODE_NO_ORD_CHANGE
+ && !(*updated_extern)) {
/* Purge requires no changes to indexes: we may return */
@@ -702,7 +717,7 @@ err_exit:
/* Read to the partial row the fields that occur in indexes */
- if (!(cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+ if (!(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
ptr = trx_undo_rec_get_partial_row(
ptr, clust_index, &node->row,
type == TRX_UNDO_UPD_DEL_REC,
diff --git a/storage/innobase/row/row0row.c b/storage/innobase/row/row0row.c
index 3bd0323ddbe..20fd475343e 100644
--- a/storage/innobase/row/row0row.c
+++ b/storage/innobase/row/row0row.c
@@ -101,12 +101,27 @@ row_build_index_entry(
dfield_copy(dfield, dfield2);
- if (dfield_is_null(dfield) || ind_field->prefix_len == 0) {
+ if (dfield_is_null(dfield)) {
continue;
}
- /* If a column prefix index, take only the prefix.
- Prefix-indexed columns may be externally stored. */
+ if (ind_field->prefix_len == 0
+ && (!dfield_is_ext(dfield)
+ || dict_index_is_clust(index))) {
+ /* The dfield_copy() above suffices for
+ columns that are stored in-page, or for
+ clustered index record columns that are not
+ part of a column prefix in the PRIMARY KEY. */
+ continue;
+ }
+
+ /* If the column is stored externally (off-page) in
+ the clustered index, it must be an ordering field in
+ the secondary index. In the Antelope format, only
+ prefix-indexed columns may be stored off-page in the
+ clustered index record. In the Barracuda format, also
+ fully indexed long CHAR or VARCHAR columns may be
+ stored off-page. */
ut_ad(col->ord_part);
if (UNIV_LIKELY_NULL(ext)) {
@@ -119,15 +134,41 @@ row_build_index_entry(
}
dfield_set_data(dfield, buf, len);
}
+
+ if (ind_field->prefix_len == 0) {
+ /* In the Barracuda format
+ (ROW_FORMAT=DYNAMIC or
+ ROW_FORMAT=COMPRESSED), we can have a
+ secondary index on an entire column
+ that is stored off-page in the
+ clustered index. As this is not a
+ prefix index (prefix_len == 0),
+ include the entire off-page column in
+ the secondary index record. */
+ continue;
+ }
} else if (dfield_is_ext(dfield)) {
+ /* This table is either in Antelope format
+ (ROW_FORMAT=REDUNDANT or ROW_FORMAT=COMPACT)
+ or a purge record where the ordered part of
+ the field is not external.
+ In Antelope, the maximum column prefix
+ index length is 767 bytes, and the clustered
+ index record contains a 768-byte prefix of
+ each off-page column. */
ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
len -= BTR_EXTERN_FIELD_REF_SIZE;
+ dfield_set_len(dfield, len);
}
- len = dtype_get_at_most_n_mbchars(
- col->prtype, col->mbminmaxlen,
- ind_field->prefix_len, len, dfield_get_data(dfield));
- dfield_set_len(dfield, len);
+ /* If a column prefix index, take only the prefix. */
+ if (ind_field->prefix_len) {
+ len = dtype_get_at_most_n_mbchars(
+ col->prtype, col->mbminmaxlen,
+ ind_field->prefix_len, len,
+ dfield_get_data(dfield));
+ dfield_set_len(dfield, len);
+ }
}
ut_ad(dtuple_check_typed(entry));
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index 53d0c2ec232..5d8f53f68da 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -99,14 +99,22 @@ row_sel_sec_rec_is_for_blob(
ulint clust_len, /*!< in: length of clust_field */
const byte* sec_field, /*!< in: column in secondary index */
ulint sec_len, /*!< in: length of sec_field */
+ ulint prefix_len, /*!< in: index column prefix length
+ in bytes */
dict_table_t* table) /*!< in: table */
{
ulint len;
byte buf[REC_VERSION_56_MAX_INDEX_COL_LEN];
ulint zip_size = dict_table_flags_to_zip_size(table->flags);
- ulint max_prefix_len = DICT_MAX_FIELD_LEN_BY_FORMAT(table);
+ /* This function should never be invoked on an Antelope format
+ table, because they should always contain enough prefix in the
+ clustered index record. */
+ ut_ad(dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);
ut_a(clust_len >= BTR_EXTERN_FIELD_REF_SIZE);
+ ut_ad(prefix_len >= sec_len);
+ ut_ad(prefix_len > 0);
+ ut_a(prefix_len <= sizeof buf);
if (UNIV_UNLIKELY
(!memcmp(clust_field + clust_len - BTR_EXTERN_FIELD_REF_SIZE,
@@ -118,7 +126,7 @@ row_sel_sec_rec_is_for_blob(
return(FALSE);
}
- len = btr_copy_externally_stored_field_prefix(buf, max_prefix_len,
+ len = btr_copy_externally_stored_field_prefix(buf, prefix_len,
zip_size,
clust_field, clust_len);
@@ -132,7 +140,7 @@ row_sel_sec_rec_is_for_blob(
}
len = dtype_get_at_most_n_mbchars(prtype, mbminmaxlen,
- sec_len, len, (const char*) buf);
+ prefix_len, len, (const char*) buf);
return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len));
}
@@ -224,6 +232,7 @@ row_sel_sec_rec_is_for_clust_rec(
col->mbminmaxlen,
clust_field, clust_len,
sec_field, sec_len,
+ ifield->prefix_len,
clust_index->table)) {
goto inequal;
}
@@ -493,7 +502,7 @@ sel_col_prefetch_buf_alloc(
sel_buf = column->prefetch_buf + i;
sel_buf->data = NULL;
-
+ sel_buf->len = 0;
sel_buf->val_buf_size = 0;
}
}
@@ -518,6 +527,8 @@ sel_col_prefetch_buf_free(
mem_free(sel_buf->data);
}
}
+
+ mem_free(prefetch_buf);
}
/*********************************************************************//**
@@ -2541,6 +2552,8 @@ row_sel_field_store_in_mysql_format(
ut_ad(len != UNIV_SQL_NULL);
UNIV_MEM_ASSERT_RW(data, len);
+ UNIV_MEM_ASSERT_W(dest, templ->mysql_col_len);
+ UNIV_MEM_INVALID(dest, templ->mysql_col_len);
switch (templ->type) {
const byte* field_end;
@@ -2579,14 +2592,16 @@ row_sel_field_store_in_mysql_format(
dest = row_mysql_store_true_var_len(
dest, len, templ->mysql_length_bytes);
+ /* Copy the actual data. Leave the rest of the
+ buffer uninitialized. */
+ memcpy(dest, data, len);
+ break;
}
/* Copy the actual data */
ut_memcpy(dest, data, len);
- /* Pad with trailing spaces. We pad with spaces also the
- unused end of a >= 5.0.3 true VARCHAR column, just in case
- MySQL expects its contents to be deterministic. */
+ /* Pad with trailing spaces. */
pad = dest + len;
@@ -3113,6 +3128,39 @@ sel_restore_position_for_mysql(
}
/********************************************************************//**
+Copies a cached field for MySQL from the fetch cache. */
+static
+void
+row_sel_copy_cached_field_for_mysql(
+/*================================*/
+ byte* buf, /*!< in/out: row buffer */
+ const byte* cache, /*!< in: cached row */
+ const mysql_row_templ_t*templ) /*!< in: column template */
+{
+ ulint len;
+
+ buf += templ->mysql_col_offset;
+ cache += templ->mysql_col_offset;
+
+ UNIV_MEM_ASSERT_W(buf, templ->mysql_col_len);
+
+ if (templ->mysql_type == DATA_MYSQL_TRUE_VARCHAR
+ && templ->type != DATA_INT) {
+ /* Check for != DATA_INT to make sure we do
+ not treat MySQL ENUM or SET as a true VARCHAR!
+ Find the actual length of the true VARCHAR field. */
+ row_mysql_read_true_varchar(
+ &len, cache, templ->mysql_length_bytes);
+ len += templ->mysql_length_bytes;
+ UNIV_MEM_INVALID(buf, templ->mysql_col_len);
+ } else {
+ len = templ->mysql_col_len;
+ }
+
+ ut_memcpy(buf, cache, len);
+}
+
+/********************************************************************//**
Pops a cached row for MySQL from the fetch cache. */
UNIV_INLINE
void
@@ -3124,26 +3172,22 @@ row_sel_pop_cached_row_for_mysql(
{
ulint i;
const mysql_row_templ_t*templ;
- byte* cached_rec;
+ const byte* cached_rec;
ut_ad(prebuilt->n_fetch_cached > 0);
ut_ad(prebuilt->mysql_prefix_len <= prebuilt->mysql_row_len);
+ UNIV_MEM_ASSERT_W(buf, prebuilt->mysql_row_len);
+
+ cached_rec = prebuilt->fetch_cache[prebuilt->fetch_cache_first];
+
if (UNIV_UNLIKELY(prebuilt->keep_other_fields_on_keyread)) {
/* Copy cache record field by field, don't touch fields that
are not covered by current key */
- cached_rec = prebuilt->fetch_cache[
- prebuilt->fetch_cache_first];
for (i = 0; i < prebuilt->n_template; i++) {
templ = prebuilt->mysql_template + i;
-#if 0 /* Some of the cached_rec may legitimately be uninitialized. */
- UNIV_MEM_ASSERT_RW(cached_rec
- + templ->mysql_col_offset,
- templ->mysql_col_len);
-#endif
- ut_memcpy(buf + templ->mysql_col_offset,
- cached_rec + templ->mysql_col_offset,
- templ->mysql_col_len);
+ row_sel_copy_cached_field_for_mysql(
+ buf, cached_rec, templ);
/* Copy NULL bit of the current field from cached_rec
to buf */
if (templ->mysql_null_bit_mask) {
@@ -3153,17 +3197,24 @@ row_sel_pop_cached_row_for_mysql(
& (byte)templ->mysql_null_bit_mask;
}
}
+ } else if (prebuilt->mysql_prefix_len > 63) {
+ /* The record is long. Copy it field by field, in case
+ there are some long VARCHAR column of which only a
+ small length is being used. */
+ UNIV_MEM_INVALID(buf, prebuilt->mysql_prefix_len);
+
+ /* First copy the NULL bits. */
+ ut_memcpy(buf, cached_rec, prebuilt->null_bitmap_len);
+ /* Then copy the requested fields. */
+
+ for (i = 0; i < prebuilt->n_template; i++) {
+ row_sel_copy_cached_field_for_mysql(
+ buf, cached_rec, prebuilt->mysql_template + i);
+ }
+ } else {
+ ut_memcpy(buf, cached_rec, prebuilt->mysql_prefix_len);
}
- else {
-#if 0 /* Some of the cached_rec may legitimately be uninitialized. */
- UNIV_MEM_ASSERT_RW(prebuilt->fetch_cache
- [prebuilt->fetch_cache_first],
- prebuilt->mysql_prefix_len);
-#endif
- ut_memcpy(buf,
- prebuilt->fetch_cache[prebuilt->fetch_cache_first],
- prebuilt->mysql_prefix_len);
- }
+
prebuilt->n_fetch_cached--;
prebuilt->fetch_cache_first++;
@@ -3401,6 +3452,13 @@ row_search_for_mysql(
return(DB_MISSING_HISTORY);
}
+ if (dict_index_is_corrupted(index)) {
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
+ return(DB_CORRUPTION);
+ }
+
if (UNIV_UNLIKELY(prebuilt->magic_n != ROW_PREBUILT_ALLOCATED)) {
fprintf(stderr,
"InnoDB: Error: trying to free a corrupt\n"
diff --git a/storage/innobase/row/row0uins.c b/storage/innobase/row/row0uins.c
index d25afed3840..4fa97c9355d 100644
--- a/storage/innobase/row/row0uins.c
+++ b/storage/innobase/row/row0uins.c
@@ -328,6 +328,8 @@ row_undo_ins(
node->index = dict_table_get_next_index(
dict_table_get_first_index(node->table));
+ dict_table_skip_corrupt_index(node->index);
+
while (node->index != NULL) {
dtuple_t* entry;
ulint err;
@@ -355,7 +357,7 @@ row_undo_ins(
}
}
- node->index = dict_table_get_next_index(node->index);
+ dict_table_next_uncorrupted_index(node->index);
}
log_free_check();
diff --git a/storage/innobase/row/row0umod.c b/storage/innobase/row/row0umod.c
index 2188fdeff49..b86ce9eeabd 100644
--- a/storage/innobase/row/row0umod.c
+++ b/storage/innobase/row/row0umod.c
@@ -573,6 +573,14 @@ row_undo_mod_upd_del_sec(
heap = mem_heap_create(1024);
while (node->index != NULL) {
+
+ /* Skip all corrupted secondary index */
+ dict_table_skip_corrupt_index(node->index);
+
+ if (!node->index) {
+ break;
+ }
+
index = node->index;
entry = row_build_index_entry(node->row, node->ext,
@@ -626,6 +634,13 @@ row_undo_mod_del_mark_sec(
heap = mem_heap_create(1024);
while (node->index != NULL) {
+ /* Skip all corrupted secondary index */
+ dict_table_skip_corrupt_index(node->index);
+
+ if (!node->index) {
+ break;
+ }
+
index = node->index;
entry = row_build_index_entry(node->row, node->ext,
@@ -677,6 +692,13 @@ row_undo_mod_upd_exist_sec(
heap = mem_heap_create(1024);
while (node->index != NULL) {
+ /* Skip all corrupted secondary index */
+ dict_table_skip_corrupt_index(node->index);
+
+ if (!node->index) {
+ break;
+ }
+
index = node->index;
if (row_upd_changes_ord_field_binary(node->index, node->update,
@@ -859,6 +881,9 @@ row_undo_mod(
node->index = dict_table_get_next_index(
dict_table_get_first_index(node->table));
+ /* Skip all corrupted secondary index */
+ dict_table_skip_corrupt_index(node->index);
+
if (node->rec_type == TRX_UNDO_UPD_EXIST_REC) {
err = row_undo_mod_upd_exist_sec(node, thr);
diff --git a/storage/innobase/row/row0upd.c b/storage/innobase/row/row0upd.c
index 053b3513f1d..0c6036fe218 100644
--- a/storage/innobase/row/row0upd.c
+++ b/storage/innobase/row/row0upd.c
@@ -2305,6 +2305,13 @@ row_upd(
while (node->index != NULL) {
+ /* Skip corrupted index */
+ dict_table_skip_corrupt_index(node->index);
+
+ if (!node->index) {
+ break;
+ }
+
log_free_check();
err = row_upd_sec_step(node, thr);
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 04503d25cd4..c7427abdddd 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -222,6 +222,8 @@ UNIV_INTERN ulint srv_n_file_io_threads = ULINT_MAX;
UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;
UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;
+/* Switch to enable random read ahead. */
+UNIV_INTERN my_bool srv_random_read_ahead = FALSE;
/* User settable value of the number of pages that must be present
in the buffer cache and accessed sequentially for InnoDB to trigger a
readahead request. */
@@ -2032,6 +2034,8 @@ srv_export_innodb_status(void)
export_vars.innodb_buffer_pool_wait_free = srv_buf_pool_wait_free;
export_vars.innodb_buffer_pool_pages_flushed = srv_buf_pool_flushed;
export_vars.innodb_buffer_pool_reads = srv_buf_pool_reads;
+ export_vars.innodb_buffer_pool_read_ahead_rnd
+ = stat.n_ra_pages_read_rnd;
export_vars.innodb_buffer_pool_read_ahead
= stat.n_ra_pages_read;
export_vars.innodb_buffer_pool_read_ahead_evicted
diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c
index 397d505df50..fc4f987fe65 100644
--- a/storage/innobase/sync/sync0rw.c
+++ b/storage/innobase/sync/sync0rw.c
@@ -626,6 +626,9 @@ rw_lock_x_lock_func(
ibool spinning = FALSE;
ut_ad(rw_lock_validate(lock));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
i = 0;
@@ -715,7 +718,7 @@ mutex. */
UNIV_INTERN
void
rw_lock_debug_mutex_enter(void)
-/*==========================*/
+/*===========================*/
{
loop:
if (0 == mutex_enter_nowait(&rw_lock_debug_mutex)) {
@@ -942,11 +945,13 @@ rw_lock_list_print_info(
putc('\n', file);
}
+ rw_lock_debug_mutex_enter();
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
rw_lock_debug_print(file, info);
info = UT_LIST_GET_NEXT(list, info);
}
+ rw_lock_debug_mutex_exit();
}
#ifndef INNODB_RW_LOCKS_USE_ATOMICS
mutex_exit(&(lock->mutex));
@@ -990,11 +995,13 @@ rw_lock_print(
putc('\n', stderr);
}
+ rw_lock_debug_mutex_enter();
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
rw_lock_debug_print(stderr, info);
info = UT_LIST_GET_NEXT(list, info);
}
+ rw_lock_debug_mutex_exit();
}
}
diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
index 0b56e736209..8ea57b8655c 100644
--- a/storage/innobase/sync/sync0sync.c
+++ b/storage/innobase/sync/sync0sync.c
@@ -1209,7 +1209,6 @@ sync_thread_add_level(
case SYNC_WORK_QUEUE:
case SYNC_LOG:
case SYNC_LOG_FLUSH_ORDER:
- case SYNC_THR_LOCAL:
case SYNC_ANY_LATCH:
case SYNC_FILE_FORMAT_TAG:
case SYNC_DOUBLEWRITE:
@@ -1227,6 +1226,7 @@ sync_thread_add_level(
case SYNC_DICT_HEADER:
case SYNC_TRX_I_S_RWLOCK:
case SYNC_TRX_I_S_LAST_READ:
+ case SYNC_IBUF_MUTEX:
if (!sync_thread_levels_g(array, level, TRUE)) {
fprintf(stderr,
"InnoDB: sync_thread_levels_g(array, %lu)"
@@ -1312,22 +1312,33 @@ sync_thread_add_level(
|| sync_thread_levels_g(array, SYNC_TREE_NODE - 1, TRUE));
break;
case SYNC_TREE_NODE_NEW:
- ut_a(sync_thread_levels_contain(array, SYNC_FSP_PAGE)
- || sync_thread_levels_contain(array, SYNC_IBUF_MUTEX));
+ ut_a(sync_thread_levels_contain(array, SYNC_FSP_PAGE));
break;
case SYNC_INDEX_TREE:
- if (sync_thread_levels_contain(array, SYNC_IBUF_MUTEX)
- && sync_thread_levels_contain(array, SYNC_FSP)) {
- ut_a(sync_thread_levels_g(array, SYNC_FSP_PAGE - 1,
- TRUE));
+ ut_a(sync_thread_levels_g(array, SYNC_TREE_NODE - 1, TRUE));
+ break;
+ case SYNC_IBUF_TREE_NODE:
+ ut_a(sync_thread_levels_contain(array, SYNC_IBUF_INDEX_TREE)
+ || sync_thread_levels_g(array, SYNC_IBUF_TREE_NODE - 1,
+ TRUE));
+ break;
+ case SYNC_IBUF_TREE_NODE_NEW:
+ /* ibuf_add_free_page() allocates new pages for the
+ change buffer while only holding the tablespace
+ x-latch. These pre-allocated new pages may only be
+ taken in use while holding ibuf_mutex, in
+ btr_page_alloc_for_ibuf(). */
+ ut_a(sync_thread_levels_contain(array, SYNC_IBUF_MUTEX)
+ || sync_thread_levels_contain(array, SYNC_FSP));
+ break;
+ case SYNC_IBUF_INDEX_TREE:
+ if (sync_thread_levels_contain(array, SYNC_FSP)) {
+ ut_a(sync_thread_levels_g(array, level - 1, TRUE));
} else {
- ut_a(sync_thread_levels_g(array, SYNC_TREE_NODE - 1,
- TRUE));
+ ut_a(sync_thread_levels_g(
+ array, SYNC_IBUF_TREE_NODE - 1, TRUE));
}
break;
- case SYNC_IBUF_MUTEX:
- ut_a(sync_thread_levels_g(array, SYNC_FSP_PAGE - 1, TRUE));
- break;
case SYNC_IBUF_PESS_INSERT_MUTEX:
ut_a(sync_thread_levels_g(array, SYNC_FSP - 1, TRUE));
ut_a(!sync_thread_levels_contain(array, SYNC_IBUF_MUTEX));
diff --git a/storage/innobase/trx/trx0rec.c b/storage/innobase/trx/trx0rec.c
index 70b77ace726..0bf41780fcc 100644
--- a/storage/innobase/trx/trx0rec.c
+++ b/storage/innobase/trx/trx0rec.c
@@ -669,7 +669,6 @@ trx_undo_page_report_modify(
/* Save to the undo log the old values of the columns to be updated. */
if (update) {
-
if (trx_undo_left(undo_page, ptr) < 5) {
return(0);
@@ -1119,13 +1118,14 @@ trx_undo_rec_get_partial_row(
#endif /* !UNIV_HOTBACKUP */
/***********************************************************************//**
-Erases the unused undo log page end. */
-static
-void
+Erases the unused undo log page end.
+@return TRUE if the page contained something, FALSE if it was empty */
+static __attribute__((nonnull))
+ibool
trx_undo_erase_page_end(
/*====================*/
- page_t* undo_page, /*!< in: undo page whose end to erase */
- mtr_t* mtr) /*!< in: mtr */
+ page_t* undo_page, /*!< in/out: undo page whose end to erase */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
ulint first_free;
@@ -1135,6 +1135,7 @@ trx_undo_erase_page_end(
(UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) - first_free);
mlog_write_initial_log_record(undo_page, MLOG_UNDO_ERASE_END, mtr);
+ return(first_free != TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
}
/***********************************************************//**
@@ -1202,6 +1203,9 @@ trx_undo_report_row_operation(
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
+#ifdef UNIV_DEBUG
+ int loop_count = 0;
+#endif /* UNIV_DEBUG */
rec_offs_init(offsets_);
ut_a(dict_index_is_clust(index));
@@ -1264,7 +1268,7 @@ trx_undo_report_row_operation(
mtr_start(&mtr);
- for (;;) {
+ do {
buf_block_t* undo_block;
page_t* undo_page;
ulint offset;
@@ -1293,7 +1297,31 @@ trx_undo_report_row_operation(
version the replicate page constructed using the log
records stays identical to the original page */
- trx_undo_erase_page_end(undo_page, &mtr);
+ if (!trx_undo_erase_page_end(undo_page, &mtr)) {
+ /* The record did not fit on an empty
+ undo page. Discard the freshly allocated
+ page and return an error. */
+
+ /* When we remove a page from an undo
+ log, this is analogous to a
+ pessimistic insert in a B-tree, and we
+ must reserve the counterpart of the
+ tree latch, which is the rseg
+ mutex. We must commit the mini-transaction
+ first, because it may be holding lower-level
+ latches, such as SYNC_FSP and SYNC_FSP_PAGE. */
+
+ mtr_commit(&mtr);
+ mtr_start(&mtr);
+
+ mutex_enter(&rseg->mutex);
+ trx_undo_free_last_page(trx, undo, &mtr);
+ mutex_exit(&rseg->mutex);
+
+ err = DB_UNDO_RECORD_TOO_BIG;
+ goto err_exit;
+ }
+
mtr_commit(&mtr);
} else {
/* Success */
@@ -1313,16 +1341,15 @@ trx_undo_report_row_operation(
*roll_ptr = trx_undo_build_roll_ptr(
op_type == TRX_UNDO_INSERT_OP,
rseg->id, page_no, offset);
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
- }
- return(DB_SUCCESS);
+ err = DB_SUCCESS;
+ goto func_exit;
}
ut_ad(page_no == undo->last_page_no);
/* We have to extend the undo log by one page */
+ ut_ad(++loop_count < 2);
mtr_start(&mtr);
/* When we add a page to an undo log, this is analogous to
@@ -1334,18 +1361,19 @@ trx_undo_report_row_operation(
page_no = trx_undo_add_page(trx, undo, &mtr);
mutex_exit(&(rseg->mutex));
+ } while (UNIV_LIKELY(page_no != FIL_NULL));
- if (UNIV_UNLIKELY(page_no == FIL_NULL)) {
- /* Did not succeed: out of space */
+ /* Did not succeed: out of space */
+ err = DB_OUT_OF_FILE_SPACE;
- mutex_exit(&(trx->undo_mutex));
- mtr_commit(&mtr);
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
- }
- return(DB_OUT_OF_FILE_SPACE);
- }
+err_exit:
+ mutex_exit(&trx->undo_mutex);
+ mtr_commit(&mtr);
+func_exit:
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
}
+ return(err);
}
/*============== BUILDING PREVIOUS VERSION OF A RECORD ===============*/
diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c
index 4cb4b7b79c5..dae0637f72c 100644
--- a/storage/innobase/trx/trx0undo.c
+++ b/storage/innobase/trx/trx0undo.c
@@ -1004,29 +1004,28 @@ trx_undo_free_page(
}
/********************************************************************//**
-Frees an undo log page when there is also the memory object for the undo
-log. */
-static
+Frees the last undo log page.
+The caller must hold the rollback segment mutex. */
+UNIV_INTERN
void
-trx_undo_free_page_in_rollback(
-/*===========================*/
- trx_t* trx __attribute__((unused)), /*!< in: transaction */
- trx_undo_t* undo, /*!< in: undo log memory copy */
- ulint page_no,/*!< in: page number to free: must not be the
- header page */
- mtr_t* mtr) /*!< in: mtr which does not have a latch to any
- undo log page; the caller must have reserved
- the rollback segment mutex */
+trx_undo_free_last_page_func(
+/*==========================*/
+#ifdef UNIV_DEBUG
+ const trx_t* trx, /*!< in: transaction */
+#endif /* UNIV_DEBUG */
+ trx_undo_t* undo, /*!< in/out: undo log memory copy */
+ mtr_t* mtr) /*!< in/out: mini-transaction which does not
+ have a latch to any undo log page or which
+ has allocated the undo log page */
{
- ulint last_page_no;
-
- ut_ad(undo->hdr_page_no != page_no);
- ut_ad(mutex_own(&(trx->undo_mutex)));
+ ut_ad(mutex_own(&trx->undo_mutex));
+ ut_ad(undo->hdr_page_no != undo->last_page_no);
+ ut_ad(undo->size > 0);
- last_page_no = trx_undo_free_page(undo->rseg, FALSE, undo->space,
- undo->hdr_page_no, page_no, mtr);
+ undo->last_page_no = trx_undo_free_page(
+ undo->rseg, FALSE, undo->space,
+ undo->hdr_page_no, undo->last_page_no, mtr);
- undo->last_page_no = last_page_no;
undo->size--;
}
@@ -1062,9 +1061,11 @@ Truncates an undo log from the end. This function is used during a rollback
to free space from an undo log. */
UNIV_INTERN
void
-trx_undo_truncate_end(
-/*==================*/
- trx_t* trx, /*!< in: transaction whose undo log it is */
+trx_undo_truncate_end_func(
+/*=======================*/
+#ifdef UNIV_DEBUG
+ const trx_t* trx, /*!< in: transaction whose undo log it is */
+#endif /* UNIV_DEBUG */
trx_undo_t* undo, /*!< in: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
@@ -1090,18 +1091,7 @@ trx_undo_truncate_end(
rec = trx_undo_page_get_last_rec(undo_page, undo->hdr_page_no,
undo->hdr_offset);
- for (;;) {
- if (rec == NULL) {
- if (last_page_no == undo->hdr_page_no) {
-
- goto function_exit;
- }
-
- trx_undo_free_page_in_rollback(
- trx, undo, last_page_no, &mtr);
- break;
- }
-
+ while (rec) {
if (trx_undo_rec_get_undo_no(rec) >= limit) {
/* Truncate at least this record off, maybe
more */
@@ -1115,6 +1105,14 @@ trx_undo_truncate_end(
undo->hdr_offset);
}
+ if (last_page_no == undo->hdr_page_no) {
+
+ goto function_exit;
+ }
+
+ ut_ad(last_page_no == undo->last_page_no);
+ trx_undo_free_last_page(trx, undo, &mtr);
+
mtr_commit(&mtr);
}
diff --git a/storage/innobase/ut/ut0mem.c b/storage/innobase/ut/ut0mem.c
index 53f15029e1b..303fdd6dd44 100644
--- a/storage/innobase/ut/ut0mem.c
+++ b/storage/innobase/ut/ut0mem.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -483,53 +483,6 @@ ut_strlcpy_rev(
return(src_size);
}
-/**********************************************************************//**
-Make a quoted copy of a NUL-terminated string. Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_memcpyq().
-@return pointer to end of dest */
-UNIV_INTERN
-char*
-ut_strcpyq(
-/*=======*/
- char* dest, /*!< in: output buffer */
- char q, /*!< in: the quote character */
- const char* src) /*!< in: null-terminated string */
-{
- while (*src) {
- if ((*dest++ = *src++) == q) {
- *dest++ = q;
- }
- }
-
- return(dest);
-}
-
-/**********************************************************************//**
-Make a quoted copy of a fixed-length string. Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_strcpyq().
-@return pointer to end of dest */
-UNIV_INTERN
-char*
-ut_memcpyq(
-/*=======*/
- char* dest, /*!< in: output buffer */
- char q, /*!< in: the quote character */
- const char* src, /*!< in: string to be quoted */
- ulint len) /*!< in: length of src */
-{
- const char* srcend = src + len;
-
- while (src < srcend) {
- if ((*dest++ = *src++) == q) {
- *dest++ = q;
- }
- }
-
- return(dest);
-}
-
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Return the number of times s2 occurs in s1. Overlapping instances of s2
diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c
index a9c0d381e16..f6dfb3ba0b3 100644
--- a/storage/innobase/ut/ut0ut.c
+++ b/storage/innobase/ut/ut0ut.c
@@ -674,8 +674,6 @@ ut_strerr(
return("Cannot add constraint");
case DB_CORRUPTION:
return("Data structure corruption");
- case DB_COL_APPEARS_TWICE_IN_INDEX:
- return("Column appears twice in index");
case DB_CANNOT_DROP_CONSTRAINT:
return("Cannot drop constraint");
case DB_NO_SAVEPOINT:
@@ -714,6 +712,10 @@ ut_strerr(
return("No index on referencing keys in referencing table");
case DB_PARENT_NO_INDEX:
return("No index on referenced keys in referenced table");
+ case DB_INDEX_CORRUPT:
+ return("Index corrupted");
+ case DB_UNDO_RECORD_TOO_BIG:
+ return("Undo record too big");
case DB_END_OF_INDEX:
return("End of index");
/* do not add default: in order to produce a warning if new code
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 650eb160866..56d0149a748 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2005 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
@@ -358,7 +358,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
int subkeys=1;
my_bool can_go_down;
MI_INFO *info=ftb->info;
- uint UNINIT_VAR(off), extra=HA_FT_WLEN+info->s->base.rec_reflength;
+ uint UNINIT_VAR(off), extra= HA_FT_WLEN + info->s->rec_reflength;
uchar *lastkey_buf=ftbw->word+ftbw->off;
if (ftbw->flags & FTB_FLAG_TRUNC)
diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c
index 366b7bc3061..97ab2a6434e 100644
--- a/storage/myisam/ft_nlq_search.c
+++ b/storage/myisam/ft_nlq_search.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2005 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
@@ -73,7 +73,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar *keybuff=aio->keybuff;
MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr;
my_off_t key_root=info->s->state.key_root[aio->keynr];
- uint extra=HA_FT_WLEN+info->s->base.rec_reflength;
+ uint extra= HA_FT_WLEN + info->s->rec_reflength;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight;
#else
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index 31e72e8e0a6..c534a9a060b 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
diff --git a/storage/myisam/ft_static.c b/storage/myisam/ft_static.c
index 6a0bda5b666..aa8adba88a2 100644
--- a/storage/myisam/ft_static.c
+++ b/storage/myisam/ft_static.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c
index a2ddb49ecf0..19144ff01fb 100644
--- a/storage/myisam/ft_update.c
+++ b/storage/myisam/ft_update.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004, 2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h
index cf00594629c..5c7f4c64a51 100644
--- a/storage/myisam/ftdefs.h
+++ b/storage/myisam/ftdefs.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
diff --git a/storage/myisam/fulltext.h b/storage/myisam/fulltext.h
index 9aef2d0d002..f3fda334472 100644
--- a/storage/myisam/fulltext.h
+++ b/storage/myisam/fulltext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index f20182f8823..25020e76c7f 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_IMPLEMENTATION
@@ -2251,7 +2252,8 @@ mysql_declare_plugin(myisam)
0x0100, /* 1.0 */
NULL, /* status variables */
myisam_sysvars, /* system variables */
- NULL
+ NULL,
+ 0,
}
mysql_declare_plugin_end;
maria_declare_plugin(myisam)
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 35d52a22c71..0de25c6d355 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/myisam/mi_cache.c b/storage/myisam/mi_cache.c
index ddbfda11326..6e9feaefb2d 100644
--- a/storage/myisam/mi_cache.c
+++ b/storage/myisam/mi_cache.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000-2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions for read record cacheing with myisam
diff --git a/storage/myisam/mi_changed.c b/storage/myisam/mi_changed.c
index 049974e4a65..e7ceff24287 100644
--- a/storage/myisam/mi_changed.c
+++ b/storage/myisam/mi_changed.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001 MySQL AB
+/* Copyright (c) 2000, 2001, 2005, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Check if somebody has changed table since last check. */
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 65d218b216d..10c0567e508 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Describe, check and repair of MyISAM tables */
@@ -3885,7 +3886,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
SORT_FT_BUF *ft_buf=sort_info->ft_buf;
SORT_KEY_BLOCKS *key_block=sort_info->key_block;
- val_len=HA_FT_WLEN+sort_info->info->s->base.rec_reflength;
+ val_len= HA_FT_WLEN + sort_info->info->s->rec_reflength;
get_key_full_length_rdonly(a_len, (uchar *)a);
if (!ft_buf)
@@ -3895,7 +3896,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
and row format is NOT static - for _mi_dpointer not to garble offsets
*/
if ((sort_info->info->s->base.key_reflength <=
- sort_info->info->s->base.rec_reflength) &&
+ sort_info->info->s->rec_reflength) &&
(sort_info->info->s->options &
(HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)))
ft_buf=(SORT_FT_BUF *)my_malloc(sort_param->keyinfo->block_length +
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c
index 473c3086c41..6e9ee7747ae 100644
--- a/storage/myisam/mi_close.c
+++ b/storage/myisam/mi_close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* close a isam-database */
/*
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 0a735f07088..7c7f11ddf78 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Create a MyISAM table */
diff --git a/storage/myisam/mi_dbug.c b/storage/myisam/mi_dbug.c
index 3bcacef0b69..4606e0af170 100644
--- a/storage/myisam/mi_dbug.c
+++ b/storage/myisam/mi_dbug.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Support rutiner with are using with dbug */
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index 6d2ca5b1f8d..907d8e291f6 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Remove a row from a MyISAM table */
diff --git a/storage/myisam/mi_delete_all.c b/storage/myisam/mi_delete_all.c
index a21a2a3093a..5e9cb26c0ad 100644
--- a/storage/myisam/mi_delete_all.c
+++ b/storage/myisam/mi_delete_all.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Remove all rows from a MyISAM table */
/* This clears the status information and truncates files */
diff --git a/storage/myisam/mi_delete_table.c b/storage/myisam/mi_delete_table.c
index a05a2ad6237..b6530334dd2 100644
--- a/storage/myisam/mi_delete_table.c
+++ b/storage/myisam/mi_delete_table.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2004, 2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
deletes a table
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index aeb81d4e09c..7a86ff63136 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions to handle space-packed-records and blobs
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index f139dd1aad7..c3dd9cb6645 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
#ifdef HAVE_SYS_MMAN_H
diff --git a/storage/myisam/mi_extrafunc.h b/storage/myisam/mi_extrafunc.h
index 4aa28832c6d..2109796763d 100644
--- a/storage/myisam/mi_extrafunc.h
+++ b/storage/myisam/mi_extrafunc.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
void _mi_report_crashed(MI_INFO *file __attribute__((unused)),
const char *message __attribute__((unused)),
diff --git a/storage/myisam/mi_info.c b/storage/myisam/mi_info.c
index 36d7073a4dc..3b9288eeb83 100644
--- a/storage/myisam/mi_info.c
+++ b/storage/myisam/mi_info.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001, 2003-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2001, 2003-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Return useful base information for an open table */
diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c
index e51534b3180..004fd054f1c 100644
--- a/storage/myisam/mi_key.c
+++ b/storage/myisam/mi_key.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to handle keys */
diff --git a/storage/myisam/mi_keycache.c b/storage/myisam/mi_keycache.c
index be7d3cc6f1e..a2422b71bbf 100644
--- a/storage/myisam/mi_keycache.c
+++ b/storage/myisam/mi_keycache.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2003-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Key cache assignments
diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c
index 6eb25f089b2..824855a0211 100644
--- a/storage/myisam/mi_locking.c
+++ b/storage/myisam/mi_locking.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
locking of isam-tables.
diff --git a/storage/myisam/mi_log.c b/storage/myisam/mi_log.c
index ac3aa7c149b..7004144c8bc 100644
--- a/storage/myisam/mi_log.c
+++ b/storage/myisam/mi_log.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Logging of MyISAM commands and records on logfile for debugging
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 53ecdaeda21..0adffcf4c13 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* open a isam-database */
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index ceb087d67c9..917bc9f4409 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to compressed records */
diff --git a/storage/myisam/mi_page.c b/storage/myisam/mi_page.c
index 82acb801c90..868b28315c4 100644
--- a/storage/myisam/mi_page.c
+++ b/storage/myisam/mi_page.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004, 2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Read and write key blocks */
diff --git a/storage/myisam/mi_panic.c b/storage/myisam/mi_panic.c
index 93be70d2af3..8607b8aea88 100644
--- a/storage/myisam/mi_panic.c
+++ b/storage/myisam/mi_panic.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001, 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2003, 2005, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "fulltext.h"
diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c
index 79d3db83796..5c974cbea0e 100644
--- a/storage/myisam/mi_preload.c
+++ b/storage/myisam/mi_preload.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Preload indexes into key cache
diff --git a/storage/myisam/mi_range.c b/storage/myisam/mi_range.c
index 8f598200634..9d40d1a25c4 100644
--- a/storage/myisam/mi_range.c
+++ b/storage/myisam/mi_range.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2004, 2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Gives a approximated number of how many records there is between two keys.
diff --git a/storage/myisam/mi_rename.c b/storage/myisam/mi_rename.c
index 455d45cecfe..3c0f2e97216 100644
--- a/storage/myisam/mi_rename.c
+++ b/storage/myisam/mi_rename.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Rename a table
diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c
index c88a81962d8..b1c0c0a4829 100644
--- a/storage/myisam/mi_rkey.c
+++ b/storage/myisam/mi_rkey.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Read record based on a key */
diff --git a/storage/myisam/mi_rnext.c b/storage/myisam/mi_rnext.c
index 51a60a76f79..17cd708cd3c 100644
--- a/storage/myisam/mi_rnext.c
+++ b/storage/myisam/mi_rnext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
diff --git a/storage/myisam/mi_rnext_same.c b/storage/myisam/mi_rnext_same.c
index ea1449f2c98..d6856459ae7 100644
--- a/storage/myisam/mi_rnext_same.c
+++ b/storage/myisam/mi_rnext_same.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
#include "rt_index.h"
diff --git a/storage/myisam/mi_rprev.c b/storage/myisam/mi_rprev.c
index a0b4ec4d927..27fbda95574 100644
--- a/storage/myisam/mi_rprev.c
+++ b/storage/myisam/mi_rprev.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2001, 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
diff --git a/storage/myisam/mi_rsame.c b/storage/myisam/mi_rsame.c
index ea41dc73c92..8258dcdb809 100644
--- a/storage/myisam/mi_rsame.c
+++ b/storage/myisam/mi_rsame.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2001, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index c49fddf0f3b..6011cbe29c2 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* key handling functions */
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index 9d480cb414d..30e463746d5 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002, 2004-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Static variables for MyISAM library. All definied here for easy making of
diff --git a/storage/myisam/mi_statrec.c b/storage/myisam/mi_statrec.c
index bf791726aa9..b8fa7554034 100644
--- a/storage/myisam/mi_statrec.c
+++ b/storage/myisam/mi_statrec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002, 2004-2006 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to handle fixed-length-records */
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index e9dbc7c6a69..e048a83d3f0 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Testing of the basic functions of a MyISAM table */
diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c
index a3303428a08..5906c9dc70a 100644
--- a/storage/myisam/mi_test2.c
+++ b/storage/myisam/mi_test2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Test av isam-databas: stor test */
diff --git a/storage/myisam/mi_test3.c b/storage/myisam/mi_test3.c
index 742fd06b0e3..885118d4eec 100644
--- a/storage/myisam/mi_test3.c
+++ b/storage/myisam/mi_test3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Test av locking */
diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c
index cee159951de..6df4c07ee0d 100644
--- a/storage/myisam/mi_unique.c
+++ b/storage/myisam/mi_unique.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Functions to check if a row is unique */
diff --git a/storage/myisam/mi_update.c b/storage/myisam/mi_update.c
index 2104e4c4117..66193ea1673 100644
--- a/storage/myisam/mi_update.c
+++ b/storage/myisam/mi_update.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Update an old row in a MyISAM table */
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 1c9a25f8e86..f00238347ae 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Write a row to a MyISAM table */
@@ -518,7 +519,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
if (keyinfo->block_length - a_length < 32 &&
keyinfo->flag & HA_FULLTEXT && key_pos == endpos &&
- info->s->base.key_reflength <= info->s->base.rec_reflength &&
+ info->s->base.key_reflength <= info->s->rec_reflength &&
info->s->options & (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD))
{
/*
diff --git a/storage/myisam/myisam_ftdump.c b/storage/myisam/myisam_ftdump.c
index d51e079625e..cb09c3d20dd 100644
--- a/storage/myisam/myisam_ftdump.c
+++ b/storage/myisam/myisam_ftdump.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2006 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Written by Sergei A. Golubchik, who has a shared copyright to this code
added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 8f49ce5a5ed..222097146fc 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is included by all internal myisam files */
diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c
index a17823a45b5..c09e0091a56 100644
--- a/storage/myisam/myisamlog.c
+++ b/storage/myisam/myisamlog.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* write whats in isam.log */
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 320954147d1..851f5bda700 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Pack MyISAM file */
diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c
index 0b7cc43e062..48f9b82a0b5 100644
--- a/storage/myisam/rt_split.c
+++ b/storage/myisam/rt_split.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005 MySQL AB & Alexey Botchkov
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
diff --git a/storage/myisam/rt_test.c b/storage/myisam/rt_test.c
index 50cdc538668..8b537d134ef 100644
--- a/storage/myisam/rt_test.c
+++ b/storage/myisam/rt_test.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Testing of the basic functions of a MyISAM rtree table */
/* Written by Alex Barkov who has a shared copyright to this code */
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index eb462d8c23e..cc05121f164 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Creates a index for a database by reading keys, sorting them and outputing
diff --git a/storage/myisam/sp_key.c b/storage/myisam/sp_key.c
index bde0e1cb388..3837ed01bd2 100644
--- a/storage/myisam/sp_key.c
+++ b/storage/myisam/sp_key.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & Ramil Kalimullin
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
diff --git a/storage/myisam/sp_test.c b/storage/myisam/sp_test.c
index d86fdc03908..cf4519a7734 100644
--- a/storage/myisam/sp_test.c
+++ b/storage/myisam/sp_test.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Testing of the basic functions of a MyISAM spatial table */
/* Written by Alex Barkov, who has a shared copyright to this code */
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 0db96444451..05cd1616dc2 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
@@ -160,9 +160,14 @@ extern "C" void myrg_print_wrong_table(const char *table_name)
buf[db.length]= '.';
memcpy(buf + db.length + 1, name.str, name.length);
buf[db.length + name.length + 1]= 0;
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ADMIN_WRONG_MRG_TABLE, ER(ER_ADMIN_WRONG_MRG_TABLE),
- buf);
+ /*
+ Push an error to be reported as part of CHECK/REPAIR result-set.
+ Note that calling my_error() from handler is a hack which is kept
+ here to avoid refactoring. Normally engines should report errors
+ through return value which will be interpreted by caller using
+ handler::print_error() call.
+ */
+ my_error(ER_ADMIN_WRONG_MRG_TABLE, MYF(0), buf);
}
@@ -594,8 +599,7 @@ public:
@return pointer to open MyISAM table structure
@retval !=NULL OK, returning pointer
- @retval NULL, my_errno == 0 Ok, no more child tables
- @retval NULL, my_errno != 0 error
+ @retval NULL, Error.
@detail
This function retrieves the MyISAM table handle from the
@@ -615,17 +619,33 @@ extern "C" MI_INFO *myisammrg_attach_children_callback(void *callback_param)
MI_INFO *myisam= NULL;
DBUG_ENTER("myisammrg_attach_children_callback");
- if (!child_l)
- {
- DBUG_PRINT("myrg", ("No more children to attach"));
- my_errno= 0; /* Ok, no more child tables. */
- goto end;
- }
+ /*
+ Number of children in the list and MYRG_INFO::tables_count,
+ which is used by caller of this function, should always match.
+ */
+ DBUG_ASSERT(child_l);
+
child= child_l->table;
/* Prepare for next child. */
param->next();
/*
+ When MERGE table is opened for CHECK or REPAIR TABLE statements,
+ failure to open any of underlying tables is ignored until this moment
+ (this is needed to provide complete list of the problematic underlying
+ tables in CHECK/REPAIR TABLE output).
+ Here we detect such a situation and report an appropriate error.
+ */
+ if (! child)
+ {
+ DBUG_PRINT("error", ("failed to open underlying table '%s'.'%s'",
+ child_l->db, child_l->table_name));
+ /* This should only happen inside of CHECK/REPAIR TABLE. */
+ DBUG_ASSERT(current_thd->open_options & HA_OPEN_FOR_REPAIR);
+ goto end;
+ }
+
+ /*
Do a quick compatibility check. The table def version is set when
the table share is created. The child def version is copied
from the table def version after a successful compatibility check.
@@ -654,7 +674,6 @@ extern "C" MI_INFO *myisammrg_attach_children_callback(void *callback_param)
{
DBUG_PRINT("error", ("temporary table mismatch parent: %d child: %d",
parent->s->tmp_table, child->s->tmp_table));
- my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
goto end;
}
@@ -665,12 +684,27 @@ extern "C" MI_INFO *myisammrg_attach_children_callback(void *callback_param)
DBUG_PRINT("error", ("no MyISAM handle for child table: '%s'.'%s' 0x%lx",
child->s->db.str, child->s->table_name.str,
(long) child));
- my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
}
- DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx my_errno: %d",
- my_errno ? 0L : (long) myisam, my_errno));
+
+ DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx", (long) myisam));
end:
+
+ if (!myisam &&
+ (current_thd->open_options & HA_OPEN_FOR_REPAIR))
+ {
+ char buf[2*NAME_LEN + 1 + 1];
+ strxnmov(buf, sizeof(buf) - 1, child_l->db, ".", child_l->table_name, NULL);
+ /*
+ Push an error to be reported as part of CHECK/REPAIR result-set.
+ Note that calling my_error() from handler is a hack which is kept
+ here to avoid refactoring. Normally engines should report errors
+ through return value which will be interpreted by caller using
+ handler::print_error() call.
+ */
+ my_error(ER_ADMIN_WRONG_MRG_TABLE, MYF(0), buf);
+ }
+
DBUG_RETURN(myisam);
}
@@ -783,12 +817,6 @@ int ha_myisammrg::attach_children(void)
/* Must call this with children list in place. */
DBUG_ASSERT(this->table->pos_in_table_list->next_global == this->children_l);
- /*
- 'my_errno' is set by myisammrg_attach_children_callback() in
- case of an error.
- */
- my_errno= 0;
-
if (myrg_attach_children(this->file, this->test_if_locked |
current_thd->open_options,
myisammrg_attach_children_callback, &param,
@@ -1665,7 +1693,8 @@ mysql_declare_plugin(myisammrg)
0x0100, /* 1.0 */
NULL, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(myisammrg)
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index 735c7ff53be..5ebe6c56ca5 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef USE_PRAGMA_INTERFACE
diff --git a/storage/myisammrg/myrg_close.c b/storage/myisammrg/myrg_close.c
index 066a09cadbc..97c35619067 100644
--- a/storage/myisammrg/myrg_close.c
+++ b/storage/myisammrg/myrg_close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* close a isam-database */
diff --git a/storage/myisammrg/myrg_create.c b/storage/myisammrg/myrg_create.c
index 5fbf8a44b8d..53c104b4c4a 100644
--- a/storage/myisammrg/myrg_create.c
+++ b/storage/myisammrg/myrg_create.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2001, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Create a MYMERGE_-file */
diff --git a/storage/myisammrg/myrg_def.h b/storage/myisammrg/myrg_def.h
index 9bc0881b212..e6fa869ff9b 100644
--- a/storage/myisammrg/myrg_def.h
+++ b/storage/myisammrg/myrg_def.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001, 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is included by all myisam-merge files */
diff --git a/storage/myisammrg/myrg_extra.c b/storage/myisammrg/myrg_extra.c
index 0b9c138a188..18cc66cf937 100644
--- a/storage/myisammrg/myrg_extra.c
+++ b/storage/myisammrg/myrg_extra.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000-2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Extra functions we want to do with a database
diff --git a/storage/myisammrg/myrg_info.c b/storage/myisammrg/myrg_info.c
index 1930351ec8f..53484b430b3 100644
--- a/storage/myisammrg/myrg_info.c
+++ b/storage/myisammrg/myrg_info.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2002 MySQL AB
+/* Copyright (c) 2000, 2001, 2005, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myrg_def.h"
diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c
index ab1d9ad7f7e..4f1294b0e89 100644
--- a/storage/myisammrg/myrg_open.c
+++ b/storage/myisammrg/myrg_open.c
@@ -388,6 +388,7 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
uint UNINIT_VAR(key_parts);
uint min_keys;
my_bool bad_children= FALSE;
+ my_bool first_child= TRUE;
DBUG_ENTER("myrg_attach_children");
DBUG_PRINT("myrg", ("handle_locking: %d", handle_locking));
@@ -402,16 +403,26 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
errpos= 0;
file_offset= 0;
min_keys= 0;
- child_nr= 0;
- while ((myisam= (*callback)(callback_param)))
+ for (child_nr= 0; child_nr < m_info->tables; child_nr++)
{
+ if (! (myisam= (*callback)(callback_param)))
+ {
+ if (handle_locking & HA_OPEN_FOR_REPAIR)
+ {
+ /* An appropriate error should've been already pushed by callback. */
+ bad_children= TRUE;
+ continue;
+ }
+ goto bad_children;
+ }
+
DBUG_PRINT("myrg", ("child_nr: %u table: '%s'",
child_nr, myisam->filename));
- DBUG_ASSERT(child_nr < m_info->tables);
/* Special handling when the first child is attached. */
- if (!child_nr)
+ if (first_child)
{
+ first_child= FALSE;
m_info->reclength= myisam->s->base.reclength;
min_keys= myisam->s->base.keys;
key_parts= myisam->s->base.key_parts;
@@ -461,14 +472,11 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
for (idx= 0; idx < key_parts; idx++)
m_info->rec_per_key_part[idx]+= (myisam->s->state.rec_per_key_part[idx] /
m_info->tables);
- child_nr++;
}
if (bad_children)
goto bad_children;
- /* Note: callback() resets my_errno, so it is safe to check it here */
- if (my_errno == HA_ERR_WRONG_MRG_TABLE_DEF)
- goto err;
+
if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
{
my_errno= HA_ERR_RECORD_FILE_FULL;
diff --git a/storage/myisammrg/myrg_queue.c b/storage/myisammrg/myrg_queue.c
index b13eee3ed75..2ec580e4797 100644
--- a/storage/myisammrg/myrg_queue.c
+++ b/storage/myisammrg/myrg_queue.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003, 2005 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myrg_def.h"
diff --git a/storage/myisammrg/myrg_rkey.c b/storage/myisammrg/myrg_rkey.c
index c00ca79056f..95056c09a49 100644
--- a/storage/myisammrg/myrg_rkey.c
+++ b/storage/myisammrg/myrg_rkey.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003, 2005 MySQL AB
+/* Copyright (c) 2000-2003, 2005-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Read record based on a key */
diff --git a/storage/myisammrg/myrg_static.c b/storage/myisammrg/myrg_static.c
index b518a3d84c8..b36b7741a64 100644
--- a/storage/myisammrg/myrg_static.c
+++ b/storage/myisammrg/myrg_static.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2001, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2001, 2005, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Static variables for pisam library. All definied here for easy making of
diff --git a/storage/ndb/MAINTAINERS b/storage/ndb/MAINTAINERS
index d1547d48234..38f504cd1a1 100644
--- a/storage/ndb/MAINTAINERS
+++ b/storage/ndb/MAINTAINERS
@@ -1,3 +1,5 @@
+Copyright (c) 2007 MySQL AB
+
MySQL Cluster MAINTAINERS
-------------------------
diff --git a/storage/ndb/config/win-lib.am b/storage/ndb/config/win-lib.am
index 1e7bbfae19b..2922cf6cfd2 100644
--- a/storage/ndb/config/win-lib.am
+++ b/storage/ndb/config/win-lib.am
@@ -1,5 +1,21 @@
# Microsoft Developer Studio Project File - Name="@name@" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
+
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
diff --git a/storage/ndb/config/win-prg.am b/storage/ndb/config/win-prg.am
index 5d56d79c41e..838345566a2 100644
--- a/storage/ndb/config/win-prg.am
+++ b/storage/ndb/config/win-prg.am
@@ -1,5 +1,21 @@
# Microsoft Developer Studio Project File - Name="mysqld" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
+
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp
index 7dc71e7399a..cd3fc0d4fbb 100644
--- a/storage/ndb/src/kernel/blocks/lgman.cpp
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp
@@ -1,4 +1,5 @@
-/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -12,8 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
#include "lgman.hpp"
#include "diskpage.hpp"
diff --git a/storage/ndb/test/run-test/autotest-boot.sh b/storage/ndb/test/run-test/autotest-boot.sh
index 1df3a26cc8a..f1f8aea2519 100644
--- a/storage/ndb/test/run-test/autotest-boot.sh
+++ b/storage/ndb/test/run-test/autotest-boot.sh
@@ -1,4 +1,21 @@
#!/bin/sh
+
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#############################################################
# This script created by Jonas does the following #
# Cleans up clones and pevious builds, pulls new clones, #
diff --git a/storage/ndb/test/run-test/autotest-run.sh b/storage/ndb/test/run-test/autotest-run.sh
index b543cd1efb9..0c9c6aee215 100644
--- a/storage/ndb/test/run-test/autotest-run.sh
+++ b/storage/ndb/test/run-test/autotest-run.sh
@@ -1,4 +1,21 @@
#!/bin/sh
+
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#############################################################
# This script created by Jonas does the following #
# Cleans up clones and pevious builds, pulls new clones, #
diff --git a/storage/ndb/test/run-test/files.cpp b/storage/ndb/test/run-test/files.cpp
index c6a29350b91..294d0aca56e 100644
--- a/storage/ndb/test/run-test/files.cpp
+++ b/storage/ndb/test/run-test/files.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (c) 2007 MySQL AB
+ Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
#include "atrt.hpp"
#include <sys/types.h>
#include <dirent.h>
diff --git a/storage/ndb/test/run-test/setup.cpp b/storage/ndb/test/run-test/setup.cpp
index fc30c998865..52fbe5a8e8e 100644
--- a/storage/ndb/test/run-test/setup.cpp
+++ b/storage/ndb/test/run-test/setup.cpp
@@ -1,3 +1,20 @@
+/*
+ Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
#include "atrt.hpp"
#include <ndb_global.h>
#include <my_sys.h>
diff --git a/storage/ndb/test/run-test/upgrade-boot.sh b/storage/ndb/test/run-test/upgrade-boot.sh
index d3542166551..745418dbb7c 100644
--- a/storage/ndb/test/run-test/upgrade-boot.sh
+++ b/storage/ndb/test/run-test/upgrade-boot.sh
@@ -1,4 +1,21 @@
#!/bin/sh
+
+# Copyright (c) 2007 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#############################################################
# This script created by Jonas does the following #
# Cleans up clones and pevious builds, pulls new clones, #
diff --git a/storage/ndb/test/sql/BANK.sql b/storage/ndb/test/sql/BANK.sql
deleted file mode 100644
index 055761621e3..00000000000
--- a/storage/ndb/test/sql/BANK.sql
+++ /dev/null
@@ -1,44 +0,0 @@
-CREATE DATABASE IF NOT EXISTS BANK default charset=latin1 default collate=latin1_bin;
-USE BANK;
-DROP TABLE IF EXISTS GL;
-CREATE TABLE GL ( TIME BIGINT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- BALANCE INT UNSIGNED NOT NULL,
- DEPOSIT_COUNT INT UNSIGNED NOT NULL,
- DEPOSIT_SUM INT UNSIGNED NOT NULL,
- WITHDRAWAL_COUNT INT UNSIGNED NOT NULL,
- WITHDRAWAL_SUM INT UNSIGNED NOT NULL,
- PURGED INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (TIME,ACCOUNT_TYPE))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS ACCOUNT;
-CREATE TABLE ACCOUNT ( ACCOUNT_ID INT UNSIGNED NOT NULL,
- OWNER INT UNSIGNED NOT NULL,
- BALANCE INT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (ACCOUNT_ID))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS TRANSACTION;
-CREATE TABLE TRANSACTION ( TRANSACTION_ID BIGINT UNSIGNED NOT NULL,
- ACCOUNT INT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- OTHER_ACCOUNT INT UNSIGNED NOT NULL,
- TRANSACTION_TYPE INT UNSIGNED NOT NULL,
- TIME BIGINT UNSIGNED NOT NULL,
- AMOUNT INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (TRANSACTION_ID,ACCOUNT))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS SYSTEM_VALUES;
-CREATE TABLE SYSTEM_VALUES ( SYSTEM_VALUES_ID INT UNSIGNED NOT NULL,
- VALUE BIGINT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (SYSTEM_VALUES_ID))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS ACCOUNT_TYPE;
-CREATE TABLE ACCOUNT_TYPE ( ACCOUNT_TYPE_ID INT UNSIGNED NOT NULL,
- DESCRIPTION CHAR(64) NOT NULL,
- PRIMARY KEY USING HASH (ACCOUNT_TYPE_ID))
- ENGINE = NDB;
diff --git a/storage/ndb/test/sql/T1.sql b/storage/ndb/test/sql/T1.sql
deleted file mode 100644
index 754211c4eac..00000000000
--- a/storage/ndb/test/sql/T1.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-create database if not exists TEST_DB;
-use TEST_DB;
-drop table if exists T1;
-create table T1 (KOL1 int unsigned not null,
- KOL2 int unsigned not null,
- KOL3 int unsigned not null,
- KOL4 int unsigned not null,
- KOL5 int unsigned not null,
- primary key using hash(KOL1)) engine=ndb;
diff --git a/storage/ndb/test/sql/test_create_drop.pl b/storage/ndb/test/sql/test_create_drop.pl
deleted file mode 100644
index eb9d5e31dc8..00000000000
--- a/storage/ndb/test/sql/test_create_drop.pl
+++ /dev/null
@@ -1,196 +0,0 @@
-# Copyright (C) 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-use strict;
-use IO::Socket;
-use DBI;
-
-# mgm info
-my $mgmhost = "localhost";
-my $mgmport = 38101;
-
-# location of ndb_x_fs
-my $datadir = "c2";
-my @schemafiles = <$datadir/ndb_*_fs/D[12]/DBDICT/P0.SchemaLog>;
-@schemafiles or die "no schemafiles in $datadir";
-
-my $dsn;
-$dsn = "dbi:mysql:test:localhost;port=38100";
-
-# this works better for me
-my $cnf = $ENV{MYSQL_HOME} . "/var/my.cnf";
-$dsn = "dbi:mysql:database=test;host=localhost;mysql_read_default_file=$cnf";
-
-my $dbh;
-$dbh = DBI->connect($dsn, 'root', undef, { RaiseError => 0, PrintError => 0 });
-$dbh or die $DBI::errstr;
-
-# mgm commands
-
-my $mgm = undef;
-
-sub mgmconnect {
- $mgm = IO::Socket::INET->new(
- Proto => "tcp",
- PeerHost => $mgmhost,
- PeerPort => $mgmport);
- $mgm or die "connect to mgm failed: $!";
- $mgm->autoflush(1);
-};
-
-mgmconnect();
-warn "connected to mgm $mgmhost $mgmport\n";
-
-my $nodeinfo = {};
-
-sub getnodeinfo {
- $nodeinfo = {};
- $mgm->print("get status\n");
- $mgm->print("\n");
- while (defined($_ = $mgm->getline)) {
- /^node\s+status/ && last;
- }
- while (defined($_ = $mgm->getline)) {
- /^\s*$/ && last;
- /^node\.(\d+)\.(\w+):\s*(\S+)/ && ($nodeinfo->{$1}{$2} = $3);
- }
-}
-
-getnodeinfo();
-
-my @dbnode = ();
-for my $n (keys %$nodeinfo) {
- my $p = $nodeinfo->{$n};
- ($p->{type} eq 'NDB') && push(@dbnode, $n);
-}
-@dbnode = sort { $a <=> $b } @dbnode;
-@dbnode or die "mgm error, found no db nodes";
-warn "db nodes: @dbnode\n";
-
-sub restartnode {
- my($n, $initialstart) = @_;
- warn "restart node $n initialstart=$initialstart\n";
- $mgm->print("restart node\n");
- $mgm->print("node: $n\n");
- $mgm->print("initialstart: $initialstart\n");
- $mgm->print("\n");
- while (1) {
- sleep 5;
- getnodeinfo();
- my $status = $nodeinfo->{$n}{status};
- my $sp = $nodeinfo->{$n}{startphase};
- warn "node $n status: $status sp: $sp\n";
- last if $status eq 'STARTED';
- }
-}
-
-sub restartall {
- warn "restart all\n";
- $mgm->print("restart all\n");
- $mgm->print("\n");
- while (1) {
- sleep 5;
- getnodeinfo();
- my $ok = 1;
- for my $n (@dbnode) {
- my $status = $nodeinfo->{$n}{status};
- my $sp = $nodeinfo->{$n}{startphase};
- warn "node $n status: $status sp: $sp\n";
- $ok = 0 if $status ne 'STARTED';
- }
- last if $ok;
- }
-}
-
-# the sql stuff
-
-my $maxtab = 300;
-my @tab = ();
-
-sub create {
- my($n) = @_;
- my $sql = "create table t$n (a int primary key, b varchar(20), key (b)) engine=ndb";
- warn "create t$n\n";
- $dbh->do($sql) or die "$sql\n$DBI::errstr";
-}
-
-sub drop {
- my($n) = @_;
- my $sql = "drop table t$n";
- warn "drop t$n\n";
- $dbh->do($sql) or die "$sql\n$DBI::errstr";
-}
-
-sub dropall {
- for my $n (0..($maxtab-1)) {
- my $sql = "drop table if exists t$n";
- $dbh->do($sql) or die "$sql\n$DBI::errstr";
- }
-}
-
-sub createdrop {
- my $n = int(rand($maxtab));
- if (! $tab[$n]) {
- create($n);
- $tab[$n] = 1;
- } else {
- drop($n);
- $tab[$n] = 0;
- }
-}
-
-sub checkschemafiles {
- system("printSchemaFile -ce @schemafiles");
- $? == 0 or die "schemafiles check failed";
-}
-
-sub randomrestart {
- my($k) = @_;
- my $s = int(rand(500));
- if ($s < 2) {
- my $i = $k % scalar(@dbnode);
- my $n = $dbnode[$i];
- my $initialstart = ($s < 1 ? 0 : 1);
- restartnode($n, $initialstart);
- return 1;
- }
- if ($s < 3) {
- restartall();
- return 1;
- }
- return 0;
-}
-
-# deterministic
-srand(1);
-
-warn "drop any old tables\n";
-dropall();
-
-my $loop = 1000000;
-for my $k (0..($loop-1)) {
- warn "$k\n";
- createdrop();
- checkschemafiles();
- if (randomrestart($k)) {
- checkschemafiles();
- }
-}
-
-$dbh->disconnect or die $DBI::errstr;
-
-# vim: set sw=2:
diff --git a/storage/ndb/test/sql/test_range_bounds.pl b/storage/ndb/test/sql/test_range_bounds.pl
deleted file mode 100644
index 964847044de..00000000000
--- a/storage/ndb/test/sql/test_range_bounds.pl
+++ /dev/null
@@ -1,235 +0,0 @@
-# Copyright (C) 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-#
-# test range scan bounds
-# give option --all to test all cases
-# set MYSQL_HOME to installation top
-#
-
-use strict;
-use integer;
-use Getopt::Long;
-use DBI;
-
-my $opt_all = 0;
-my $opt_cnt = 5;
-my $opt_verbose = 0;
-GetOptions("all" => \$opt_all, "cnt=i" => \$opt_cnt, "verbose" => \$opt_verbose)
- or die "options are: --all --cnt=N --verbose";
-
-my $mysql_home = $ENV{MYSQL_HOME};
-defined($mysql_home) or die "no MYSQL_HOME";
-my $dsn = "dbi:mysql:database=test;host=localhost;mysql_read_default_file=$mysql_home/var/my.cnf";
-my $opts = { RaiseError => 0, PrintError => 0, AutoCommit => 1, };
-
-my $dbh;
-my $sth;
-my $sql;
-
-$dbh = DBI->connect($dsn, "root", undef, $opts) or die $DBI::errstr;
-
-my $table = 't';
-
-$sql = "drop table if exists $table";
-$dbh->do($sql) or die $DBI::errstr;
-
-sub cut ($$$) {
- my($op, $key, $val) = @_;
- $op = '==' if $op eq '=';
- my(@w) = @$val;
- eval "\@w = grep(\$_ $op $key, \@w)";
- $@ and die $@;
- return [ @w ];
-}
-
-sub mkdummy ($) {
- my ($val) = @_;
- return {
- 'dummy' => 1,
- 'exp' => '9 = 9',
- 'res' => $val,
- };
-}
-
-sub mkone ($$$$) {
- my($col, $op, $key, $val) = @_;
- my $res = cut($op, $key, $val);
- return {
- 'exp' => "$col $op $key",
- 'res' => $res,
- };
-}
-
-sub mktwo ($$$$$$) {
- my($col, $op1, $key1, $op2, $key2, $val) = @_;
- my $res = cut($op2, $key2, cut($op1, $key1, $val));
- return {
- 'exp' => "$col $op1 $key1 and $col $op2 $key2",
- 'res' => $res,
- };
-}
-
-sub mkall ($$$$) {
- my($col, $key1, $key2, $val) = @_;
- my @a = ();
- my $p = mkdummy($val);
- push(@a, $p) if $opt_all;
- my @ops = qw(< <= = >= >);
- for my $op (@ops) {
- my $p = mkone($col, $op, $key1, $val);
- push(@a, $p) if $opt_all || @{$p->{res}} != 0;
- }
- my @ops1 = $opt_all ? @ops : qw(= >= >);
- my @ops2 = $opt_all ? @ops : qw(<= <);
- for my $op1 (@ops1) {
- for my $op2 (@ops2) {
- my $p = mktwo($col, $op1, $key1, $op2, $key2, $val);
- push(@a, $p) if $opt_all || @{$p->{res}} != 0;
- }
- }
- warn scalar(@a)." cases\n" if $opt_verbose;
- return \@a;
-}
-
-my $casecnt = 0;
-
-sub verify ($$$) {
- my($sql, $ord, $res) = @_;
- warn "$sql\n" if $opt_verbose;
- $sth = $dbh->prepare($sql) or die "prepare: $sql: $DBI::errstr";
- $sth->execute() or die "execute: $sql: $DBI::errstr";
- #
- # BUG: execute can return success on error so check again
- #
- $sth->err and die "execute: $sql: $DBI::errstr";
- my @out = ();
- for my $b (@{$res->[0]}) {
- for my $c (@{$res->[1]}) {
- for my $d (@{$res->[2]}) {
- push(@out, [$b, $c, $d]);
- }
- }
- }
- if ($ord) {
- @out = sort {
- $ord * ($a->[0] - $b->[0]) ||
- $ord * ($a->[1] - $b->[1]) ||
- $ord * ($a->[2] - $b->[2]) ||
- 0
- } @out;
- }
- my $cnt = scalar @out;
- my $n = 0;
- while (1) {
- my $row = $sth->fetchrow_arrayref;
- $row || last;
- @$row == 3 or die "bad row: $sql: @$row";
- for my $v (@$row) {
- $v =~ s/^\s+|\s+$//g;
- $v =~ /^\d+$/ or die "bad value: $sql: $v";
- }
- if ($ord) {
- my $out = $out[$n];
- $row->[0] == $out->[0] &&
- $row->[1] == $out->[1] &&
- $row->[2] == $out->[2] or
- die "$sql: row $n: got row @$row != @$out";
- }
- $n++;
- }
- $sth->err and die "fetch: $sql: $DBI::errstr";
- $n == $cnt or die "verify: $sql: got row count $n != $cnt";
- $casecnt++;
-}
-
-for my $nn ("bcd", "") {
- my %nn;
- for my $x (qw(b c d)) {
- $nn{$x} = $nn =~ /$x/ ? "not null" : "null";
- }
- warn "create table\n";
- $sql = <<EOF;
-create table $table (
- a int primary key,
- b int $nn{b},
- c int $nn{c},
- d int $nn{d},
- index (b, c, d)
-) engine=ndb
-EOF
- $dbh->do($sql) or die $DBI::errstr;
- warn "insert\n";
- $sql = "insert into $table values(?, ?, ?, ?)";
- $sth = $dbh->prepare($sql) or die $DBI::errstr;
- my @val = (0..($opt_cnt-1));
- my $v0 = 0;
- for my $v1 (@val) {
- for my $v2 (@val) {
- for my $v3 (@val) {
- $sth->bind_param(1, $v0) or die $DBI::errstr;
- $sth->bind_param(2, $v1) or die $DBI::errstr;
- $sth->bind_param(3, $v2) or die $DBI::errstr;
- $sth->bind_param(4, $v3) or die $DBI::errstr;
- $sth->execute or die $DBI::errstr;
- $v0++;
- }
- }
- }
- warn "generate cases\n";
- my $key1 = 1;
- my $key2 = 3;
- my $a1 = mkall('b', $key1, $key2, \@val);
- my $a2 = mkall('c', $key1, $key2, \@val);
- my $a3 = mkall('d', $key1, $key2, \@val);
- warn "select\n";
- for my $ord (0, +1, -1) {
- my $orderby =
- $ord == 0 ? "" :
- $ord == +1 ? " order by b, c, d" :
- $ord == -1 ? " order by b desc, c desc, d desc" : die "not here";
- for my $p1 (@$a1) {
- my $res = [ $p1->{res}, \@val, \@val ];
- $sql = "select b, c, d from $table" .
- " where $p1->{exp}" .
- $orderby;
- verify($sql, $ord, $res);
- for my $p2 (@$a2) {
- my $res = [ $p1->{res}, $p2->{res}, \@val ];
- $sql = "select b, c, d from $table" .
- " where $p1->{exp} and $p2->{exp}" .
- $orderby;
- verify($sql, $ord, $res);
- for my $p3 (@$a3) {
- my $res = [ $p1->{res}, $p2->{res}, $p3->{res} ];
- $sql = "select b, c, d from $table" .
- " where $p1->{exp} and $p2->{exp} and $p3->{exp}" .
- $orderby;
- verify($sql, $ord, $res);
- }
- }
- }
- }
- warn "drop table\n";
- $sql = "drop table $table";
- $dbh->do($sql) or die $DBI::errstr;
-}
-
-warn "verified $casecnt cases\n";
-warn "done\n";
-
-# vim: set sw=2:
diff --git a/storage/ndb/test/tools/log_listner.cpp b/storage/ndb/test/tools/log_listner.cpp
index c5125ef7414..a0a03f1319a 100644
--- a/storage/ndb/test/tools/log_listner.cpp
+++ b/storage/ndb/test/tools/log_listner.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (c) 2007 MySQL AB
+ Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
#include <mgmapi.h>
#include <ndb_global.h>
#include <ndb_opts.h>
diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc
index 7305f80f0fb..1aec6426c8a 100644
--- a/storage/pbxt/src/ha_pbxt.cc
+++ b/storage/pbxt/src/ha_pbxt.cc
@@ -6120,62 +6120,6 @@ static struct st_mysql_sys_var* pbxt_system_variables[] = {
};
#endif
-#ifdef DRIZZLED
-drizzle_declare_plugin(pbxt)
-#else
-mysql_declare_plugin(pbxt)
-#endif
-{
-#ifndef DRIZZLED
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &pbxt_storage_engine,
-#endif
- "PBXT",
-#ifdef DRIZZLED
- "1.0",
-#endif
- "Paul McCullagh, PrimeBase Technologies GmbH",
- "High performance, multi-versioning transactional engine",
- PLUGIN_LICENSE_GPL,
- pbxt_init, /* Plugin Init */
- pbxt_end, /* Plugin Deinit */
-#ifndef DRIZZLED
- 0x0001 /* 0.1 */,
-#endif
- NULL, /* status variables */
-#if MYSQL_VERSION_ID >= 50118
- pbxt_system_variables, /* system variables */
-#else
- NULL,
-#endif
- NULL /* config options */
-},
-{
-#ifndef DRIZZLED
- MYSQL_INFORMATION_SCHEMA_PLUGIN,
- &pbxt_statitics,
-#endif
- "PBXT_STATISTICS",
-#ifdef DRIZZLED
- "1.0",
-#endif
- "Paul McCullagh, PrimeBase Technologies GmbH",
- "PBXT internal system statitics",
- PLUGIN_LICENSE_GPL,
- pbxt_init_statistics, /* plugin init */
- pbxt_exit_statistics, /* plugin deinit */
-#ifndef DRIZZLED
- 0x0005,
-#endif
- NULL, /* status variables */
- NULL, /* system variables */
- NULL /* config options */
-}
-#ifdef DRIZZLED
-drizzle_declare_plugin_end;
-#else
-mysql_declare_plugin_end;
-#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 50200
maria_declare_plugin(pbxt)
{ /* PBXT */
MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -6208,8 +6152,6 @@ maria_declare_plugin(pbxt)
MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
}
maria_declare_plugin_end;
-#endif
-#endif
#if defined(XT_WIN) && defined(XT_COREDUMP)
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 2113a28d4f8..d7771de7fb8 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -166,7 +166,8 @@ mysql_declare_plugin(perfschema)
0x0001 /* 0.1 */,
pfs_status_vars, /* status variables */
NULL, /* system variables */
- NULL /* config options */
+ NULL, /* config options */
+ 0, /* flags */
}
mysql_declare_plugin_end;
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 139064ab212..27350c59604 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1574,6 +1574,9 @@ static void unlock_rwlock_v1(PSI_rwlock *rwlock)
aggregate_single_stat_chain(&pfs_rwlock->m_read_lock_stat, locked_time);
}
}
+#else
+ (void) last_reader;
+ (void) last_writer;
#endif
}
diff --git a/storage/perfschema/pfs_atomic.cc b/storage/perfschema/pfs_atomic.cc
index 06090accdc6..3bd744c8ea7 100644
--- a/storage/perfschema/pfs_atomic.cc
+++ b/storage/perfschema/pfs_atomic.cc
@@ -1,4 +1,6 @@
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2009, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h
index b0070f7b8d0..4daebfbbae4 100644
--- a/storage/perfschema/pfs_atomic.h
+++ b/storage/perfschema/pfs_atomic.h
@@ -1,4 +1,6 @@
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2009, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h
index 96b33636ff9..dc990664a8f 100644
--- a/storage/perfschema/pfs_column_types.h
+++ b/storage/perfschema/pfs_column_types.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index ed2df685a2d..f46a2862b6f 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc
index f30a9f8e865..302548c97c2 100644
--- a/storage/perfschema/pfs_timer.cc
+++ b/storage/perfschema/pfs_timer.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h
index cd2a8df9be3..6736a977ab9 100644
--- a/storage/perfschema/pfs_timer.h
+++ b/storage/perfschema/pfs_timer.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index c983a967c4e..01d9bc5678f 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index 402ed9d80de..9b2b5cba5a8 100644
--- a/storage/perfschema/table_ews_global_by_event_name.h
+++ b/storage/perfschema/table_ews_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index 4d007645db2..3ef85f6914b 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index b9df2dd3e0b..42b1a6122c8 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index a81e6fefaaf..c147de63a21 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index 7858fa4cc3e..a9bb1c3f4f2 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt
index 8afd0b4dca7..6d262854330 100644
--- a/storage/perfschema/unittest/conf.txt
+++ b/storage/perfschema/unittest/conf.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc
index 46e02306aca..24e840f1e19 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc
index a00afe8b36a..38436f02508 100644
--- a/storage/perfschema/unittest/pfs_instr-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc
index b13135aa615..c781b030202 100644
--- a/storage/perfschema/unittest/pfs_instr-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
index 95dccc420d7..042c6e8e78b 100644
--- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc
index ac34f082fe8..605b3c0bf49 100644
--- a/storage/perfschema/unittest/pfs_instr_class-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc
index 69b554c7b31..9a1c743f642 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h
index 300d3cb6fa0..2b581f22645 100644
--- a/storage/perfschema/unittest/stub_pfs_global.h
+++ b/storage/perfschema/unittest/stub_pfs_global.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h
index caad24e5257..adfa3a62d8c 100644
--- a/storage/perfschema/unittest/stub_print_error.h
+++ b/storage/perfschema/unittest/stub_print_error.h
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008 MySQL AB, 2010 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index e90c2f3e6fb..ce94b675af4 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -3077,25 +3077,6 @@ struct st_mysql_show_var sphinx_status_vars[] =
{0, 0, (enum_mysql_show_type)0}
};
-
-mysql_declare_plugin(sphinx)
-{
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &sphinx_storage_engine,
- sphinx_hton_name,
- "Sphinx developers",
- sphinx_hton_comment,
- PLUGIN_LICENSE_GPL,
- sphinx_init_func, // Plugin Init
- sphinx_done_func, // Plugin Deinit
- 0x0001, // 0.1
- sphinx_status_vars,
- NULL,
- NULL
-}
-mysql_declare_plugin_end;
-
-#ifdef maria_declare_plugin
maria_declare_plugin(sphinx)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -3113,7 +3094,6 @@ maria_declare_plugin(sphinx)
MariaDB_PLUGIN_MATURITY_EXPERIMENTAL
}
maria_declare_plugin_end;
-#endif
#endif // >50100
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 0964f4925f3..7cf212d28ae 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -8602,6 +8602,8 @@ ha_innobase::info_low(
if (flag & HA_STATUS_VARIABLE) {
+ ulint page_size;
+
dict_table_stats_lock(ib_table, RW_S_LATCH);
n_rows = ib_table->stat_n_rows;
@@ -8644,14 +8646,19 @@ ha_innobase::info_low(
prebuilt->autoinc_last_value = 0;
}
+ page_size = dict_table_zip_size(ib_table);
+ if (page_size == 0) {
+ page_size = UNIV_PAGE_SIZE;
+ }
+
stats.records = (ha_rows)n_rows;
stats.deleted = 0;
- stats.data_file_length = ((ulonglong)
- ib_table->stat_clustered_index_size)
- * UNIV_PAGE_SIZE;
- stats.index_file_length = ((ulonglong)
- ib_table->stat_sum_of_other_index_sizes)
- * UNIV_PAGE_SIZE;
+ stats.data_file_length
+ = ((ulonglong) ib_table->stat_clustered_index_size)
+ * page_size;
+ stats.index_file_length =
+ ((ulonglong) ib_table->stat_sum_of_other_index_sizes)
+ * page_size;
dict_table_stats_unlock(ib_table, RW_S_LATCH);
@@ -12383,44 +12390,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
NULL
};
-mysql_declare_plugin(xtradb)
-{
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &innobase_storage_engine,
- innobase_hton_name,
- plugin_author,
- "Percona-XtraDB, Supports transactions, row-level locking, and foreign keys",
- PLUGIN_LICENSE_GPL,
- innobase_init, /* Plugin Init */
- NULL, /* Plugin Deinit */
- INNODB_VERSION_SHORT,
- innodb_status_variables_export,/* status variables */
- innobase_system_variables, /* system variables */
- NULL /* reserved */
-},
-i_s_innodb_rseg,
-i_s_innodb_trx,
-i_s_innodb_locks,
-i_s_innodb_lock_waits,
-i_s_innodb_cmp,
-i_s_innodb_cmp_reset,
-i_s_innodb_cmpmem,
-i_s_innodb_cmpmem_reset,
-i_s_innodb_sys_tables,
-i_s_innodb_sys_tablestats,
-i_s_innodb_sys_indexes,
-i_s_innodb_sys_columns,
-i_s_innodb_sys_fields,
-i_s_innodb_sys_foreign,
-i_s_innodb_sys_foreign_cols,
-i_s_innodb_sys_stats,
-i_s_innodb_table_stats,
-i_s_innodb_index_stats,
-i_s_innodb_buffer_pool_pages,
-i_s_innodb_buffer_pool_pages_index,
-i_s_innodb_buffer_pool_pages_blob,
-i_s_innodb_admin_command
-mysql_declare_plugin_end;
maria_declare_plugin(xtradb)
{ /* InnoDB */
MYSQL_STORAGE_ENGINE_PLUGIN,
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index 4f19debdd0d..70de838cf18 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -599,54 +599,6 @@ static struct st_mysql_information_schema i_s_info =
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION
};
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_trx =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_TRX"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB transactions"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_trx_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
@@ -866,54 +818,6 @@ innodb_locks_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_locks =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_LOCKS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB conflicting locks"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_locks_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
@@ -1049,54 +953,6 @@ innodb_lock_waits_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_lock_waits_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/*******************************************************************//**
Common function to fill any of the dynamic tables:
@@ -1382,104 +1238,7 @@ i_s_cmp_reset_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_CMP"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmp_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_CMP_RESET"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
- " reset cumulated counts"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmp_reset_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
@@ -1675,104 +1434,7 @@ i_s_cmpmem_reset_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_CMPMEM"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmpmem_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
- " reset cumulated counts"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_cmpmem_reset_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/*******************************************************************//**
@@ -1990,54 +1652,6 @@ innodb_sys_tables_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_tables =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_TABLES"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_TABLES"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_tables_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLESTATS */
static ST_FIELD_INFO innodb_sys_tablestats_fields_info[] =
@@ -2287,54 +1901,6 @@ innodb_sys_tablestats_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_tablestats =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_TABLESTATS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_TABLESTATS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_tablestats_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_INDEXES */
static ST_FIELD_INFO innodb_sysindex_fields_info[] =
@@ -2533,54 +2099,6 @@ innodb_sys_indexes_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_indexes =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_INDEXES"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_INDEXES"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_indexes_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_COLUMNS */
static ST_FIELD_INFO innodb_sys_columns_fields_info[] =
@@ -2769,54 +2287,6 @@ innodb_sys_columns_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_columns =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_COLUMNS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_COLUMNS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_columns_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_fields */
static ST_FIELD_INFO innodb_sys_fields_fields_info[] =
{
@@ -2976,54 +2446,6 @@ innodb_sys_fields_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_fields =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FIELDS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FIELDS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_fields_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign */
static ST_FIELD_INFO innodb_sys_foreign_fields_info[] =
@@ -3197,54 +2619,6 @@ innodb_sys_foreign_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_foreign =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FOREIGN"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FOREIGN"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_foreign_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign_cols */
static ST_FIELD_INFO innodb_sys_foreign_cols_fields_info[] =
{
@@ -3411,54 +2785,6 @@ innodb_sys_foreign_cols_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_foreign_cols =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FOREIGN_COLS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FOREIGN_COLS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_foreign_cols_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_stats */
static ST_FIELD_INFO innodb_sys_stats_fields_info[] =
@@ -3626,54 +2952,6 @@ innodb_sys_stats_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_stats =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_STATS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "XtraDB SYS_STATS table"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_stats_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/***********************************************************************
*/
@@ -3789,54 +3067,6 @@ i_s_innodb_rseg_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_rseg =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_RSEG"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB rollback segment information"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_innodb_rseg_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, 0x0100 /* 1.0 */),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
/***********************************************************************
*/
@@ -4150,37 +3380,7 @@ i_s_innodb_index_stats_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_table_stats =
-{
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
- STRUCT_FLD(info, &i_s_info),
- STRUCT_FLD(name, "INNODB_TABLE_STATS"),
- STRUCT_FLD(author, "Percona"),
- STRUCT_FLD(descr, "InnoDB table statistics in memory"),
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
- STRUCT_FLD(init, i_s_innodb_table_stats_init),
- STRUCT_FLD(deinit, i_s_common_deinit),
- STRUCT_FLD(version, 0x0100 /* 1.0 */),
- STRUCT_FLD(status_vars, NULL),
- STRUCT_FLD(system_vars, NULL),
- STRUCT_FLD(__reserved1, NULL)
-};
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_index_stats =
-{
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
- STRUCT_FLD(info, &i_s_info),
- STRUCT_FLD(name, "INNODB_INDEX_STATS"),
- STRUCT_FLD(author, "Percona"),
- STRUCT_FLD(descr, "InnoDB index statistics in memory"),
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
- STRUCT_FLD(init, i_s_innodb_index_stats_init),
- STRUCT_FLD(deinit, i_s_common_deinit),
- STRUCT_FLD(version, 0x0100 /* 1.0 */),
- STRUCT_FLD(status_vars, NULL),
- STRUCT_FLD(system_vars, NULL),
- STRUCT_FLD(__reserved1, NULL)
-};
/***********************************************************************
*/
@@ -4332,21 +3532,6 @@ i_s_innodb_admin_command_init(
DBUG_RETURN(0);
}
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_admin_command =
-{
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
- STRUCT_FLD(info, &i_s_info),
- STRUCT_FLD(name, "XTRADB_ADMIN_COMMAND"),
- STRUCT_FLD(author, "Percona"),
- STRUCT_FLD(descr, "XtraDB specific command acceptor"),
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
- STRUCT_FLD(init, i_s_innodb_admin_command_init),
- STRUCT_FLD(deinit, i_s_common_deinit),
- STRUCT_FLD(version, 0x0100 /* 1.0 */),
- STRUCT_FLD(status_vars, NULL),
- STRUCT_FLD(system_vars, NULL),
- STRUCT_FLD(__reserved1, NULL)
-};
/***********************************************************************
*/
@@ -4897,154 +4082,6 @@ i_s_innodb_buffer_pool_pages_blob_init(
DBUG_RETURN(0);
}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB buffer pool pages"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, 0x0100 /* 1.0 */),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_INDEX"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB buffer pool index pages"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_index_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, 0x0100 /* 1.0 */),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_BLOB"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, "Percona"),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB buffer pool blob pages"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_blob_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, 0x0100 /* 1.0 */),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
/* MariaDB structures of I_S plugins above */
UNIV_INTERN struct st_maria_plugin i_s_innodb_trx_maria =
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index f8b560422d7..aebeafcda98 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000-2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
#include <m_ctype.h>
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index e636c6e0263..1b8e2fb5f3a 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
* This file is basicly usa7 character sets with some extra functions
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 037d9da7926..68a13dbedbd 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is for cp932 charaset (Windows Japanese),
and created based on ctype-sjis.c file */
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 21af116edf6..08c8412e8ae 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* File strings/ctype-czech.c for MySQL.
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 9321a0ac2c8..77296f34f6a 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
* This file is for Korean EUC charset, and created by powerm90@tinc.co.kr.
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index 5d09c1c9d8d..b2af2cb5608 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -1,7 +1,6 @@
-/* Copyright tommy@valley.ne.jp.
- Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; version 2
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index e0499c6f2e3..b52cc603e4d 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -6,8 +6,7 @@
./conf_to_src ../sql/share/charsets/ > FILE
*/
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index af0526790c5..af6c6f9f8c2 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is for Chinese EUC character sets (GB2312), and created by Miles Tsai (net-bull@126.com).
*/
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index f021c268d0a..a33d0d82f56 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is for Chinese character sets GBK, created by Wei He
(hewei@mail.ied.ac.cn)
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index 63858b56c9e..f5456c1a943 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2003-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
#include <m_ctype.h>
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index d220a80d120..33e0c58cbbf 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
#include <m_ctype.h>
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 4f2a42f5905..eb8c44805da 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
#include <m_ctype.h>
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index b782c892fd9..042ceab4f35 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This file is for Shift JIS charset, and created by tommy@valley.ne.jp.
*/
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 9bf7a73a6d1..f6fe4c0f914 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -1,4 +1,6 @@
-/*
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2009-2011, Monty Program Ab
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
@@ -10,11 +12,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009-2011, Monty Program Ab
Copyright (C) 2003 by Sathit Jittanupat
<jsat66@hotmail.com,jsat66@yahoo.com>
* solving bug crash with long text field string
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 683fb8f6654..b5f151c4d10 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2004, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This library is free software; you can redistribute it and/or
@@ -13,8 +13,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301, USA */
/*
UCA (Unicode Collation Algorithm) support.
@@ -46,6 +46,7 @@
#define MY_UCA_NCHARS 256
#define MY_UCA_CMASK 255
#define MY_UCA_PSHIFT 8
+#define MAX_UCA_CHAR_WITH_EXPLICIT_WEIGHT 0xFFFF
static const uint16 page000data[]= { /* 0000 (4 weights per char) */
0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
@@ -7077,7 +7078,7 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner)
return -1;
scanner->sbeg+= mb_len;
- if (wc > 0xFFFF)
+ if (wc > MAX_UCA_CHAR_WITH_EXPLICIT_WEIGHT)
{
/* Return 0xFFFD as weight for all characters outside BMP */
scanner->wbeg= nochar;
@@ -7142,30 +7143,6 @@ static my_uca_scanner_handler my_any_uca_scanner_handler=
};
-/**
- Helper function:
- Find address of weights of the given character.
-
- @weights UCA weight array
- @lengths UCA length array
- @ch character Unicode code point
-
- @return Weight array
- @retval pointer to weight array for the given character,
- or NULL if this page does not have implicit weights.
-*/
-
-static inline const uint16 *
-my_char_weight_addr(CHARSET_INFO *cs, uint wc)
-{
- uint page= (wc >> 8);
- uint ofst= wc & 0xFF;
- return (cs->sort_order_big[page] ?
- cs->sort_order_big[page] + ofst * cs->sort_order[page] :
- 0);
-}
-
-
/*
Compares two strings according to the collation
@@ -7439,6 +7416,33 @@ static size_t my_strnxfrm_uca(CHARSET_INFO *cs,
+/**
+ Helper function:
+ Find address of weights of the given character.
+
+ @param weights UCA weight array
+ @param lengths UCA length array
+ @param ch character Unicode code point
+
+ @return Weight array
+ @retval pointer to weight array for the given character,
+ or NULL if this page does not have implicit weights.
+*/
+
+static inline const uint16 *
+my_char_weight_addr(CHARSET_INFO *cs, uint wc)
+{
+ uint page, ofst;
+ const uchar *ucal= cs->sort_order;
+ const uint16 * const *ucaw= cs->sort_order_big;
+
+ return wc > MAX_UCA_CHAR_WITH_EXPLICIT_WEIGHT ? NULL :
+ (ucaw[page= (wc >> 8)] ?
+ ucaw[page] + (ofst= (wc & 0xFF)) * ucal[page] :
+ NULL);
+}
+
+
/*
This function compares if two characters are the same.
The sign +1 or -1 does not matter. The only
@@ -7449,17 +7453,20 @@ static size_t my_strnxfrm_uca(CHARSET_INFO *cs,
static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
{
- size_t page1= wc1 >> MY_UCA_PSHIFT;
- size_t page2= wc2 >> MY_UCA_PSHIFT;
- const uchar *ucal= cs->sort_order;
- const uint16 *const *ucaw= cs->sort_order_big;
- size_t length1= ucal[page1];
- size_t length2= ucal[page2];
- const uint16 *weight1= ucaw[page1] + (wc1 & MY_UCA_CMASK) * ucal[page1];
- const uint16 *weight2= ucaw[page2] + (wc2 & MY_UCA_CMASK) * ucal[page2];
+ size_t length1, length2;
+ const uint16 *weight1= my_char_weight_addr(cs, wc1);
+ const uint16 *weight2= my_char_weight_addr(cs, wc2);
if (!weight1 || !weight2)
return wc1 != wc2;
+
+ /* Quickly compare first weights */
+ if (weight1[0] != weight2[0])
+ return 1;
+
+ /* Thoroughly compare all weights */
+ length1= cs->sort_order[wc1 >> MY_UCA_PSHIFT];
+ length2= cs->sort_order[wc2 >> MY_UCA_PSHIFT];
if (length1 > length2)
return memcmp((const void*)weight1, (const void*)weight2, length2*2) ?
@@ -8044,6 +8051,11 @@ static my_bool create_tailoring(struct charset_info_st *cs,
*/
for (i=0; i < rc; i++)
{
+ /* check if the shift or the reset characters are out of range */
+ if (rule[i].curr[0] > MAX_UCA_CHAR_WITH_EXPLICIT_WEIGHT ||
+ rule[i].base > MAX_UCA_CHAR_WITH_EXPLICIT_WEIGHT)
+ return 1;
+
if (!rule[i].curr[1]) /* If not a contraction */
{
uint pageb= (rule[i].base >> 8) & 0xFF;
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 4f676c8effe..b22ca43a062 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1,6 +1,6 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; version 2
@@ -13,8 +13,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301, USA */
/* UCS2 support. Written by Alexander Barkov <bar@mysql.com> */
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index ecb0992c70d..32d65a07f23 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -1,5 +1,5 @@
/* Copyright tommy@valley.ne.jp.
- Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This library is free software; you can redistribute it and/or
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 74dcbcf4fc2..daca63437ca 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This library is free software; you can redistribute it and/or
@@ -13,8 +13,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301, USA */
/* UTF8 according RFC 2279 */
/* Written by Alexander Barkov <bar@udm.net> */
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index 19896de5e66..a22fe7b696f 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2001 Jan Pazdziora.
- Copyright (c) 2003, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2002, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Shared, independent copyright: (C) 2001 Jan Pazdziora.
diff --git a/strings/ctype.c b/strings/ctype.c
index 429f4a0b366..296960b55b5 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000-2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
#include <m_ctype.h>
diff --git a/strings/decimal.c b/strings/decimal.c
index dc8a8a70809..8ac3d61612d 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -1403,11 +1403,18 @@ int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale)
buf++;
}
my_afree(d_copy);
+
+ /*
+ No digits? We have read the number zero, of unspecified precision.
+ Make it a proper zero, with non-zero precision.
+ */
+ if (to->intg == 0 && to->frac == 0)
+ decimal_make_zero(to);
return error;
err:
my_afree(d_copy);
- decimal_make_zero(((decimal_t*) to));
+ decimal_make_zero(to);
return(E_DEC_BAD_NUM);
}
@@ -2183,7 +2190,6 @@ static int do_div_mod(const decimal_t *from1, const decimal_t *from2,
}
buf0=to->buf;
stop0=buf0+intg0+frac0;
- DBUG_ASSERT(stop0 <= &to->buf[to->len]);
if (likely(div_mod))
while (dintg++ < 0 && buf0 < &to->buf[to->len])
{
@@ -2278,7 +2284,10 @@ static int do_div_mod(const decimal_t *from1, const decimal_t *from2,
}
}
if (likely(div_mod))
+ {
+ DBUG_ASSERT(buf0 < to->buf + to->len);
*buf0=(dec1)guess;
+ }
dcarry= *start1;
start1++;
}
diff --git a/strings/do_ctype.c b/strings/do_ctype.c
index c0e4aaf9be6..addb3a3d7f6 100644
--- a/strings/do_ctype.c
+++ b/strings/do_ctype.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Prints case-convert and sort-convert tabell on stdout. This is used to
make _ctype.c easyer */
diff --git a/strings/dtoa.c b/strings/dtoa.c
index 3aeeed9e148..e6339bab1d9 100644
--- a/strings/dtoa.c
+++ b/strings/dtoa.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/****************************************************************
@@ -45,7 +45,7 @@
see if it is possible to get rid of malloc().
this constant is sufficient to avoid malloc() on all inputs I have tried.
*/
-#define DTOA_BUFF_SIZE (420 * sizeof(void *))
+#define DTOA_BUFF_SIZE (460 * sizeof(void *))
/* Magic value returned by dtoa() to indicate overflow */
#define DTOA_OVERFLOW 9999
@@ -658,6 +658,7 @@ typedef struct Stack_alloc
static Bigint *Balloc(int k, Stack_alloc *alloc)
{
Bigint *rv;
+ DBUG_ASSERT(k <= Kmax);
if (k <= Kmax && alloc->freelist[k])
{
rv= alloc->freelist[k];
@@ -1004,9 +1005,10 @@ static Bigint p5_a[]=
static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc)
{
- Bigint *b1, *p5, *p51;
+ Bigint *b1, *p5, *p51=NULL;
int i;
static int p05[3]= { 5, 25, 125 };
+ my_bool overflow= FALSE;
if ((i= k & 3))
b= multadd(b, p05[i-1], 0, alloc);
@@ -1025,17 +1027,22 @@ static Bigint *pow5mult(Bigint *b, int k, Stack_alloc *alloc)
if (!(k>>= 1))
break;
/* Calculate next power of 5 */
- if (p5 < p5_a + P5A_MAX)
- ++p5;
- else if (p5 == p5_a + P5A_MAX)
- p5= mult(p5, p5, alloc);
- else
+ if (overflow)
{
p51= mult(p5, p5, alloc);
Bfree(p5, alloc);
p5= p51;
}
+ else if (p5 < p5_a + P5A_MAX)
+ ++p5;
+ else if (p5 == p5_a + P5A_MAX)
+ {
+ p5= mult(p5, p5, alloc);
+ overflow= TRUE;
+ }
}
+ if (p51)
+ Bfree(p51, alloc);
return b;
}
diff --git a/strings/dump_map.c b/strings/dump_map.c
index 61e6cbb6e02..83d35f259a1 100644
--- a/strings/dump_map.c
+++ b/strings/dump_map.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2003, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2003, 2004, 2006 MySQL AB
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/my_strchr.c b/strings/my_strchr.c
index baf832c9a0a..9bb1f0954ed 100644
--- a/strings/my_strchr.c
+++ b/strings/my_strchr.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
#include <m_ctype.h>
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 72fd35e4e0f..dde6b0255ed 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
#include <m_ctype.h>
diff --git a/strings/str_alloc.c b/strings/str_alloc.c
index 5233a804153..3e218ff1fbd 100644
--- a/strings/str_alloc.c
+++ b/strings/str_alloc.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2005, 2006 MySQL AB
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "strings_def.h"
diff --git a/strings/strmake.c b/strings/strmake.c
index 5c26538c9bd..b6f37dd3d88 100644
--- a/strings/strmake.c
+++ b/strings/strmake.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2001, 2003, 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -12,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* File : strmake.c
Author : Michael Widenius
diff --git a/strings/uca-dump.c b/strings/uca-dump.c
index d281783aa2b..ab3437d17df 100644
--- a/strings/uca-dump.c
+++ b/strings/uca-dump.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2004, 2006 MySQL AB
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/uctypedump.c b/strings/uctypedump.c
index 117db2ba30a..ed3c64969d5 100644
--- a/strings/uctypedump.c
+++ b/strings/uctypedump.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2006, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2006 MySQL AB
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/strings/utr11-dump.c b/strings/utr11-dump.c
index 41cc387b2e0..8bd5e9ee58b 100644
--- a/strings/utr11-dump.c
+++ b/strings/utr11-dump.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2004, 2006 MySQL AB
+ Use is subject to license terms.
Copyright (c) 2009-2011, Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/strings/xml.c b/strings/xml.c
index 7834f971269..54ff7a26c16 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates.
Copyright (c) 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
diff --git a/support-files/config.huge.ini.sh b/support-files/config.huge.ini.sh
index 938dd3209b8..f98074828a7 100644
--- a/support-files/config.huge.ini.sh
+++ b/support-files/config.huge.ini.sh
@@ -1,3 +1,19 @@
+# Copyright (c) 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
######################################################
# MySQL NDB Cluster Huge Sample Configuration File #
######################################################
diff --git a/support-files/config.medium.ini.sh b/support-files/config.medium.ini.sh
index e35dd35e455..1de7f64912e 100644
--- a/support-files/config.medium.ini.sh
+++ b/support-files/config.medium.ini.sh
@@ -1,3 +1,18 @@
+# Copyright (c) 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# MySQL NDB Cluster Medium Sample Configuration File
#
diff --git a/support-files/config.small.ini.sh b/support-files/config.small.ini.sh
index 129e2521e17..0af60e5dc91 100644
--- a/support-files/config.small.ini.sh
+++ b/support-files/config.small.ini.sh
@@ -1,3 +1,18 @@
+# Copyright (c) 2008 MySQL AB
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# MySQL NDB Cluster Small Sample Configuration File
#
diff --git a/support-files/dtrace/locktime.d b/support-files/dtrace/locktime.d
index c9b509ca61e..610da8fbffb 100644
--- a/support-files/dtrace/locktime.d
+++ b/support-files/dtrace/locktime.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Shows the time that an individual lock is applied to a database and table
# Shows the time to achieve the lock, and the time the table was locked
diff --git a/support-files/dtrace/query-execandqc.d b/support-files/dtrace/query-execandqc.d
index 64599223f55..27dd5983fb0 100644
--- a/support-files/dtrace/query-execandqc.d
+++ b/support-files/dtrace/query-execandqc.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Show query execution times, indicating whether the query-cache was used
#pragma D option quiet
diff --git a/support-files/dtrace/query-filesort-time.d b/support-files/dtrace/query-filesort-time.d
index 425ed3863aa..0705f6ec556 100644
--- a/support-files/dtrace/query-filesort-time.d
+++ b/support-files/dtrace/query-filesort-time.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Show the time taken for a query, including the time taken to
# sort the results using filesort
diff --git a/support-files/dtrace/query-network-time.d b/support-files/dtrace/query-network-time.d
index f0483778fb0..1b425284873 100644
--- a/support-files/dtrace/query-network-time.d
+++ b/support-files/dtrace/query-network-time.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Show the time taken to execute a query, include the bytes and time taken
# to transfer the information over the network to/from the client
diff --git a/support-files/dtrace/query-parse-time.d b/support-files/dtrace/query-parse-time.d
index 31fe1275e1a..211152afdd2 100644
--- a/support-files/dtrace/query-parse-time.d
+++ b/support-files/dtrace/query-parse-time.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Shows time take to actually parse the query statement
#pragma D option quiet
diff --git a/support-files/dtrace/query-rowops.d b/support-files/dtrace/query-rowops.d
index a16f3df90f4..04748955f6c 100644
--- a/support-files/dtrace/query-rowops.d
+++ b/support-files/dtrace/query-rowops.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Calculates the time (and operations) for accessing data from individual
# rows for each query
diff --git a/support-files/dtrace/query-time.d b/support-files/dtrace/query-time.d
index 9983a73b7e5..98e4b129838 100644
--- a/support-files/dtrace/query-time.d
+++ b/support-files/dtrace/query-time.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Shows basic query execution time, who execute the query, and on what database
#pragma D option quiet
diff --git a/support-files/dtrace/statement-time.d b/support-files/dtrace/statement-time.d
index d00fc10348d..10ef57039ad 100644
--- a/support-files/dtrace/statement-time.d
+++ b/support-files/dtrace/statement-time.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Creates a report on each query executed at the individual statement
# level, showing rows matched, updated, and total query time
diff --git a/support-files/dtrace/statement-type-aggregate.d b/support-files/dtrace/statement-type-aggregate.d
index 32d88cb5143..784ee4aee9b 100644
--- a/support-files/dtrace/statement-type-aggregate.d
+++ b/support-files/dtrace/statement-type-aggregate.d
@@ -1,5 +1,21 @@
#!/usr/sbin/dtrace -s
#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Creates an aggregate report of the time spent perform queries of the four main
# types (select, insert, update, delete)
#
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 7e9e8faae46..fad745676e5 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -127,55 +127,74 @@
%define distro_description Oracle Enterprise Linux 4
%define distro_releasetag oel4
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
- %define distro_requires chkconfig coreutils grep procps shadow-utils
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%if "%oelver" == "5"
%define distro_description Oracle Enterprise Linux 5
%define distro_releasetag oel5
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
- %define distro_requires chkconfig coreutils grep procps shadow-utils
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
%{error:Oracle Enterprise Linux %{oelver} is unsupported}
%endif
%endif
%else
- %if %(test -f /etc/redhat-release && echo 1 || echo 0)
- %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
- %if "%rhelver" == "4"
- %define distro_description Red Hat Enterprise Linux 4
- %define distro_releasetag rhel4
- %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
- %define distro_requires chkconfig coreutils grep procps shadow-utils
+ %if %(test -f /etc/oracle-release && echo 1 || echo 0)
+ %define elver %(rpm -qf --qf '%%{version}\\n' /etc/oracle-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%elver" == "6"
+ %define distro_description Oracle Linux 6
+ %define distro_releasetag el6
+ %define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
- %if "%rhelver" == "5"
- %define distro_description Red Hat Enterprise Linux 5
- %define distro_releasetag rhel5
- %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
- %define distro_requires chkconfig coreutils grep procps shadow-utils
- %else
- %{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
- %endif
+ %{error:Oracle Linux %{elver} is unsupported}
%endif
%else
- %if %(test -f /etc/SuSE-release && echo 1 || echo 0)
- %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release)
- %if "%susever" == "10"
- %define distro_description SUSE Linux Enterprise Server 10
- %define distro_releasetag sles10
- %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel
- %define distro_requires aaa_base coreutils grep procps pwdutils
+ %if %(test -f /etc/redhat-release && echo 1 || echo 0)
+ %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%rhelver" == "4"
+ %define distro_description Red Hat Enterprise Linux 4
+ %define distro_releasetag rhel4
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
- %if "%susever" == "11"
- %define distro_description SUSE Linux Enterprise Server 11
- %define distro_releasetag sles11
- %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel
- %define distro_requires aaa_base coreutils grep procps pwdutils
+ %if "%rhelver" == "5"
+ %define distro_description Red Hat Enterprise Linux 5
+ %define distro_releasetag rhel5
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
%else
- %{error:SuSE %{susever} is unsupported}
+ %if "%rhelver" == "6"
+ %define distro_description Red Hat Enterprise Linux 6
+ %define distro_releasetag rhel6
+ %define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
+ %endif
%endif
%endif
%else
- %{error:Unsupported distribution}
+ %if %(test -f /etc/SuSE-release && echo 1 || echo 0)
+ %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release)
+ %if "%susever" == "10"
+ %define distro_description SUSE Linux Enterprise Server 10
+ %define distro_releasetag sles10
+ %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel
+ %define distro_requires aaa_base coreutils grep procps pwdutils
+ %else
+ %if "%susever" == "11"
+ %define distro_description SUSE Linux Enterprise Server 11
+ %define distro_releasetag sles11
+ %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel
+ %define distro_requires aaa_base coreutils grep procps pwdutils
+ %else
+ %{error:SuSE %{susever} is unsupported}
+ %endif
+ %endif
+ %else
+ %{error:Unsupported distribution}
+ %endif
%endif
%endif
%endif
@@ -225,10 +244,10 @@ Group: Applications/Databases
Version: @MYSQL_RPM_VERSION@
Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
Distribution: %{distro_description}
-License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Use is subject to license terms. Under %{license_type} license as shown in the Description field.
+License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
URL: http://www.mysql.com/
-Packager: MySQL Build Team <build@mysql.com>
+Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
Vendor: %{mysql_vendor}
Provides: msqlormysql MySQL-server mysql
BuildRequires: %{distro_buildreq}
@@ -261,11 +280,13 @@ documentation and the manual for more information.
##############################################################################
%package -n MySQL-server%{product_suffix}
-Summary: MySQL: a very fast and reliable SQL database server
-Group: Applications/Databases
-Requires: %{distro_requires}
-Provides: msqlormysql mysql-server mysql MySQL MySQL-server
-Obsoletes: MySQL mysql mysql-server MySQL-server MySQL-server-community
+Summary: MySQL: a very fast and reliable SQL database server
+Group: Applications/Databases
+Requires: %{distro_requires}
+Provides: msqlormysql mysql MySQL mysql-server MySQL-server
+Obsoletes: mysql MySQL mysql-server MySQL-server
+Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
+Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
%description -n MySQL-server%{product_suffix}
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
@@ -293,10 +314,12 @@ package "MySQL-client%{product_suffix}" as well!
# ----------------------------------------------------------------------------
%package -n MySQL-client%{product_suffix}
-Summary: MySQL - Client
-Group: Applications/Databases
-Obsoletes: mysql-client MySQL-client MySQL-client-community
-Provides: mysql-client MySQL-client
+Summary: MySQL - Client
+Group: Applications/Databases
+Provides: mysql-client MySQL-client
+Obsoletes: mysql-client MySQL-client
+Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
+Obsoletes: MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
%description -n MySQL-client%{product_suffix}
This package contains the standard MySQL clients and administration tools.
@@ -305,12 +328,15 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-test%{product_suffix}
-Requires: MySQL-client%{product_suffix} perl
-Summary: MySQL - Test suite
-Group: Applications/Databases
-Provides: mysql-test
-Obsoletes: mysql-bench mysql-test MySQL-test-community
-AutoReqProv: no
+Summary: MySQL - Test suite
+Group: Applications/Databases
+Requires: MySQL-client perl
+Provides: mysql-test MySQL-test
+Obsoletes: mysql-test MySQL-test
+Obsoletes: mysql-bench MySQL-bench
+Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
+Obsoletes: MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
+AutoReqProv: no
%description -n MySQL-test%{product_suffix}
This package contains the MySQL regression test suite.
@@ -319,10 +345,12 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-devel%{product_suffix}
-Summary: MySQL - Development header files and libraries
-Group: Applications/Databases
-Provides: mysql-devel
-Obsoletes: mysql-devel MySQL-devel-community
+Summary: MySQL - Development header files and libraries
+Group: Applications/Databases
+Provides: mysql-devel MySQL-devel
+Obsoletes: mysql-devel MySQL-devel
+Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
+Obsoletes: MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
%description -n MySQL-devel%{product_suffix}
This package contains the development header files and libraries necessary
@@ -332,10 +360,14 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
# ----------------------------------------------------------------------------
%package -n MySQL-shared%{product_suffix}
-Summary: MySQL - Shared libraries
-Group: Applications/Databases
-Provides: mysql-shared
-Obsoletes: MySQL-shared-community
+Summary: MySQL - Shared libraries
+Group: Applications/Databases
+Provides: mysql-shared MySQL-shared
+Obsoletes: mysql-shared MySQL-shared-standard MySQL-shared-pro
+Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
+Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared
+Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
+Obsoletes: MySQL-shared-advanced MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
%description -n MySQL-shared%{product_suffix}
This package contains the shared libraries (*.so*) which certain languages
@@ -343,10 +375,14 @@ and applications need to dynamically load and use MySQL.
# ----------------------------------------------------------------------------
%package -n MySQL-embedded%{product_suffix}
-Summary: MySQL - embedded library
-Group: Applications/Databases
-Requires: MySQL-devel%{product_suffix}
-Obsoletes: mysql-embedded MySQL-embedded-community
+Summary: MySQL - Embedded library
+Group: Applications/Databases
+Requires: MySQL-devel
+Provides: mysql-embedded MySQL-embedded
+Obsoletes: mysql-embedded MySQL-embedded
+Obsoletes: MySQL-embedded-pro
+Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
+Obsoletes: MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
%description -n MySQL-embedded%{product_suffix}
This package contains the MySQL server as an embedded library.
@@ -421,7 +457,7 @@ mkdir debug
# XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=Debug \
- -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
+ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
-DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
-DMYSQL_SERVER_SUFFIX="%{server_suffix}"
@@ -436,7 +472,7 @@ mkdir release
# XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
+ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
-DCOMPILATION_COMMENT="%{compilation_comment_release}" \
-DMYSQL_SERVER_SUFFIX="%{server_suffix}"
@@ -444,25 +480,6 @@ mkdir release
make ${MAKE_JFLAG} VERBOSE=1
)
-# Use the build root for temporary storage of the shared libraries.
-RBR=$RPM_BUILD_ROOT
-
-# Clean up the BuildRoot first
-[ "$RBR" != "/" ] && [ -d "$RBR" ] && rm -rf "$RBR";
-
-# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). This
-# needs to be during build phase as $CC is not set during install.
-if "$CC" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1
-then
- libgcc=`$CC $CFLAGS --print-libgcc-file`
- if [ -f $libgcc ]
- then
- mkdir -p $RBR%{_libdir}/mysql
- install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a
- echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel
- fi
-fi
-
##############################################################################
%install
@@ -485,6 +502,23 @@ install -d $RBR%{_sbindir}
make DESTDIR=$RBR install
)
+# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). Do
+# this in a sub-shell to ensure we don't pollute the install environment
+# with compiler bits.
+(
+ PATH=${MYSQL_BUILD_PATH:-$PATH}
+ CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
+ CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
+ if "${CC}" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1; then
+ libgcc=`${CC} ${CFLAGS} --print-libgcc-file`
+ if [ -f ${libgcc} ]; then
+ mkdir -p $RBR%{_libdir}/mysql
+ install -m 644 ${libgcc} $RBR%{_libdir}/mysql/libmygcc.a
+ echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel
+ fi
+ fi
+)
+
# FIXME: at some point we should stop doing this and just install everything
# FIXME: directly into %{_libdir}/mysql - perhaps at the same time as renaming
# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax
@@ -516,7 +550,7 @@ install -m 644 "%{malloc_lib_source}" \
# Remove man pages we explicitly do not want to package, avoids 'unpackaged
# files' warning.
-rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
+# This has become obsolete: rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
##############################################################################
# Post processing actions, i.e. when installed
@@ -721,13 +755,12 @@ else
fi
# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
if [ ! -d $mysql_datadir/mysql ] ; then
- mkdir $mysql_datadir/mysql;
+ mkdir $mysql_datadir/mysql $mysql_datadir/test
echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
else
# If the directory exists, we may assume it is an upgrade.
echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
fi
-if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
# ----------------------------------------------------------------------
# Make MySQL start/shutdown automatically when the machine does it.
@@ -762,7 +795,12 @@ chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
# ----------------------------------------------------------------------
# Initiate databases if needed
# ----------------------------------------------------------------------
-%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then
+ # Fix bug#45415: no "mysql_install_db" on an upgrade
+ # Do this as a negative to err towards more "install" runs
+ # rather than to miss one.
+ %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+fi
# ----------------------------------------------------------------------
# Upgrade databases if needed would go here - but it cannot be automated yet
@@ -940,7 +978,7 @@ echo "=====" >> $STATUS_HISTORY
# Files section
##############################################################################
-%files -n MySQL-server%{product_suffix}
+%files -n MySQL-server%{product_suffix} -f release/support-files/plugins.files
%defattr(-,root,root,0755)
%if %{defined license_files_server}
@@ -966,6 +1004,7 @@ echo "=====" >> $STATUS_HISTORY
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1*
@@ -980,6 +1019,7 @@ echo "=====" >> $STATUS_HISTORY
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
@@ -992,10 +1032,12 @@ echo "=====" >> $STATUS_HISTORY
%attr(755, root, root) %{_bindir}/mysql_convert_table_format
%attr(755, root, root) %{_bindir}/mysql_fix_extensions
%attr(755, root, root) %{_bindir}/mysql_install_db
+%attr(755, root, root) %{_bindir}/mysql_plugin
%attr(755, root, root) %{_bindir}/mysql_secure_installation
%attr(755, root, root) %{_bindir}/mysql_setpermission
%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
%attr(755, root, root) %{_bindir}/mysql_upgrade
+%attr(755, root, root) %{_bindir}/mysql_plugin
%attr(755, root, root) %{_bindir}/mysql_zap
%attr(755, root, root) %{_bindir}/mysqlbug
%attr(755, root, root) %{_bindir}/mysqld_multi
@@ -1011,28 +1053,7 @@ echo "=====" >> $STATUS_HISTORY
%attr(755, root, root) %{_sbindir}/mysqld
%attr(755, root, root) %{_sbindir}/mysqld-debug
%attr(755, root, root) %{_sbindir}/rcmysql
-%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%if %{WITH_TCMALLOC}
%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
@@ -1117,6 +1138,7 @@ echo "=====" >> $STATUS_HISTORY
# ----------------------------------------------------------------------------
%files -n MySQL-embedded%{product_suffix}
%defattr(-, root, root, 0755)
+%attr(755, root, root) %{_bindir}/mysql_embedded
%attr(644, root, root) %{_libdir}/mysql/libmysqld.a
%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a
@@ -1126,6 +1148,59 @@ echo "=====" >> $STATUS_HISTORY
# merging BK trees)
##############################################################################
%changelog
+* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
+ the RPMs of any configuration (of the current or the preceding release series)
+ by the new ones. This is done by not using the implicitly generated capabilities
+ (which include the configuration name) and relying on more generic ones which
+ just list the function ("server", "client", ...).
+ The implicit generation cannot be prevented, so all these capabilities must be
+ explicitly listed in "Obsoletes:"
+
+* Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6. Due to
+ changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install)
+ this necessitated a move of the libmygcc.a installation to the install
+ phase, which is probably where it belonged in the first place.
+
+* Tue Sep 13 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- "make_win_bin_dist" and its manual are dropped, cmake does it different.
+
+* Thu Sep 08 2011 Daniel Fischer <daniel.fischer@oracle.com>
+
+- Add mysql_plugin man page.
+
+* Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Add the manual page for "mysql_plugin" to the server package.
+
+* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Null-upmerge the fix of bug#37165: This spec file is not affected.
+- Replace "/var/lib/mysql" by the spec file variable "%{mysqldatadir}".
+
+* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com>
+
+- Source plugin library files list from cmake-generated file.
+
+* Mon Jul 25 2011 Chuck Bell <chuck.bell@oracle.com>
+
+- Added the mysql_plugin client - enables or disables plugins.
+
+* Thu Jul 21 2011 Sunanda Menon <sunanda.menon@oracle.com>
+
+- Fix bug#12561297: Added the MySQL embedded binary
+
+* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Fix bug#45415: "rpm upgrade recreates test database"
+ Let the creation of the "test" database happen only during a new installation,
+ not in an RPM upgrade.
+ This affects both the "mkdir" and the call of "mysql_install_db".
+
* Thu Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Fix bug#56581: If an installation deviates from the default file locations
diff --git a/support-files/ndb-config-2-node.ini.sh b/support-files/ndb-config-2-node.ini.sh
index be80f1dd0b3..cf3bbfc436e 100644
--- a/support-files/ndb-config-2-node.ini.sh
+++ b/support-files/ndb-config-2-node.ini.sh
@@ -1,3 +1,18 @@
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
# Example Ndbcluster storage engine config file.
#
[ndbd default]
diff --git a/tests/big_record.pl b/tests/big_record.pl
index ceedb6f114a..0d5766e5f5d 100755
--- a/tests/big_record.pl
+++ b/tests/big_record.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2000, 2003 MySQL AB
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# This is a test with stores big records in a blob.
# Note that for the default test the mysql server should have been
diff --git a/tests/bug25714.c b/tests/bug25714.c
index c0d9fbf7652..40c631d76a5 100644
--- a/tests/bug25714.c
+++ b/tests/bug25714.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <my_sys.h>
diff --git a/tests/grant.pl b/tests/grant.pl
index 368ce0b3254..23a7d2110fb 100755
--- a/tests/grant.pl
+++ b/tests/grant.pl
@@ -1,6 +1,7 @@
#!/usr/bin/perl
-# Copyright (C) 2000, 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+# Copyright (c) 2000, 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Testing of grants.
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index f8cdc57b4be..d62220e2aa8 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -13486,7 +13486,10 @@ static void test_truncation()
")";
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
myquery(rc);
- stmt_text= "insert into t1 VALUES ("
+
+ {
+ const char insert_text[]=
+ "insert into t1 VALUES ("
"-10, " /* i8 */
"200, " /* ui8 */
"32000, " /* i16 */
@@ -13502,8 +13505,9 @@ static void test_truncation()
"'12345.67 ', " /* tx_1 */
"'12345.67abc'" /* ch_2 */
")";
- rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
- myquery(rc);
+ rc= mysql_real_query(mysql, insert_text, strlen(insert_text));
+ myquery(rc);
+ }
stmt_text= "select i8 c1, i8 c2, ui8 c3, i16_1 c4, ui16 c5, "
" i16 c6, ui16 c7, i32 c8, i32_1 c9, i32_1 c10, "
@@ -18638,11 +18642,8 @@ static void test_bug38486(void)
static void test_bug33831(void)
{
MYSQL *l_mysql;
- my_bool error;
DBUG_ENTER("test_bug33831");
-
- error= 0;
if (!(l_mysql= mysql_client_init(NULL)))
{
@@ -18665,9 +18666,8 @@ static void test_bug33831(void)
DIE_UNLESS(0);
}
-
mysql_close(l_mysql);
-
+
DBUG_VOID_RETURN;
}
@@ -19774,6 +19774,34 @@ static void test_bug12337762()
DBUG_VOID_RETURN;
}
+
+/*
+ BUG 11754979 - 46675: ON DUPLICATE KEY UPDATE AND UPDATECOUNT() POSSIBLY WRONG
+*/
+
+static void test_bug11754979()
+{
+ MYSQL* conn;
+ DBUG_ENTER("test_bug11754979");
+
+ myheader("test_bug11754979");
+ DIE_UNLESS((conn= mysql_client_init(NULL)));
+ DIE_UNLESS(mysql_real_connect(conn, opt_host, opt_user,
+ opt_password, opt_db ? opt_db:"test", opt_port,
+ opt_unix_socket, CLIENT_FOUND_ROWS));
+ myquery(mysql_query(conn, "DROP TABLE IF EXISTS t1"));
+ myquery(mysql_query(conn, "CREATE TABLE t1(id INT, label CHAR(1), PRIMARY KEY(id))"));
+ myquery(mysql_query(conn, "INSERT INTO t1(id, label) VALUES (1, 'a')"));
+ myquery(mysql_query(conn, "INSERT INTO t1(id, label) VALUES (1, 'a') "
+ "ON DUPLICATE KEY UPDATE id = 4"));
+ DIE_UNLESS(mysql_affected_rows(conn) == 2);
+ myquery(mysql_query(conn, "DROP TABLE t1"));
+ mysql_close(conn);
+
+ DBUG_VOID_RETURN;
+}
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -20119,6 +20147,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug11766854", test_bug11766854 },
{ "test_bug12337762", test_bug12337762 },
{ "test_progress_reporting", test_progress_reporting },
+ { "test_bug11754979", test_bug11754979 },
{ 0, 0 }
};
diff --git a/tests/thread_test.c b/tests/thread_test.c
index e0be59aa7c5..bf0fb8ea2c0 100644
--- a/tests/thread_test.c
+++ b/tests/thread_test.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
diff --git a/unittest/examples/core-t.c b/unittest/examples/core-t.c
index a9b798d3064..5f49e1cb1d9 100644
--- a/unittest/examples/core-t.c
+++ b/unittest/examples/core-t.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/unittest/examples/skip-t.c b/unittest/examples/skip-t.c
index c8c910b31ff..aa105385c17 100644
--- a/unittest/examples/skip-t.c
+++ b/unittest/examples/skip-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/unittest/examples/skip_all-t.c b/unittest/examples/skip_all-t.c
index 3751642293b..940d9f0186f 100644
--- a/unittest/examples/skip_all-t.c
+++ b/unittest/examples/skip_all-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/unittest/examples/todo-t.c b/unittest/examples/todo-t.c
index 67bea51965c..53aaa1c2813 100644
--- a/unittest/examples/todo-t.c
+++ b/unittest/examples/todo-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/unittest/mysys/base64-t.c b/unittest/mysys/base64-t.c
index cb0437f947c..d610ad52b79 100644
--- a/unittest/mysys/base64-t.c
+++ b/unittest/mysys/base64-t.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <my_sys.h>
diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c
index 2065e10b53f..75250d157e1 100644
--- a/unittest/mysys/bitmap-t.c
+++ b/unittest/mysys/bitmap-t.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
This test was copied from the unit test inside the
mysys/my_bitmap.c file and adapted by Mats Kindahl to use the mytap
diff --git a/unittest/mysys/lf-t.c b/unittest/mysys/lf-t.c
index c04ef358abe..573a56cc1d6 100644
--- a/unittest/mysys/lf-t.c
+++ b/unittest/mysys/lf-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -34,8 +34,7 @@ int with_my_thread_init=0;
*/
pthread_handler_t test_lf_pinbox(void *arg)
{
- int m= *(int *)arg;
- int32 x= 0;
+ int m= *(int *)arg;
LF_PINS *pins;
if (with_my_thread_init)
@@ -43,7 +42,7 @@ pthread_handler_t test_lf_pinbox(void *arg)
pins= lf_pinbox_get_pins(&lf_allocator.pinbox);
- for (x= ((int)(intptr)(&m)); m ; m--)
+ for (; m ; m--)
{
lf_pinbox_put_pins(pins);
pins= lf_pinbox_get_pins(&lf_allocator.pinbox);
diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c
index 95799be7bb1..ae9bb6903f5 100644
--- a/unittest/mysys/my_atomic-t.c
+++ b/unittest/mysys/my_atomic-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "thr_template.c"
@@ -164,7 +164,14 @@ void do_tests()
test_concurrently("my_atomic_cas32", test_atomic_cas, THREADS, CYCLES);
{
- int64 b=0x1000200030004000LL;
+ /*
+ If b is not volatile, the wrong assembly code is generated on OSX Lion
+ as the variable is optimized away as a constant.
+ See Bug#62533 / Bug#13030056.
+ Another workaround is to specify architecture explicitly using e.g.
+ CFLAGS/CXXFLAGS= "-m64".
+ */
+ volatile int64 b=0x1000200030004000LL;
a64=0;
my_atomic_add64(&a64, b);
ok(a64==b, "add64");
diff --git a/unittest/mysys/my_rdtsc-t.c b/unittest/mysys/my_rdtsc-t.c
index 286ff29fbfc..76a74a6fc09 100644
--- a/unittest/mysys/my_rdtsc-t.c
+++ b/unittest/mysys/my_rdtsc-t.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
rdtsc3 -- multi-platform timer code
diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c
index 7f93f5bb195..06f6878826a 100644
--- a/unittest/mysys/my_vsnprintf-t.c
+++ b/unittest/mysys/my_vsnprintf-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <m_string.h>
diff --git a/unittest/mysys/thr_template.c b/unittest/mysys/thr_template.c
index 781bfbe4f9c..5bb9809b1e1 100644
--- a/unittest/mysys/thr_template.c
+++ b/unittest/mysys/thr_template.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#include <my_sys.h>
diff --git a/unittest/mytap/t/basic-t.c b/unittest/mytap/t/basic-t.c
index b588521d192..dcb13b20f11 100644
--- a/unittest/mytap/t/basic-t.c
+++ b/unittest/mytap/t/basic-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/unittest/strings/strings-t.c b/unittest/strings/strings-t.c
index cb33af3ac03..66b3ac63792 100644
--- a/unittest/strings/strings-t.c
+++ b/unittest/strings/strings-t.c
@@ -1,4 +1,4 @@
-/* Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/unittest/unit.pl b/unittest/unit.pl
index ec7cc02727f..fe45ece4233 100644
--- a/unittest/unit.pl
+++ b/unittest/unit.pl
@@ -1,5 +1,6 @@
#!/usr/bin/perl
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/vio/test-ssl.c b/vio/test-ssl.c
index 4d158ae83f7..c99f5071055 100644
--- a/vio/test-ssl.c
+++ b/vio/test-ssl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#if defined(HAVE_OPENSSL)
diff --git a/vio/test-sslclient.c b/vio/test-sslclient.c
index 9d8a741e313..93fdb063754 100644
--- a/vio/test-sslclient.c
+++ b/vio/test-sslclient.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#ifdef HAVE_OPENSSL
diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c
index 35cfa26bd00..c81dc03dc58 100644
--- a/vio/test-sslserver.c
+++ b/vio/test-sslserver.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#ifdef HAVE_OPENSSL
diff --git a/vio/vio.c b/vio/vio.c
index 48f103c33e8..b8bc7bdae08 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Note that we can't have assertion on file descriptors; The reason for
diff --git a/vio/vio_priv.h b/vio/vio_priv.h
index 1bfb857b039..702ba4de38a 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -1,7 +1,7 @@
#ifndef VIO_PRIV_INCLUDED
#define VIO_PRIV_INCLUDED
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Structures and functions private to the vio package */
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 43137ac7e92..4772847abd8 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/*
+ Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/vio/viossl.c b/vio/viossl.c
index 356fca40d13..b40f7b931e6 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Note that we can't have assertion on file descriptors; The reason for
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index 4f4dd5758ba..d71021452d1 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "vio_priv.h"
diff --git a/vio/viotest-ssl.c b/vio/viotest-ssl.c
index 90489b46605..51d171d6923 100644
--- a/vio/viotest-ssl.c
+++ b/vio/viotest-ssl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h>
#ifdef HAVE_OPENSSL
diff --git a/vio/viotest-sslconnect.cc b/vio/viotest-sslconnect.cc
index 89e1a6e7dfe..18e558159fa 100644
--- a/vio/viotest-sslconnect.cc
+++ b/vio/viotest-sslconnect.cc
@@ -1,3 +1,18 @@
+/* Copyright (c) 2000 MySQL AB
+ Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
** Virtual I/O library
diff --git a/vio/viotest.cc b/vio/viotest.cc
index 490a9ca6694..b1c11a85cf2 100644
--- a/vio/viotest.cc
+++ b/vio/viotest.cc
@@ -1,3 +1,19 @@
+/* Copyright (c) 2000 MySQL AB
+ Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
/*
** Virtual I/O library
** Written by Andrei Errapart <andreie@no.spam.ee>
diff --git a/win/create_def_file.js b/win/create_def_file.js
index 21f884417e3..019bb7471ab 100644
--- a/win/create_def_file.js
+++ b/win/create_def_file.js
@@ -1,6 +1,7 @@
// create_def_file.js
//
-// Copyright (C) 2009 Sun Microsystems
+// Copyright (c) 2009 Sun Microsystems, Inc.
+// Use is subject to license terms.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by