Merge lp:~stewart/percona-server/5.5.31 into lp:percona-server/5.5

Proposed by Stewart Smith
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 517
Proposed branch: lp:~stewart/percona-server/5.5.31
Merge into: lp:percona-server/5.5
Diff against target: 147486 lines (+70734/-68859)
260 files modified
Percona-Server/BUILD/compile-alpha-debug (+2/-1)
Percona-Server/BUILD/compile-amd64-debug-max (+2/-1)
Percona-Server/BUILD/compile-amd64-max (+2/-1)
Percona-Server/BUILD/compile-darwin-mwcc (+2/-1)
Percona-Server/BUILD/compile-hpux11-parisc2-aCC (+2/-1)
Percona-Server/BUILD/compile-irix-mips64-mipspro (+2/-1)
Percona-Server/BUILD/compile-ndb-autotest (+1/-1)
Percona-Server/BUILD/compile-pentium (+2/-1)
Percona-Server/BUILD/compile-pentium-debug-max-no-embedded (+2/-1)
Percona-Server/BUILD/compile-pentium-debug-max-no-ndb (+1/-1)
Percona-Server/BUILD/compile-pentium-max (+2/-1)
Percona-Server/BUILD/compile-pentium-pgcc (+2/-1)
Percona-Server/BUILD/compile-ppc-debug (+2/-1)
Percona-Server/BUILD/compile-ppc-debug-max (+2/-1)
Percona-Server/BUILD/compile-ppc-debug-max-no-ndb (+2/-1)
Percona-Server/BUILD/compile-ppc-max (+2/-1)
Percona-Server/BUILD/compile-solaris-sparc-debug (+2/-1)
Percona-Server/BUILD/compile-solaris-sparc-purify (+2/-1)
Percona-Server/VERSION (+1/-1)
Percona-Server/client/client_priv.h (+1/-1)
Percona-Server/client/completion_hash.h (+2/-1)
Percona-Server/client/echo.c (+2/-1)
Percona-Server/client/get_password.c (+2/-1)
Percona-Server/client/mysqlcheck.c (+61/-27)
Percona-Server/client/mysqldump.c (+1/-1)
Percona-Server/client/sql_string.cc (+2/-2)
Percona-Server/cmake/configure.pl (+1/-1)
Percona-Server/cmake/create_initial_db.cmake.in (+1/-1)
Percona-Server/cmake/make_dist.cmake.in (+1/-1)
Percona-Server/cmake/mysql_version.cmake (+1/-1)
Percona-Server/cmake/package_name.cmake (+1/-1)
Percona-Server/cmake/plugin.cmake (+1/-1)
Percona-Server/cmake/ssl.cmake (+1/-1)
Percona-Server/cmake/zlib.cmake (+6/-2)
Percona-Server/configure.cmake (+1/-1)
Percona-Server/extra/charset2html.c (+2/-1)
Percona-Server/extra/yassl/CMakeLists.txt (+1/-1)
Percona-Server/extra/yassl/examples/client/client.cpp (+1/-1)
Percona-Server/extra/yassl/examples/echoclient/echoclient.cpp (+1/-1)
Percona-Server/extra/yassl/examples/echoserver/echoserver.cpp (+1/-1)
Percona-Server/extra/yassl/examples/server/server.cpp (+1/-1)
Percona-Server/extra/yassl/include/buffer.hpp (+1/-1)
Percona-Server/extra/yassl/include/cert_wrapper.hpp (+1/-2)
Percona-Server/extra/yassl/include/lock.hpp (+1/-1)
Percona-Server/extra/yassl/include/openssl/prefix_ssl.h (+1/-2)
Percona-Server/extra/yassl/include/socket_wrapper.hpp (+1/-1)
Percona-Server/extra/yassl/include/yassl_error.hpp (+3/-3)
Percona-Server/extra/yassl/include/yassl_imp.hpp (+1/-2)
Percona-Server/extra/yassl/include/yassl_int.hpp (+1/-1)
Percona-Server/extra/yassl/include/yassl_types.hpp (+6/-3)
Percona-Server/extra/yassl/src/buffer.cpp (+1/-2)
Percona-Server/extra/yassl/src/cert_wrapper.cpp (+1/-2)
Percona-Server/extra/yassl/src/crypto_wrapper.cpp (+1/-1)
Percona-Server/extra/yassl/src/handshake.cpp (+36/-2)
Percona-Server/extra/yassl/src/lock.cpp (+1/-1)
Percona-Server/extra/yassl/src/make.bat (+1/-1)
Percona-Server/extra/yassl/src/socket_wrapper.cpp (+1/-1)
Percona-Server/extra/yassl/src/ssl.cpp (+1/-2)
Percona-Server/extra/yassl/src/template_instnt.cpp (+2/-1)
Percona-Server/extra/yassl/src/yassl.cpp (+1/-1)
Percona-Server/extra/yassl/src/yassl_error.cpp (+5/-1)
Percona-Server/extra/yassl/src/yassl_imp.cpp (+172/-26)
Percona-Server/extra/yassl/taocrypt/benchmark/benchmark.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/benchmark/make.bat (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/aes.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/asn.hpp (+1/-2)
Percona-Server/extra/yassl/taocrypt/include/block.hpp (+1/-2)
Percona-Server/extra/yassl/taocrypt/include/blowfish.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/des.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/hash.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/hc128.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/integer.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/kernelc.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/misc.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/modes.hpp (+1/-2)
Percona-Server/extra/yassl/taocrypt/include/pwdbased.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/rabbit.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/rsa.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/runtime.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/include/types.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/mySTL/stdexcept.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/mySTL/vector.hpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/aes.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/aestables.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/algebra.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/arc4.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/blowfish.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/coding.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/dsa.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/hash.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/hc128.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/make.bat (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/md4.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/md5.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/misc.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/rabbit.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/random.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/ripemd.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/rsa.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/sha.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/template_instnt.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/twofish.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/test/make.bat (+1/-1)
Percona-Server/extra/yassl/taocrypt/test/memory.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/test/test.cpp (+1/-1)
Percona-Server/extra/yassl/testsuite/make.bat (+1/-1)
Percona-Server/extra/yassl/testsuite/test.hpp (+1/-1)
Percona-Server/extra/yassl/testsuite/testsuite.cpp (+1/-1)
Percona-Server/include/base64.h (+2/-1)
Percona-Server/include/ft_global.h (+1/-1)
Percona-Server/include/m_ctype.h (+3/-1)
Percona-Server/include/m_string.h (+1/-1)
Percona-Server/include/my_md5.h (+2/-1)
Percona-Server/include/my_sys.h (+1/-1)
Percona-Server/include/my_user.h (+2/-1)
Percona-Server/include/my_xml.h (+2/-1)
Percona-Server/include/myisampack.h (+1/-1)
Percona-Server/include/mysql.h (+1/-1)
Percona-Server/include/mysql/service_my_snprintf.h (+1/-1)
Percona-Server/include/mysql/thread_pool_priv.h (+1/-1)
Percona-Server/include/mysql_time.h (+2/-1)
Percona-Server/include/mysql_version.h.in (+2/-1)
Percona-Server/include/welcome_copyright_notice.h (+1/-1)
Percona-Server/libmysql/libmysql.c (+8/-1)
Percona-Server/mysql-test/collections/default.experimental (+1/-0)
Percona-Server/mysql-test/include/get_relay_log_pos.inc (+1/-1)
Percona-Server/mysql-test/include/rpl_init.inc (+0/-3)
Percona-Server/mysql-test/mysql-test-run.pl (+23/-4)
Percona-Server/mysql-test/r/cast.result (+18/-0)
Percona-Server/mysql-test/r/ctype_utf8mb4.result (+18/-0)
Percona-Server/mysql-test/r/join_outer.result (+32/-0)
Percona-Server/mysql-test/r/partition.result (+2/-2)
Percona-Server/mysql-test/r/percona_server_variables_debug.result (+1/-0)
Percona-Server/mysql-test/r/show_check.result (+9/-9)
Percona-Server/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result (+1/-0)
Percona-Server/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test (+3/-1)
Percona-Server/mysql-test/suite/binlog/t/disabled.def (+1/-1)
Percona-Server/mysql-test/suite/innodb/r/innodb_bug14147491.result (+15/-4)
Percona-Server/mysql-test/suite/innodb/t/innodb_bug12400341.test (+4/-0)
Percona-Server/mysql-test/suite/innodb/t/innodb_bug14147491.test (+45/-9)
Percona-Server/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result (+11605/-11605)
Percona-Server/mysql-test/suite/parts/r/partition_alter1_1_innodb.result (+32/-32)
Percona-Server/mysql-test/suite/parts/r/partition_alter1_2_innodb.result (+21002/-21002)
Percona-Server/mysql-test/suite/parts/r/partition_alter2_1_1_innodb.result (+40/-40)
Percona-Server/mysql-test/suite/parts/r/partition_alter2_1_2_innodb.result (+40/-40)
Percona-Server/mysql-test/suite/parts/r/partition_alter2_2_1_innodb.result (+11354/-11354)
Percona-Server/mysql-test/suite/parts/r/partition_alter2_2_2_innodb.result (+40/-40)
Percona-Server/mysql-test/suite/parts/r/partition_alter4_innodb.result (+208/-208)
Percona-Server/mysql-test/suite/parts/r/partition_basic_innodb.result (+23390/-23390)
Percona-Server/mysql-test/suite/parts/r/partition_engine_innodb.result (+11/-11)
Percona-Server/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result (+12/-0)
Percona-Server/mysql-test/suite/rpl/r/rpl_row_until.result (+12/-10)
Percona-Server/mysql-test/suite/rpl/r/rpl_stm_until.result (+1/-11)
Percona-Server/mysql-test/suite/rpl/t/disabled.def (+0/-1)
Percona-Server/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test (+12/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_row_until.test (+52/-25)
Percona-Server/mysql-test/suite/rpl/t/rpl_stm_until.test (+2/-33)
Percona-Server/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result (+7/-0)
Percona-Server/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test (+10/-0)
Percona-Server/mysql-test/t/cast.test (+13/-0)
Percona-Server/mysql-test/t/ctype_utf8mb4.test (+15/-0)
Percona-Server/mysql-test/t/join_outer.test (+30/-0)
Percona-Server/mysql-test/t/mysql_plugin.test (+16/-50)
Percona-Server/mysys/errors.c (+2/-2)
Percona-Server/mysys/mf_keycache.c (+2/-1)
Percona-Server/mysys/my_lockmem.c (+1/-1)
Percona-Server/mysys/my_malloc.c (+9/-3)
Percona-Server/mysys/my_once.c (+1/-1)
Percona-Server/mysys/my_write.c (+3/-3)
Percona-Server/mysys/thr_alarm.c (+8/-14)
Percona-Server/packaging/WiX/mysql_server.wxs.in (+5/-2)
Percona-Server/packaging/rpm-uln/mysql.spec.sh (+18/-11)
Percona-Server/regex/my_regex.h (+1/-1)
Percona-Server/regex/regcomp.c (+1/-1)
Percona-Server/scripts/mysql_system_tables_data.sql (+9/-5)
Percona-Server/sql/CMakeLists.txt (+3/-9)
Percona-Server/sql/db.opt (+2/-0)
Percona-Server/sql/ha_partition.cc (+469/-25)
Percona-Server/sql/ha_partition.h (+16/-4)
Percona-Server/sql/handler.cc (+16/-2)
Percona-Server/sql/item.cc (+2/-2)
Percona-Server/sql/item.h (+19/-1)
Percona-Server/sql/item_cmpfunc.cc (+4/-3)
Percona-Server/sql/item_func.cc (+2/-2)
Percona-Server/sql/item_func.h (+12/-9)
Percona-Server/sql/item_sum.cc (+4/-0)
Percona-Server/sql/key.cc (+72/-44)
Percona-Server/sql/key.h (+3/-1)
Percona-Server/sql/log_event.cc (+11/-5)
Percona-Server/sql/log_event.h (+28/-2)
Percona-Server/sql/mysqld.cc (+25/-6)
Percona-Server/sql/mysqld.h (+1/-0)
Percona-Server/sql/opt_range.cc (+91/-19)
Percona-Server/sql/partition_element.h (+3/-4)
Percona-Server/sql/partition_info.cc (+286/-2)
Percona-Server/sql/partition_info.h (+16/-1)
Percona-Server/sql/rpl_utility.cc (+1/-0)
Percona-Server/sql/set_var.cc (+7/-10)
Percona-Server/sql/set_var.h (+23/-7)
Percona-Server/sql/sp_head.cc (+2/-1)
Percona-Server/sql/sql_acl.cc (+2/-1)
Percona-Server/sql/sql_admin.cc (+3/-2)
Percona-Server/sql/sql_admin.h (+3/-1)
Percona-Server/sql/sql_binlog.cc (+1/-1)
Percona-Server/sql/sql_class.cc (+12/-6)
Percona-Server/sql/sql_handler.cc (+10/-5)
Percona-Server/sql/sql_partition.cc (+200/-19)
Percona-Server/sql/sql_partition.h (+3/-2)
Percona-Server/sql/sql_partition_admin.cc (+3/-1)
Percona-Server/sql/sql_prepare.cc (+4/-3)
Percona-Server/sql/sql_repl.cc (+17/-33)
Percona-Server/sql/sql_select.cc (+4/-3)
Percona-Server/sql/sql_show.cc (+23/-15)
Percona-Server/sql/sql_string.cc (+1/-1)
Percona-Server/sql/sql_table.cc (+7/-4)
Percona-Server/sql/sql_view.cc (+9/-3)
Percona-Server/sql/sql_yacc.yy (+22/-3)
Percona-Server/sql/sys_vars.cc (+1/-1)
Percona-Server/storage/innobase/btr/btr0cur.c (+27/-20)
Percona-Server/storage/innobase/buf/buf0buf.c (+14/-2)
Percona-Server/storage/innobase/buf/buf0rea.c (+1/-1)
Percona-Server/storage/innobase/dict/dict0crea.c (+9/-0)
Percona-Server/storage/innobase/dict/dict0dict.c (+13/-3)
Percona-Server/storage/innobase/dyn/dyn0dyn.c (+4/-4)
Percona-Server/storage/innobase/handler/ha_innodb.cc (+110/-2)
Percona-Server/storage/innobase/handler/i_s.cc (+2/-1)
Percona-Server/storage/innobase/ibuf/ibuf0ibuf.c (+11/-1)
Percona-Server/storage/innobase/include/db0err.h (+1/-0)
Percona-Server/storage/innobase/include/dyn0dyn.h (+50/-38)
Percona-Server/storage/innobase/include/dyn0dyn.ic (+42/-101)
Percona-Server/storage/innobase/include/ha_prototypes.h (+11/-0)
Percona-Server/storage/innobase/include/mtr0mtr.h (+6/-4)
Percona-Server/storage/innobase/include/page0zip.ic (+3/-3)
Percona-Server/storage/innobase/include/ut0dbg.h (+0/-40)
Percona-Server/storage/innobase/lock/lock0lock.c (+5/-0)
Percona-Server/storage/innobase/mtr/mtr0mtr.c (+80/-77)
Percona-Server/storage/innobase/page/page0zip.c (+6/-5)
Percona-Server/storage/innobase/row/row0mysql.c (+1/-1)
Percona-Server/storage/innobase/row/row0sel.c (+5/-1)
Percona-Server/storage/innobase/srv/srv0srv.c (+27/-15)
Percona-Server/storage/innobase/sync/sync0arr.c (+4/-4)
Percona-Server/storage/innobase/trx/trx0sys.c (+1/-1)
Percona-Server/storage/innobase/ut/ut0dbg.c (+1/-33)
Percona-Server/storage/innobase/ut/ut0ut.c (+2/-0)
Percona-Server/storage/myisam/mi_write.c (+8/-5)
Percona-Server/storage/myisam/myisampack.c (+2/-1)
Percona-Server/storage/perfschema/pfs_engine_table.cc (+4/-4)
Percona-Server/storage/perfschema/pfs_global.cc (+2/-2)
Percona-Server/storage/perfschema/pfs_global.h (+2/-2)
Percona-Server/strings/ctype-bin.c (+20/-7)
Percona-Server/strings/ctype-mb.c (+39/-12)
Percona-Server/strings/ctype-simple.c (+20/-6)
Percona-Server/strings/ctype-uca.c (+19/-7)
Percona-Server/strings/ctype-utf8.c (+23/-10)
Percona-Server/strings/ctype.c (+2/-0)
Percona-Server/strings/decimal.c (+2/-2)
Percona-Server/support-files/MySQL-shared-compat.spec.sh (+1/-1)
Percona-Server/support-files/mysql.spec.sh (+124/-57)
Percona-Server/unittest/mysys/my_vsnprintf-t.c (+3/-1)
Percona-Server/vio/viossl.c (+3/-0)
To merge this branch: bzr merge lp:~stewart/percona-server/5.5.31
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+163837@code.launchpad.net

This proposal supersedes a proposal from 2013-05-14.

Description of the change

This was very trivial merge - a few places where code had been added around the same place where we added some, but nothing more than a few lines.

http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/732/

some failures due to lacking libeatmydata on some build machines :(

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal
review: Needs Information
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
Stewart Smith (stewart) wrote : Posted in a previous version of this proposal

Laurynas Biveinis <email address hidden> writes:
> Review: Needs Information
>
> Please make sure that items in
> https://blueprints.launchpad.net/percona-server/+spec/rebase-mysql-5.5.31
> are addressed.

Ovias looked into things:
http://www.mysqlperformanceblog.com/2013/01/13/cve-2012-4414-in-mysql-5-5-29-and-percona-server-5-5-29/#comments

Which appears that we can't swap it out yet :(

--
Stewart Smith

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

Upstream has added RETURN_IF_INNODB_NOT_STARTED where we already had one:

@@ -3496,6 +3498,7 @@
  mutex_t* block_mutex;

  DBUG_ENTER("i_s_innodb_fill_buffer_lru");
+ RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);

  RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name);

review: Needs Fixing
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

I missed that bug 1072573 needs fixing on 5.1, thus please make separate 5.1/5.5/5.6 MPs.

Please compact all the remaining commits to a single one.

review: Needs Fixing
Revision history for this message
Stewart Smith (stewart) wrote : Posted in a previous version of this proposal

> I missed that bug 1072573 needs fixing on 5.1, thus please make separate
> 5.1/5.5/5.6 MPs.
>
> Please compact all the remaining commits to a single one.

Done. resubmitting this merge, with 1072573 in sep merge reqs

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

Let's see if we can merge this to the trunk only after 5.6.11 has been merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/BUILD/compile-alpha-debug'
2--- Percona-Server/BUILD/compile-alpha-debug 2010-12-28 23:47:05 +0000
3+++ Percona-Server/BUILD/compile-alpha-debug 2013-05-15 05:12:25 +0000
4@@ -1,6 +1,7 @@
5 #! /bin/sh
6
7-# Copyright (C) 2000, 2005 MySQL AB
8+# Copyright (c) 2000, 2001, 2005-2007 MySQL AB
9+# Use is subject to license terms
10 #
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13
14=== modified file 'Percona-Server/BUILD/compile-amd64-debug-max'
15--- Percona-Server/BUILD/compile-amd64-debug-max 2010-12-28 23:47:05 +0000
16+++ Percona-Server/BUILD/compile-amd64-debug-max 2013-05-15 05:12:25 +0000
17@@ -1,6 +1,7 @@
18 #! /bin/sh
19
20-# Copyright (C) 2005 MySQL AB
21+# Copyright (c) 2005, 2006 MySQL AB
22+# Use is subject to license terms
23 #
24 # This program is free software; you can redistribute it and/or modify
25 # it under the terms of the GNU General Public License as published by
26
27=== modified file 'Percona-Server/BUILD/compile-amd64-max'
28--- Percona-Server/BUILD/compile-amd64-max 2010-12-28 23:47:05 +0000
29+++ Percona-Server/BUILD/compile-amd64-max 2013-05-15 05:12:25 +0000
30@@ -1,6 +1,7 @@
31 #! /bin/sh
32
33-# Copyright (C) 2005 MySQL AB
34+# Copyright (c) 2005, 2006 MySQL AB
35+# Use is subject to license terms
36 #
37 # This program is free software; you can redistribute it and/or modify
38 # it under the terms of the GNU General Public License as published by
39
40=== modified file 'Percona-Server/BUILD/compile-darwin-mwcc'
41--- Percona-Server/BUILD/compile-darwin-mwcc 2010-12-28 23:47:05 +0000
42+++ Percona-Server/BUILD/compile-darwin-mwcc 2013-05-15 05:12:25 +0000
43@@ -1,6 +1,7 @@
44 #! /bin/sh
45
46-# Copyright (C) 2005 MySQL AB
47+# Copyright (c) 2005, 2006 MySQL AB
48+# Use is subject to license terms
49 #
50 # This program is free software; you can redistribute it and/or modify
51 # it under the terms of the GNU General Public License as published by
52
53=== modified file 'Percona-Server/BUILD/compile-hpux11-parisc2-aCC'
54--- Percona-Server/BUILD/compile-hpux11-parisc2-aCC 2010-12-28 23:47:05 +0000
55+++ Percona-Server/BUILD/compile-hpux11-parisc2-aCC 2013-05-15 05:12:25 +0000
56@@ -1,6 +1,7 @@
57 #!/bin/sh
58
59-# Copyright (C) 2004, 2005 MySQL AB
60+# Copyright (c) 2004, 2005, 2007 MySQL AB
61+# Use is subject to license terms
62 #
63 # This program is free software; you can redistribute it and/or modify
64 # it under the terms of the GNU General Public License as published by
65
66=== modified file 'Percona-Server/BUILD/compile-irix-mips64-mipspro'
67--- Percona-Server/BUILD/compile-irix-mips64-mipspro 2010-12-28 23:47:05 +0000
68+++ Percona-Server/BUILD/compile-irix-mips64-mipspro 2013-05-15 05:12:25 +0000
69@@ -1,6 +1,7 @@
70 #!/bin/sh
71
72-# Copyright (C) 2004, 2005 MySQL AB
73+# Copyright (c) 2004, 2005, 2007 MySQL AB
74+# Use is subject to license terms
75 #
76 # This program is free software; you can redistribute it and/or modify
77 # it under the terms of the GNU General Public License as published by
78
79=== modified file 'Percona-Server/BUILD/compile-ndb-autotest'
80--- Percona-Server/BUILD/compile-ndb-autotest 2010-12-29 00:26:31 +0000
81+++ Percona-Server/BUILD/compile-ndb-autotest 2013-05-15 05:12:25 +0000
82@@ -1,6 +1,6 @@
83 #! /bin/sh
84
85-# Copyright (C) 2006 MySQL AB
86+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
87 #
88 # This program is free software; you can redistribute it and/or modify
89 # it under the terms of the GNU General Public License as published by
90
91=== modified file 'Percona-Server/BUILD/compile-pentium'
92--- Percona-Server/BUILD/compile-pentium 2010-12-28 23:47:05 +0000
93+++ Percona-Server/BUILD/compile-pentium 2013-05-15 05:12:25 +0000
94@@ -1,6 +1,7 @@
95 #! /bin/sh
96
97-# Copyright (C) 2000, 2002 MySQL AB
98+# Copyright (c) 2000-2002, 2007 MySQL AB
99+# Use is subject to license terms
100 #
101 # This program is free software; you can redistribute it and/or modify
102 # it under the terms of the GNU General Public License as published by
103
104=== modified file 'Percona-Server/BUILD/compile-pentium-debug-max-no-embedded'
105--- Percona-Server/BUILD/compile-pentium-debug-max-no-embedded 2010-12-28 23:47:05 +0000
106+++ Percona-Server/BUILD/compile-pentium-debug-max-no-embedded 2013-05-15 05:12:25 +0000
107@@ -1,6 +1,7 @@
108 #! /bin/sh
109
110-# Copyright (C) 2004, 2005 MySQL AB
111+# Copyright (c) 2004-2006 MySQL AB
112+# Use is subject to license terms
113 #
114 # This program is free software; you can redistribute it and/or modify
115 # it under the terms of the GNU General Public License as published by
116
117=== modified file 'Percona-Server/BUILD/compile-pentium-debug-max-no-ndb'
118--- Percona-Server/BUILD/compile-pentium-debug-max-no-ndb 2010-12-29 00:26:31 +0000
119+++ Percona-Server/BUILD/compile-pentium-debug-max-no-ndb 2013-05-15 05:12:25 +0000
120@@ -1,6 +1,6 @@
121 #! /bin/sh
122
123-# Copyright (C) 2005, 2007 MySQL AB
124+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
125 #
126 # This program is free software; you can redistribute it and/or modify
127 # it under the terms of the GNU General Public License as published by
128
129=== modified file 'Percona-Server/BUILD/compile-pentium-max'
130--- Percona-Server/BUILD/compile-pentium-max 2010-12-28 23:47:05 +0000
131+++ Percona-Server/BUILD/compile-pentium-max 2013-05-15 05:12:25 +0000
132@@ -1,6 +1,7 @@
133 #! /bin/sh
134
135-# Copyright (C) 2001, 2005 MySQL AB
136+# Copyright (c) 2001-2006 MySQL AB
137+# Use is subject to license terms
138 #
139 # This program is free software; you can redistribute it and/or modify
140 # it under the terms of the GNU General Public License as published by
141
142=== modified file 'Percona-Server/BUILD/compile-pentium-pgcc'
143--- Percona-Server/BUILD/compile-pentium-pgcc 2010-12-28 23:47:05 +0000
144+++ Percona-Server/BUILD/compile-pentium-pgcc 2013-05-15 05:12:25 +0000
145@@ -1,6 +1,7 @@
146 #! /bin/sh
147
148-# Copyright (C) 2000, 2005 MySQL AB
149+# Copyright (c) 2000, 2001, 2005, 2007 MySQL AB
150+# Use is subject to license terms
151 #
152 # This program is free software; you can redistribute it and/or modify
153 # it under the terms of the GNU General Public License as published by
154
155=== modified file 'Percona-Server/BUILD/compile-ppc-debug'
156--- Percona-Server/BUILD/compile-ppc-debug 2010-12-28 23:47:05 +0000
157+++ Percona-Server/BUILD/compile-ppc-debug 2013-05-15 05:12:25 +0000
158@@ -1,6 +1,7 @@
159 #! /bin/sh
160
161-# Copyright (C) 2004 MySQL AB
162+# Copyright (c) 2004, 2006 MySQL AB
163+# Use is subject to license terms
164 #
165 # This program is free software; you can redistribute it and/or modify
166 # it under the terms of the GNU General Public License as published by
167
168=== modified file 'Percona-Server/BUILD/compile-ppc-debug-max'
169--- Percona-Server/BUILD/compile-ppc-debug-max 2010-12-28 23:47:05 +0000
170+++ Percona-Server/BUILD/compile-ppc-debug-max 2013-05-15 05:12:25 +0000
171@@ -1,6 +1,7 @@
172 #! /bin/sh
173
174-# Copyright (C) 2004, 2005 MySQL AB
175+# Copyright (c) 2004-2006 MySQL AB
176+# Use is subject to license terms
177 #
178 # This program is free software; you can redistribute it and/or modify
179 # it under the terms of the GNU General Public License as published by
180
181=== modified file 'Percona-Server/BUILD/compile-ppc-debug-max-no-ndb'
182--- Percona-Server/BUILD/compile-ppc-debug-max-no-ndb 2010-12-28 23:47:05 +0000
183+++ Percona-Server/BUILD/compile-ppc-debug-max-no-ndb 2013-05-15 05:12:25 +0000
184@@ -1,6 +1,7 @@
185 #! /bin/sh
186
187-# Copyright (C) 2005 MySQL AB
188+# Copyright (c) 2005, 2006 MySQL AB
189+# Use is subject to license terms
190 #
191 # This program is free software; you can redistribute it and/or modify
192 # it under the terms of the GNU General Public License as published by
193
194=== modified file 'Percona-Server/BUILD/compile-ppc-max'
195--- Percona-Server/BUILD/compile-ppc-max 2010-12-28 23:47:05 +0000
196+++ Percona-Server/BUILD/compile-ppc-max 2013-05-15 05:12:25 +0000
197@@ -1,6 +1,7 @@
198 #! /bin/sh
199
200-# Copyright (C) 2004, 2005 MySQL AB
201+# Copyright (c) 2004-2006 MySQL AB
202+# Use is subject to license terms
203 #
204 # This program is free software; you can redistribute it and/or modify
205 # it under the terms of the GNU General Public License as published by
206
207=== modified file 'Percona-Server/BUILD/compile-solaris-sparc-debug'
208--- Percona-Server/BUILD/compile-solaris-sparc-debug 2010-12-28 23:47:05 +0000
209+++ Percona-Server/BUILD/compile-solaris-sparc-debug 2013-05-15 05:12:25 +0000
210@@ -1,6 +1,7 @@
211 #!/bin/sh
212
213-# Copyright (C) 2001, 2005 MySQL AB
214+# Copyright (c) 2001, 2002, 2005-2007 MySQL AB
215+# Use is subject to license terms
216 #
217 # This program is free software; you can redistribute it and/or modify
218 # it under the terms of the GNU General Public License as published by
219
220=== modified file 'Percona-Server/BUILD/compile-solaris-sparc-purify'
221--- Percona-Server/BUILD/compile-solaris-sparc-purify 2010-12-28 23:47:05 +0000
222+++ Percona-Server/BUILD/compile-solaris-sparc-purify 2013-05-15 05:12:25 +0000
223@@ -1,6 +1,7 @@
224 #! /bin/sh
225
226-# Copyright (C) 2000, 2005 MySQL AB
227+# Copyright (c) 2000-2002, 2005-2007 MySQL AB
228+# Use is subject to license terms
229 #
230 # This program is free software; you can redistribute it and/or modify
231 # it under the terms of the GNU General Public License as published by
232
233=== modified file 'Percona-Server/VERSION'
234--- Percona-Server/VERSION 2013-02-18 04:48:10 +0000
235+++ Percona-Server/VERSION 2013-05-15 05:12:25 +0000
236@@ -1,4 +1,4 @@
237 MYSQL_VERSION_MAJOR=5
238 MYSQL_VERSION_MINOR=5
239-MYSQL_VERSION_PATCH=30
240+MYSQL_VERSION_PATCH=31
241 MYSQL_VERSION_EXTRA=
242
243=== modified file 'Percona-Server/client/client_priv.h'
244--- Percona-Server/client/client_priv.h 2012-08-07 06:10:00 +0000
245+++ Percona-Server/client/client_priv.h 2013-05-15 05:12:25 +0000
246@@ -1,5 +1,5 @@
247 /*
248- Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
249+ Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
250
251 This program is free software; you can redistribute it and/or modify
252 it under the terms of the GNU General Public License as published by
253
254=== modified file 'Percona-Server/client/completion_hash.h'
255--- Percona-Server/client/completion_hash.h 2010-12-28 18:57:23 +0000
256+++ Percona-Server/client/completion_hash.h 2013-05-15 05:12:25 +0000
257@@ -1,4 +1,5 @@
258-/* Copyright (C) 2000-2002 MySQL AB
259+/* Copyright (c) 2000-2002, 2006 MySQL AB
260+ Use is subject to license terms
261
262 This program is free software; you can redistribute it and/or
263 modify it under the terms of the GNU Library General Public
264
265=== modified file 'Percona-Server/client/echo.c'
266--- Percona-Server/client/echo.c 2007-03-20 17:31:49 +0000
267+++ Percona-Server/client/echo.c 2013-05-15 05:12:25 +0000
268@@ -1,4 +1,5 @@
269-/* Copyright (C) 2000 MySQL AB
270+/* Copyright (c) 2000, 2007 MySQL AB
271+ Use is subject to license terms
272
273 This program is free software; you can redistribute it and/or modify
274 it under the terms of the GNU General Public License as published by
275
276=== modified file 'Percona-Server/client/get_password.c'
277--- Percona-Server/client/get_password.c 2008-02-19 17:45:11 +0000
278+++ Percona-Server/client/get_password.c 2013-05-15 05:12:25 +0000
279@@ -1,4 +1,5 @@
280-/* Copyright (C) 2000 MySQL AB
281+/* Copyright (c) 2000, 2001, 2003, 2006, 2008 MySQL AB
282+ Use is subject to license terms
283
284 This program is free software; you can redistribute it and/or modify
285 it under the terms of the GNU General Public License as published by
286
287=== modified file 'Percona-Server/client/mysqlcheck.c'
288--- Percona-Server/client/mysqlcheck.c 2012-08-07 13:37:13 +0000
289+++ Percona-Server/client/mysqlcheck.c 2013-05-15 05:12:25 +0000
290@@ -15,7 +15,7 @@
291 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
292 */
293
294-#define CHECK_VERSION "2.5.0"
295+#define CHECK_VERSION "2.5.1"
296
297 #include "client_priv.h"
298 #include <m_ctype.h>
299@@ -29,6 +29,10 @@
300 #define EX_USAGE 1
301 #define EX_MYSQLERR 2
302
303+/* ALTER instead of repair. */
304+#define MAX_ALTER_STR_SIZE 128 * 1024
305+#define KEY_PARTITIONING_CHANGED_STR "KEY () partitioning changed"
306+
307 static MYSQL mysql_connection, *sock = 0;
308 static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
309 opt_compress = 0, opt_databases = 0, opt_fast = 0,
310@@ -44,7 +48,7 @@
311 *default_charset= 0, *current_host= 0;
312 static char *opt_plugin_dir= 0, *opt_default_auth= 0;
313 static int first_error = 0;
314-DYNAMIC_ARRAY tables4repair, tables4rebuild;
315+DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
316 #ifdef HAVE_SMEM
317 static char *shared_memory_base_name=0;
318 #endif
319@@ -591,6 +595,17 @@
320 } /* process_all_tables_in_db */
321
322
323+static int run_query(const char *query)
324+{
325+ if (mysql_query(sock, query))
326+ {
327+ fprintf(stderr, "Failed to %s\n", query);
328+ fprintf(stderr, "Error: %s\n", mysql_error(sock));
329+ return 1;
330+ }
331+ return 0;
332+}
333+
334
335 static int fix_table_storage_name(const char *name)
336 {
337@@ -599,12 +614,7 @@
338 if (strncmp(name, "#mysql50#", 9))
339 return 1;
340 sprintf(qbuf, "RENAME TABLE `%s` TO `%s`", name, name + 9);
341- if (mysql_query(sock, qbuf))
342- {
343- fprintf(stderr, "Failed to %s\n", qbuf);
344- fprintf(stderr, "Error: %s\n", mysql_error(sock));
345- rc= 1;
346- }
347+ rc= run_query(qbuf);
348 if (verbose)
349 printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
350 return rc;
351@@ -617,12 +627,7 @@
352 if (strncmp(name, "#mysql50#", 9))
353 return 1;
354 sprintf(qbuf, "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY NAME", name);
355- if (mysql_query(sock, qbuf))
356- {
357- fprintf(stderr, "Failed to %s\n", qbuf);
358- fprintf(stderr, "Error: %s\n", mysql_error(sock));
359- rc= 1;
360- }
361+ rc= run_query(qbuf);
362 if (verbose)
363 printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
364 return rc;
365@@ -685,13 +690,7 @@
366 static int disable_binlog()
367 {
368 const char *stmt= "SET SQL_LOG_BIN=0";
369- if (mysql_query(sock, stmt))
370- {
371- fprintf(stderr, "Failed to %s\n", stmt);
372- fprintf(stderr, "Error: %s\n", mysql_error(sock));
373- return 1;
374- }
375- return 0;
376+ return run_query(stmt);
377 }
378
379 static int handle_request_for_tables(char *tables, uint length)
380@@ -761,12 +760,14 @@
381 MYSQL_RES *res;
382 MYSQL_ROW row;
383 char prev[NAME_LEN*2+2];
384+ char prev_alter[MAX_ALTER_STR_SIZE];
385 uint i;
386 my_bool found_error=0, table_rebuild=0;
387
388 res = mysql_use_result(sock);
389
390 prev[0] = '\0';
391+ prev_alter[0]= 0;
392 for (i = 0; (row = mysql_fetch_row(res)); i++)
393 {
394 int changed = strcmp(prev, row[0]);
395@@ -783,12 +784,18 @@
396 strcmp(row[3],"OK"))
397 {
398 if (table_rebuild)
399- insert_dynamic(&tables4rebuild, (uchar*) prev);
400+ {
401+ if (prev_alter[0])
402+ insert_dynamic(&alter_table_cmds, (uchar*) prev_alter);
403+ else
404+ insert_dynamic(&tables4rebuild, (uchar*) prev);
405+ }
406 else
407 insert_dynamic(&tables4repair, (uchar*) prev);
408 }
409 found_error=0;
410 table_rebuild=0;
411+ prev_alter[0]= 0;
412 if (opt_silent)
413 continue;
414 }
415@@ -797,11 +804,30 @@
416 else if (!status && changed)
417 {
418 printf("%s\n%-9s: %s", row[0], row[2], row[3]);
419- if (strcmp(row[2],"note"))
420+ if (opt_auto_repair && strcmp(row[2],"note"))
421 {
422- found_error=1;
423- if (opt_auto_repair && strstr(row[3], "ALTER TABLE") != NULL)
424+ const char *alter_txt= strstr(row[3], "ALTER TABLE");
425+ found_error=1;
426+ if (alter_txt)
427+ {
428 table_rebuild=1;
429+ if (!strncmp(row[3], KEY_PARTITIONING_CHANGED_STR,
430+ strlen(KEY_PARTITIONING_CHANGED_STR)) &&
431+ strstr(alter_txt, "PARTITION BY"))
432+ {
433+ if (strlen(alter_txt) >= MAX_ALTER_STR_SIZE)
434+ {
435+ printf("Error: Alter command too long (>= %d),"
436+ " please do \"%s\" or dump/reload to fix it!\n",
437+ MAX_ALTER_STR_SIZE,
438+ alter_txt);
439+ table_rebuild= 0;
440+ prev_alter[0]= 0;
441+ }
442+ else
443+ strcpy(prev_alter, alter_txt);
444+ }
445+ }
446 }
447 }
448 else
449@@ -813,7 +839,12 @@
450 if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
451 {
452 if (table_rebuild)
453- insert_dynamic(&tables4rebuild, (uchar*) prev);
454+ {
455+ if (prev_alter[0])
456+ insert_dynamic(&alter_table_cmds, (uchar*) prev_alter);
457+ else
458+ insert_dynamic(&tables4rebuild, (uchar*) prev);
459+ }
460 else
461 insert_dynamic(&tables4repair, (uchar*) prev);
462 }
463@@ -915,7 +946,8 @@
464
465 if (opt_auto_repair &&
466 (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64) ||
467- my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64)))
468+ my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64) ||
469+ my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0, 1)))
470 {
471 first_error = 1;
472 goto end;
473@@ -943,6 +975,8 @@
474 }
475 for (i = 0; i < tables4rebuild.elements ; i++)
476 rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
477+ for (i = 0; i < alter_table_cmds.elements ; i++)
478+ run_query((char*) dynamic_array_ptr(&alter_table_cmds, i));
479 }
480 end:
481 dbDisconnect(current_host);
482
483=== modified file 'Percona-Server/client/mysqldump.c'
484--- Percona-Server/client/mysqldump.c 2013-04-09 21:37:02 +0000
485+++ Percona-Server/client/mysqldump.c 2013-05-15 05:12:25 +0000
486@@ -1,5 +1,5 @@
487 /*
488- Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
489+ Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
490
491 This program is free software; you can redistribute it and/or modify
492 it under the terms of the GNU General Public License as published by
493
494=== modified file 'Percona-Server/client/sql_string.cc'
495--- Percona-Server/client/sql_string.cc 2012-10-10 20:32:32 +0000
496+++ Percona-Server/client/sql_string.cc 2013-05-15 05:12:25 +0000
497@@ -1,5 +1,5 @@
498 /*
499- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
500+ Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
501
502 This program is free software; you can redistribute it and/or modify
503 it under the terms of the GNU General Public License as published by
504@@ -735,7 +735,7 @@
505 {
506 if (from->Alloced_length >= from_length)
507 return from;
508- if (from->alloced || !to || from == to)
509+ if ((from->alloced && (from->Alloced_length != 0)) || !to || from == to)
510 {
511 (void) from->realloc(from_length);
512 return from;
513
514=== modified file 'Percona-Server/cmake/configure.pl'
515--- Percona-Server/cmake/configure.pl 2012-09-07 08:12:32 +0000
516+++ Percona-Server/cmake/configure.pl 2013-05-15 05:12:25 +0000
517@@ -1,6 +1,6 @@
518 #!/usr/bin/perl
519
520-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
521+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
522 #
523 # This program is free software; you can redistribute it and/or modify
524 # it under the terms of the GNU General Public License as published by
525
526=== modified file 'Percona-Server/cmake/create_initial_db.cmake.in'
527--- Percona-Server/cmake/create_initial_db.cmake.in 2012-10-03 14:05:07 +0000
528+++ Percona-Server/cmake/create_initial_db.cmake.in 2013-05-15 05:12:25 +0000
529@@ -1,4 +1,4 @@
530-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
531+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
532 #
533 # This program is free software; you can redistribute it and/or modify
534 # it under the terms of the GNU General Public License as published by
535
536=== modified file 'Percona-Server/cmake/make_dist.cmake.in'
537--- Percona-Server/cmake/make_dist.cmake.in 2012-03-22 15:16:11 +0000
538+++ Percona-Server/cmake/make_dist.cmake.in 2013-05-15 05:12:25 +0000
539@@ -1,4 +1,4 @@
540-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
541+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
542 #
543 # This program is free software; you can redistribute it and/or modify
544 # it under the terms of the GNU General Public License as published by
545
546=== modified file 'Percona-Server/cmake/mysql_version.cmake'
547--- Percona-Server/cmake/mysql_version.cmake 2012-10-23 11:41:34 +0000
548+++ Percona-Server/cmake/mysql_version.cmake 2013-05-15 05:12:25 +0000
549@@ -1,4 +1,4 @@
550-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
551+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
552 #
553 # This program is free software; you can redistribute it and/or modify
554 # it under the terms of the GNU General Public License as published by
555
556=== modified file 'Percona-Server/cmake/package_name.cmake'
557--- Percona-Server/cmake/package_name.cmake 2012-10-23 11:41:34 +0000
558+++ Percona-Server/cmake/package_name.cmake 2013-05-15 05:12:25 +0000
559@@ -1,4 +1,4 @@
560-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
561+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
562 #
563 # This program is free software; you can redistribute it and/or modify
564 # it under the terms of the GNU General Public License as published by
565
566=== modified file 'Percona-Server/cmake/plugin.cmake'
567--- Percona-Server/cmake/plugin.cmake 2012-10-24 15:06:43 +0000
568+++ Percona-Server/cmake/plugin.cmake 2013-05-15 05:12:25 +0000
569@@ -1,4 +1,4 @@
570-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
571+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
572 #
573 # This program is free software; you can redistribute it and/or modify
574 # it under the terms of the GNU General Public License as published by
575
576=== modified file 'Percona-Server/cmake/ssl.cmake'
577--- Percona-Server/cmake/ssl.cmake 2012-07-24 13:15:58 +0000
578+++ Percona-Server/cmake/ssl.cmake 2013-05-15 05:12:25 +0000
579@@ -1,4 +1,4 @@
580-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
581+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
582 #
583 # This program is free software; you can redistribute it and/or modify
584 # it under the terms of the GNU General Public License as published by
585
586=== modified file 'Percona-Server/cmake/zlib.cmake'
587--- Percona-Server/cmake/zlib.cmake 2011-06-30 15:46:53 +0000
588+++ Percona-Server/cmake/zlib.cmake 2013-05-15 05:12:25 +0000
589@@ -57,13 +57,17 @@
590 INCLUDE(CheckFunctionExists)
591 SET(CMAKE_REQUIRED_LIBRARIES z)
592 CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32)
593+ CHECK_FUNCTION_EXISTS(compressBound HAVE_COMPRESSBOUND)
594+ CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND)
595 SET(CMAKE_REQUIRED_LIBRARIES)
596- IF(HAVE_CRC32)
597+ IF(HAVE_CRC32 AND HAVE_COMPRESSBOUND AND HAVE_DEFLATEBOUND)
598 SET(ZLIB_LIBRARY z CACHE INTERNAL "System zlib library")
599- SET(WITH_ZLIB "system" CACHE STRING "Which zlib to use (possible values are 'bundled' or 'system')")
600+ SET(WITH_ZLIB "system" CACHE STRING
601+ "Which zlib to use (possible values are 'bundled' or 'system')")
602 SET(ZLIB_SOURCES "")
603 ELSE()
604 SET(ZLIB_FOUND FALSE CACHE INTERNAL "Zlib found but not usable")
605+ MESSAGE(STATUS "system zlib found but not usable")
606 ENDIF()
607 ENDIF()
608 IF(NOT ZLIB_FOUND)
609
610=== modified file 'Percona-Server/configure.cmake'
611--- Percona-Server/configure.cmake 2013-02-06 07:02:45 +0000
612+++ Percona-Server/configure.cmake 2013-05-15 05:12:25 +0000
613@@ -1,5 +1,5 @@
614
615-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
616+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
617 #
618 # This program is free software; you can redistribute it and/or modify
619 # it under the terms of the GNU General Public License as published by
620
621=== modified file 'Percona-Server/extra/charset2html.c'
622--- Percona-Server/extra/charset2html.c 2008-03-29 14:15:06 +0000
623+++ Percona-Server/extra/charset2html.c 2013-05-15 05:12:25 +0000
624@@ -1,4 +1,5 @@
625-/* Copyright (C) 2000 MySQL AB
626+/* Copyright (c) 2000, 2002-2004, 2007, 2008 MySQL AB
627+ Use is subject to license terms
628
629 This program is free software; you can redistribute it and/or modify
630 it under the terms of the GNU General Public License as published by
631
632=== modified file 'Percona-Server/extra/yassl/CMakeLists.txt'
633--- Percona-Server/extra/yassl/CMakeLists.txt 2012-02-13 12:44:54 +0000
634+++ Percona-Server/extra/yassl/CMakeLists.txt 2013-05-15 05:12:25 +0000
635@@ -1,4 +1,4 @@
636-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
637+# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
638 #
639 # This program is free software; you can redistribute it and/or modify
640 # it under the terms of the GNU General Public License as published by
641
642=== modified file 'Percona-Server/extra/yassl/examples/client/client.cpp'
643--- Percona-Server/extra/yassl/examples/client/client.cpp 2012-02-10 14:33:27 +0000
644+++ Percona-Server/extra/yassl/examples/client/client.cpp 2013-05-15 05:12:25 +0000
645@@ -1,5 +1,5 @@
646 /*
647- Copyright (C) 2006 MySQL AB
648+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
649
650 This program is free software; you can redistribute it and/or modify
651 it under the terms of the GNU General Public License as published by
652
653=== modified file 'Percona-Server/extra/yassl/examples/echoclient/echoclient.cpp'
654--- Percona-Server/extra/yassl/examples/echoclient/echoclient.cpp 2012-02-10 14:33:27 +0000
655+++ Percona-Server/extra/yassl/examples/echoclient/echoclient.cpp 2013-05-15 05:12:25 +0000
656@@ -1,5 +1,5 @@
657 /*
658- Copyright (C) 2006 MySQL AB
659+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
660
661 This program is free software; you can redistribute it and/or modify
662 it under the terms of the GNU General Public License as published by
663
664=== modified file 'Percona-Server/extra/yassl/examples/echoserver/echoserver.cpp'
665--- Percona-Server/extra/yassl/examples/echoserver/echoserver.cpp 2012-02-10 14:33:27 +0000
666+++ Percona-Server/extra/yassl/examples/echoserver/echoserver.cpp 2013-05-15 05:12:25 +0000
667@@ -1,5 +1,5 @@
668 /*
669- Copyright (C) 2006 MySQL AB
670+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
671
672 This program is free software; you can redistribute it and/or modify
673 it under the terms of the GNU General Public License as published by
674
675=== modified file 'Percona-Server/extra/yassl/examples/server/server.cpp'
676--- Percona-Server/extra/yassl/examples/server/server.cpp 2012-02-10 14:33:27 +0000
677+++ Percona-Server/extra/yassl/examples/server/server.cpp 2013-05-15 05:12:25 +0000
678@@ -1,5 +1,5 @@
679 /*
680- Copyright (C) 2006 MySQL AB
681+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
682
683 This program is free software; you can redistribute it and/or modify
684 it under the terms of the GNU General Public License as published by
685
686=== modified file 'Percona-Server/extra/yassl/include/buffer.hpp'
687--- Percona-Server/extra/yassl/include/buffer.hpp 2012-02-13 11:40:12 +0000
688+++ Percona-Server/extra/yassl/include/buffer.hpp 2013-05-15 05:12:25 +0000
689@@ -1,5 +1,5 @@
690 /*
691- Copyright (C) 2000-2007 MySQL AB
692+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
693
694 This program is free software; you can redistribute it and/or modify
695 it under the terms of the GNU General Public License as published by
696
697=== modified file 'Percona-Server/extra/yassl/include/cert_wrapper.hpp'
698--- Percona-Server/extra/yassl/include/cert_wrapper.hpp 2012-02-10 09:41:54 +0000
699+++ Percona-Server/extra/yassl/include/cert_wrapper.hpp 2013-05-15 05:12:25 +0000
700@@ -1,6 +1,5 @@
701 /*
702- Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
703- Use is subject to license terms.
704+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
705
706 This program is free software; you can redistribute it and/or modify
707 it under the terms of the GNU General Public License as published by
708
709=== modified file 'Percona-Server/extra/yassl/include/lock.hpp'
710--- Percona-Server/extra/yassl/include/lock.hpp 2012-11-21 13:44:15 +0000
711+++ Percona-Server/extra/yassl/include/lock.hpp 2013-05-15 05:12:25 +0000
712@@ -1,5 +1,5 @@
713 /*
714- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
715+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
716
717 This program is free software; you can redistribute it and/or modify
718 it under the terms of the GNU General Public License as published by
719
720=== modified file 'Percona-Server/extra/yassl/include/openssl/prefix_ssl.h'
721--- Percona-Server/extra/yassl/include/openssl/prefix_ssl.h 2012-02-10 09:39:51 +0000
722+++ Percona-Server/extra/yassl/include/openssl/prefix_ssl.h 2013-05-15 05:12:25 +0000
723@@ -1,6 +1,5 @@
724 /*
725- Copyright (c) 2006, 2007 MySQL AB, 2008 Sun Microsystems, Inc.
726- Use is subject to license terms.
727+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
728
729 This program is free software; you can redistribute it and/or modify
730 it under the terms of the GNU General Public License as published by
731
732=== modified file 'Percona-Server/extra/yassl/include/socket_wrapper.hpp'
733--- Percona-Server/extra/yassl/include/socket_wrapper.hpp 2012-02-13 11:40:12 +0000
734+++ Percona-Server/extra/yassl/include/socket_wrapper.hpp 2013-05-15 05:12:25 +0000
735@@ -1,5 +1,5 @@
736 /*
737- Copyright (C) 2000-2007 MySQL AB
738+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
739
740 This program is free software; you can redistribute it and/or modify
741 it under the terms of the GNU General Public License as published by
742
743=== modified file 'Percona-Server/extra/yassl/include/yassl_error.hpp'
744--- Percona-Server/extra/yassl/include/yassl_error.hpp 2012-11-21 13:44:15 +0000
745+++ Percona-Server/extra/yassl/include/yassl_error.hpp 2013-05-15 05:12:25 +0000
746@@ -1,6 +1,5 @@
747 /*
748- Copyright (c) 2005-2007 MySQL AB, 2010 Sun Microsystems, Inc.
749- Use is subject to license terms.
750+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
751
752 This program is free software; you can redistribute it and/or modify
753 it under the terms of the GNU General Public License as published by
754@@ -53,7 +52,8 @@
755 badVersion_error = 117,
756 compress_error = 118,
757 decompress_error = 119,
758- pms_version_error = 120
759+ pms_version_error = 120,
760+ sanityCipher_error = 121
761
762 // !!!! add error message to .cpp !!!!
763
764
765=== modified file 'Percona-Server/extra/yassl/include/yassl_imp.hpp'
766--- Percona-Server/extra/yassl/include/yassl_imp.hpp 2012-02-10 09:41:54 +0000
767+++ Percona-Server/extra/yassl/include/yassl_imp.hpp 2013-05-15 05:12:25 +0000
768@@ -1,6 +1,5 @@
769 /*
770- Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
771- Use is subject to license terms.
772+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
773
774 This program is free software; you can redistribute it and/or modify
775 it under the terms of the GNU General Public License as published by
776
777=== modified file 'Percona-Server/extra/yassl/include/yassl_int.hpp'
778--- Percona-Server/extra/yassl/include/yassl_int.hpp 2012-02-13 12:44:54 +0000
779+++ Percona-Server/extra/yassl/include/yassl_int.hpp 2013-05-15 05:12:25 +0000
780@@ -1,5 +1,5 @@
781 /*
782- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
783+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
784
785 This program is free software; you can redistribute it and/or modify
786 it under the terms of the GNU General Public License as published by
787
788=== modified file 'Percona-Server/extra/yassl/include/yassl_types.hpp'
789--- Percona-Server/extra/yassl/include/yassl_types.hpp 2012-02-13 12:44:54 +0000
790+++ Percona-Server/extra/yassl/include/yassl_types.hpp 2013-05-15 05:12:25 +0000
791@@ -1,6 +1,5 @@
792 /*
793- Copyright (c) 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc.
794- Use is subject to license terms.
795+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
796
797 This program is free software; you can redistribute it and/or modify
798 it under the terms of the GNU General Public License as published by
799@@ -220,7 +219,11 @@
800 const int MAX_RECORD_SIZE = 16384; // 2^14, max size by standard
801 const int COMPRESS_EXTRA = 1024; // extra compression possible addition
802 const int SESSION_FLUSH_COUNT = 256; // when to flush session cache
803-
804+const int MAX_PAD_SIZE = 256; // max TLS padding size
805+const int COMPRESS_CONSTANT = 13; // compression calculation constant
806+const int COMPRESS_UPPER = 55; // compression calculation numerator
807+const int COMPRESS_LOWER = 64; // compression calculation denominator
808+const int COMPRESS_DUMMY_SIZE = 64; // compression dummy round size
809
810 typedef uint8 Cipher; // first byte is always 0x00 for SSLv3 & TLS
811
812
813=== modified file 'Percona-Server/extra/yassl/src/buffer.cpp'
814--- Percona-Server/extra/yassl/src/buffer.cpp 2012-02-13 12:44:54 +0000
815+++ Percona-Server/extra/yassl/src/buffer.cpp 2013-05-15 05:12:25 +0000
816@@ -1,6 +1,5 @@
817 /*
818- Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
819- Use is subject to license terms.
820+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
821
822 This program is free software; you can redistribute it and/or modify
823 it under the terms of the GNU General Public License as published by
824
825=== modified file 'Percona-Server/extra/yassl/src/cert_wrapper.cpp'
826--- Percona-Server/extra/yassl/src/cert_wrapper.cpp 2012-11-21 13:44:15 +0000
827+++ Percona-Server/extra/yassl/src/cert_wrapper.cpp 2013-05-15 05:12:25 +0000
828@@ -1,6 +1,5 @@
829 /*
830- Copyright (c) 2005-2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
831- Use is subject to license terms.
832+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
833
834 This program is free software; you can redistribute it and/or modify
835 it under the terms of the GNU General Public License as published by
836
837=== modified file 'Percona-Server/extra/yassl/src/crypto_wrapper.cpp'
838--- Percona-Server/extra/yassl/src/crypto_wrapper.cpp 2012-02-13 12:44:54 +0000
839+++ Percona-Server/extra/yassl/src/crypto_wrapper.cpp 2013-05-15 05:12:25 +0000
840@@ -1,5 +1,5 @@
841 /*
842- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
843+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
844
845 This program is free software; you can redistribute it and/or modify
846 it under the terms of the GNU General Public License as published by
847
848=== modified file 'Percona-Server/extra/yassl/src/handshake.cpp'
849--- Percona-Server/extra/yassl/src/handshake.cpp 2012-12-13 04:49:14 +0000
850+++ Percona-Server/extra/yassl/src/handshake.cpp 2013-05-15 05:12:25 +0000
851@@ -1,6 +1,5 @@
852 /*
853- Copyright (c) 2005-2008 MySQL AB, 2009 Sun Microsystems, Inc.
854- Use is subject to license terms.
855+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
856
857 This program is free software; you can redistribute it and/or modify
858 it under the terms of the GNU General Public License as published by
859@@ -221,12 +220,45 @@
860 }
861
862
863+// sanity checks on encrypted message size
864+static int sanity_check_message(SSL& ssl, uint msgSz)
865+{
866+ uint minSz = 0;
867+
868+ if (ssl.getSecurity().get_parms().cipher_type_ == block) {
869+ uint blockSz = ssl.getCrypto().get_cipher().get_blockSize();
870+ if (msgSz % blockSz)
871+ return -1;
872+
873+ minSz = ssl.getSecurity().get_parms().hash_size_ + 1; // pad byte too
874+ if (blockSz > minSz)
875+ minSz = blockSz;
876+
877+ if (ssl.isTLSv1_1())
878+ minSz += blockSz; // explicit IV
879+ }
880+ else { // stream
881+ minSz = ssl.getSecurity().get_parms().hash_size_;
882+ }
883+
884+ if (msgSz < minSz)
885+ return -1;
886+
887+ return 0;
888+}
889+
890+
891 // decrypt input message in place, store size in case needed later
892 void decrypt_message(SSL& ssl, input_buffer& input, uint sz)
893 {
894 input_buffer plain(sz);
895 opaque* cipher = input.get_buffer() + input.get_current();
896
897+ if (sanity_check_message(ssl, sz) != 0) {
898+ ssl.SetError(sanityCipher_error);
899+ return;
900+ }
901+
902 ssl.useCrypto().use_cipher().decrypt(plain.get_buffer(), cipher, sz);
903 memcpy(cipher, plain.get_buffer(), sz);
904 ssl.useSecurity().use_parms().encrypt_size_ = sz;
905@@ -774,6 +806,8 @@
906 return 0;
907 }
908 decrypt_message(ssl, buffer, hdr.length_);
909+ if (ssl.GetError())
910+ return 0;
911 }
912
913 mySTL::auto_ptr<Message> msg(mf.CreateObject(hdr.type_));
914
915=== modified file 'Percona-Server/extra/yassl/src/lock.cpp'
916--- Percona-Server/extra/yassl/src/lock.cpp 2012-11-21 13:44:15 +0000
917+++ Percona-Server/extra/yassl/src/lock.cpp 2013-05-15 05:12:25 +0000
918@@ -1,5 +1,5 @@
919 /*
920- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
921+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
922
923 This program is free software; you can redistribute it and/or modify
924 it under the terms of the GNU General Public License as published by
925
926=== modified file 'Percona-Server/extra/yassl/src/make.bat'
927--- Percona-Server/extra/yassl/src/make.bat 2012-02-10 14:33:27 +0000
928+++ Percona-Server/extra/yassl/src/make.bat 2013-05-15 05:12:25 +0000
929@@ -1,4 +1,4 @@
930-REM Copyright (C) 2006, 2007 MySQL AB
931+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
932 REM
933 REM This program is free software; you can redistribute it and/or modify
934 REM it under the terms of the GNU General Public License as published by
935
936=== modified file 'Percona-Server/extra/yassl/src/socket_wrapper.cpp'
937--- Percona-Server/extra/yassl/src/socket_wrapper.cpp 2012-02-13 12:44:54 +0000
938+++ Percona-Server/extra/yassl/src/socket_wrapper.cpp 2013-05-15 05:12:25 +0000
939@@ -1,5 +1,5 @@
940 /*
941- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
942+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
943
944 This program is free software; you can redistribute it and/or modify
945 it under the terms of the GNU General Public License as published by
946
947=== modified file 'Percona-Server/extra/yassl/src/ssl.cpp'
948--- Percona-Server/extra/yassl/src/ssl.cpp 2012-11-21 13:44:15 +0000
949+++ Percona-Server/extra/yassl/src/ssl.cpp 2013-05-15 05:12:25 +0000
950@@ -1,6 +1,5 @@
951 /*
952- Copyright (c) 2005-2007 MySQL AB, 2008-2010 Sun Microsystems, Inc.
953- Use is subject to license terms.
954+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
955
956 This program is free software; you can redistribute it and/or modify
957 it under the terms of the GNU General Public License as published by
958
959=== modified file 'Percona-Server/extra/yassl/src/template_instnt.cpp'
960--- Percona-Server/extra/yassl/src/template_instnt.cpp 2009-05-15 12:57:51 +0000
961+++ Percona-Server/extra/yassl/src/template_instnt.cpp 2013-05-15 05:12:25 +0000
962@@ -1,5 +1,6 @@
963 /*
964- Copyright (C) 2000-2007 MySQL AB
965+ Copyright (c) 2000-2008 MySQL AB
966+ Use is subject to license terms
967
968 This program is free software; you can redistribute it and/or modify
969 it under the terms of the GNU General Public License as published by
970
971=== modified file 'Percona-Server/extra/yassl/src/yassl.cpp'
972--- Percona-Server/extra/yassl/src/yassl.cpp 2012-02-10 14:33:27 +0000
973+++ Percona-Server/extra/yassl/src/yassl.cpp 2013-05-15 05:12:25 +0000
974@@ -1,5 +1,5 @@
975 /*
976- Copyright (C) 2000-2007 MySQL AB
977+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
978
979 This program is free software; you can redistribute it and/or modify
980 it under the terms of the GNU General Public License as published by
981
982=== modified file 'Percona-Server/extra/yassl/src/yassl_error.cpp'
983--- Percona-Server/extra/yassl/src/yassl_error.cpp 2012-11-21 13:44:15 +0000
984+++ Percona-Server/extra/yassl/src/yassl_error.cpp 2013-05-15 05:12:25 +0000
985@@ -1,5 +1,5 @@
986 /*
987- Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
988+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
989
990 This program is free software; you can redistribute it and/or modify
991 it under the terms of the GNU General Public License as published by
992@@ -144,6 +144,10 @@
993 strncpy(buffer, "bad PreMasterSecret version error", max);
994 break;
995
996+ case sanityCipher_error :
997+ strncpy(buffer, "sanity check on cipher text size error", max);
998+ break;
999+
1000 // openssl errors
1001 case SSL_ERROR_WANT_READ :
1002 strncpy(buffer, "the read operation would block", max);
1003
1004=== modified file 'Percona-Server/extra/yassl/src/yassl_imp.cpp'
1005--- Percona-Server/extra/yassl/src/yassl_imp.cpp 2012-03-02 12:23:52 +0000
1006+++ Percona-Server/extra/yassl/src/yassl_imp.cpp 2013-05-15 05:12:25 +0000
1007@@ -972,30 +972,193 @@
1008 }
1009
1010
1011+// check all bytes for equality
1012+static int constant_compare(const byte* a, const byte* b, int len)
1013+{
1014+ int good = 0;
1015+ int bad = 0;
1016+
1017+ for (int i = 0; i < len; i++) {
1018+ if (a[i] == b[i])
1019+ good++;
1020+ else
1021+ bad++;
1022+ }
1023+
1024+ if (good == len)
1025+ return 0;
1026+ else
1027+ return 0 - bad; // failure
1028+}
1029+
1030+
1031+// check bytes for pad value
1032+static int pad_check(const byte* input, byte pad, int len)
1033+{
1034+ int good = 0;
1035+ int bad = 0;
1036+
1037+ for (int i = 0; i < len; i++) {
1038+ if (input[i] == pad)
1039+ good++;
1040+ else
1041+ bad++;
1042+ }
1043+
1044+ if (good == len)
1045+ return 0;
1046+ else
1047+ return 0 - bad; // failure
1048+}
1049+
1050+
1051+// get number of compression rounds
1052+static inline int get_rounds(int pLen, int padLen, int t)
1053+{
1054+ int roundL1 = 1; // round ups
1055+ int roundL2 = 1;
1056+
1057+ int L1 = COMPRESS_CONSTANT + pLen - t;
1058+ int L2 = COMPRESS_CONSTANT + pLen - padLen - 1 - t;
1059+
1060+ L1 -= COMPRESS_UPPER;
1061+ L2 -= COMPRESS_UPPER;
1062+
1063+ if ( (L1 % COMPRESS_LOWER) == 0)
1064+ roundL1 = 0;
1065+ if ( (L2 % COMPRESS_LOWER) == 0)
1066+ roundL2 = 0;
1067+
1068+ L1 /= COMPRESS_LOWER;
1069+ L2 /= COMPRESS_LOWER;
1070+
1071+ L1 += roundL1;
1072+ L2 += roundL2;
1073+
1074+ return L1 - L2;
1075+}
1076+
1077+
1078+// do compression rounds on dummy data
1079+static inline void compress_rounds(SSL& ssl, int rounds, const byte* dummy)
1080+{
1081+ if (rounds) {
1082+ Digest* digest = NULL;
1083+
1084+ MACAlgorithm ma = ssl.getSecurity().get_parms().mac_algorithm_;
1085+ if (ma == sha)
1086+ digest = NEW_YS SHA;
1087+ else if (ma == md5)
1088+ digest = NEW_YS MD5;
1089+ else if (ma == rmd)
1090+ digest = NEW_YS RMD;
1091+ else
1092+ return;
1093+
1094+ for (int i = 0; i < rounds; i++)
1095+ digest->update(dummy, COMPRESS_LOWER);
1096+
1097+ ysDelete(digest);
1098+ }
1099+}
1100+
1101+
1102+// timing resistant pad verification
1103+static int timing_verify(SSL& ssl, const byte* input, int padLen, int t,
1104+ int pLen)
1105+{
1106+ byte verify[SHA_LEN];
1107+ byte dummy[MAX_PAD_SIZE];
1108+
1109+ memset(dummy, 1, sizeof(dummy));
1110+
1111+ if ( (t + padLen + 1) > pLen) {
1112+ pad_check(dummy, (byte)padLen, MAX_PAD_SIZE);
1113+ if (ssl.isTLS())
1114+ TLS_hmac(ssl, verify, input, pLen - t, application_data, 1);
1115+ else
1116+ hmac(ssl, verify, input, pLen - t, application_data, 1);
1117+ constant_compare(verify, input + pLen - t, t);
1118+
1119+ return -1;
1120+ }
1121+
1122+ if (pad_check(input + pLen - (padLen + 1), (byte)padLen, padLen + 1) != 0) {
1123+ pad_check(dummy, (byte)padLen, MAX_PAD_SIZE - padLen - 1);
1124+ if (ssl.isTLS())
1125+ TLS_hmac(ssl, verify, input, pLen - t, application_data, 1);
1126+ else
1127+ hmac(ssl, verify, input, pLen - t, application_data, 1);
1128+ constant_compare(verify, input + pLen - t, t);
1129+
1130+ return -1;
1131+ }
1132+
1133+ pad_check(dummy, (byte)padLen, MAX_PAD_SIZE - padLen - 1);
1134+ if (ssl.isTLS())
1135+ TLS_hmac(ssl, verify, input, pLen - padLen - 1 - t, application_data,1);
1136+ else
1137+ hmac(ssl, verify, input, pLen - padLen - 1 - t, application_data, 1);
1138+
1139+ compress_rounds(ssl, get_rounds(pLen, padLen, t), dummy);
1140+
1141+ if (constant_compare(verify, input + (pLen - padLen - 1 - t), t) != 0)
1142+ return -1;
1143+
1144+ return 0;
1145+}
1146+
1147+
1148 // Process handler for Data
1149 void Data::Process(input_buffer& input, SSL& ssl)
1150 {
1151 int msgSz = ssl.getSecurity().get_parms().encrypt_size_;
1152 int pad = 0, padSz = 0;
1153 int ivExtra = 0;
1154+ int digestSz = ssl.getCrypto().get_digest().get_digestSize();
1155+ const byte* rawData = input.get_buffer() + input.get_current();
1156+ opaque verify[SHA_LEN];
1157
1158 if (ssl.getSecurity().get_parms().cipher_type_ == block) {
1159 if (ssl.isTLSv1_1()) // IV
1160 ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
1161 pad = *(input.get_buffer() + input.get_current() + msgSz -ivExtra - 1);
1162 padSz = 1;
1163- }
1164- int digestSz = ssl.getCrypto().get_digest().get_digestSize();
1165+
1166+ if (ssl.isTLS()) {
1167+ if (timing_verify(ssl, rawData, pad,digestSz, msgSz-ivExtra) != 0) {
1168+ ssl.SetError(verify_error);
1169+ return;
1170+ }
1171+ }
1172+ else { // SSLv3, some don't do this padding right
1173+ int sz3 = msgSz - digestSz - pad - 1;
1174+ hmac(ssl, verify, rawData, sz3, application_data, true);
1175+ if (constant_compare(verify, rawData + sz3, digestSz) != 0) {
1176+ ssl.SetError(verify_error);
1177+ return;
1178+ }
1179+ }
1180+ }
1181+ else { // stream
1182+ int streamSz = msgSz - digestSz;
1183+ if (ssl.isTLS())
1184+ TLS_hmac(ssl, verify, rawData, streamSz, application_data, true);
1185+ else
1186+ hmac(ssl, verify, rawData, streamSz, application_data, true);
1187+ if (constant_compare(verify, rawData + streamSz, digestSz) != 0) {
1188+ ssl.SetError(verify_error);
1189+ return;
1190+ }
1191+ }
1192+
1193 int dataSz = msgSz - ivExtra - digestSz - pad - padSz;
1194- opaque verify[SHA_LEN];
1195
1196 if (dataSz < 0) {
1197 ssl.SetError(bad_input);
1198 return;
1199 }
1200
1201- const byte* rawData = input.get_buffer() + input.get_current();
1202-
1203 // read data
1204 if (dataSz) { // could be compressed
1205 if (ssl.CompressionOn()) {
1206@@ -1013,27 +1176,10 @@
1207 input.read(data->get_buffer(), dataSz);
1208 data->add_size(dataSz);
1209 }
1210-
1211- if (ssl.isTLS())
1212- TLS_hmac(ssl, verify, rawData, dataSz, application_data, true);
1213- else
1214- hmac(ssl, verify, rawData, dataSz, application_data, true);
1215- }
1216-
1217- // read mac and skip fill
1218- opaque mac[SHA_LEN];
1219- input.read(mac, digestSz);
1220- input.set_current(input.get_current() + pad + padSz);
1221-
1222- // verify
1223- if (dataSz) {
1224- if (memcmp(mac, verify, digestSz)) {
1225- ssl.SetError(verify_error);
1226- return;
1227- }
1228- }
1229- else
1230- ssl.get_SEQIncrement(true); // even though no data, increment verify
1231+ }
1232+
1233+ // advance past mac and fill
1234+ input.set_current(input.get_current() + digestSz + pad + padSz);
1235 }
1236
1237
1238
1239=== modified file 'Percona-Server/extra/yassl/taocrypt/benchmark/benchmark.cpp'
1240--- Percona-Server/extra/yassl/taocrypt/benchmark/benchmark.cpp 2012-02-10 14:33:27 +0000
1241+++ Percona-Server/extra/yassl/taocrypt/benchmark/benchmark.cpp 2013-05-15 05:12:25 +0000
1242@@ -1,5 +1,5 @@
1243 /*
1244- Copyright (C) 2006, 2007 MySQL AB
1245+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1246
1247 This program is free software; you can redistribute it and/or modify
1248 it under the terms of the GNU General Public License as published by
1249
1250=== modified file 'Percona-Server/extra/yassl/taocrypt/benchmark/make.bat'
1251--- Percona-Server/extra/yassl/taocrypt/benchmark/make.bat 2012-02-10 14:33:27 +0000
1252+++ Percona-Server/extra/yassl/taocrypt/benchmark/make.bat 2013-05-15 05:12:25 +0000
1253@@ -1,4 +1,4 @@
1254-REM Copyright (C) 2006, 2007 MySQL AB
1255+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1256 REM
1257 REM This program is free software; you can redistribute it and/or modify
1258 REM it under the terms of the GNU General Public License as published by
1259
1260=== modified file 'Percona-Server/extra/yassl/taocrypt/include/aes.hpp'
1261--- Percona-Server/extra/yassl/taocrypt/include/aes.hpp 2012-11-21 13:44:15 +0000
1262+++ Percona-Server/extra/yassl/taocrypt/include/aes.hpp 2013-05-15 05:12:25 +0000
1263@@ -1,5 +1,5 @@
1264 /*
1265- Copyright (C) 2000-2007 MySQL AB
1266+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1267
1268 This program is free software; you can redistribute it and/or modify
1269 it under the terms of the GNU General Public License as published by
1270
1271=== modified file 'Percona-Server/extra/yassl/taocrypt/include/asn.hpp'
1272--- Percona-Server/extra/yassl/taocrypt/include/asn.hpp 2012-02-13 12:44:54 +0000
1273+++ Percona-Server/extra/yassl/taocrypt/include/asn.hpp 2013-05-15 05:12:25 +0000
1274@@ -1,6 +1,5 @@
1275 /*
1276- Copyright (c) 2005-2007 MySQL AB, 2010 Sun Microsystems, Inc.
1277- Use is subject to license terms.
1278+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1279
1280 This program is free software; you can redistribute it and/or modify
1281 it under the terms of the GNU General Public License as published by
1282
1283=== modified file 'Percona-Server/extra/yassl/taocrypt/include/block.hpp'
1284--- Percona-Server/extra/yassl/taocrypt/include/block.hpp 2012-02-13 12:44:54 +0000
1285+++ Percona-Server/extra/yassl/taocrypt/include/block.hpp 2013-05-15 05:12:25 +0000
1286@@ -1,6 +1,5 @@
1287 /*
1288- Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
1289- Use is subject to license terms.
1290+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1291
1292 This program is free software; you can redistribute it and/or modify
1293 it under the terms of the GNU General Public License as published by
1294
1295=== modified file 'Percona-Server/extra/yassl/taocrypt/include/blowfish.hpp'
1296--- Percona-Server/extra/yassl/taocrypt/include/blowfish.hpp 2012-02-13 12:44:54 +0000
1297+++ Percona-Server/extra/yassl/taocrypt/include/blowfish.hpp 2013-05-15 05:12:25 +0000
1298@@ -1,5 +1,5 @@
1299 /*
1300- Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1301+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1302
1303 This program is free software; you can redistribute it and/or modify
1304 it under the terms of the GNU General Public License as published by
1305
1306=== modified file 'Percona-Server/extra/yassl/taocrypt/include/des.hpp'
1307--- Percona-Server/extra/yassl/taocrypt/include/des.hpp 2012-02-13 11:40:12 +0000
1308+++ Percona-Server/extra/yassl/taocrypt/include/des.hpp 2013-05-15 05:12:25 +0000
1309@@ -1,5 +1,5 @@
1310 /*
1311- Copyright (C) 2000-2007 MySQL AB
1312+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1313
1314 This program is free software; you can redistribute it and/or modify
1315 it under the terms of the GNU General Public License as published by
1316
1317=== modified file 'Percona-Server/extra/yassl/taocrypt/include/hash.hpp'
1318--- Percona-Server/extra/yassl/taocrypt/include/hash.hpp 2012-02-13 11:40:12 +0000
1319+++ Percona-Server/extra/yassl/taocrypt/include/hash.hpp 2013-05-15 05:12:25 +0000
1320@@ -1,5 +1,5 @@
1321 /*
1322- Copyright (C) 2000-2007 MySQL AB
1323+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1324
1325 This program is free software; you can redistribute it and/or modify
1326 it under the terms of the GNU General Public License as published by
1327
1328=== modified file 'Percona-Server/extra/yassl/taocrypt/include/hc128.hpp'
1329--- Percona-Server/extra/yassl/taocrypt/include/hc128.hpp 2012-02-10 14:33:27 +0000
1330+++ Percona-Server/extra/yassl/taocrypt/include/hc128.hpp 2013-05-15 05:12:25 +0000
1331@@ -1,5 +1,5 @@
1332 /*
1333- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1334+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1335
1336 This program is free software; you can redistribute it and/or modify
1337 it under the terms of the GNU General Public License as published by
1338
1339=== modified file 'Percona-Server/extra/yassl/taocrypt/include/integer.hpp'
1340--- Percona-Server/extra/yassl/taocrypt/include/integer.hpp 2012-02-10 14:33:27 +0000
1341+++ Percona-Server/extra/yassl/taocrypt/include/integer.hpp 2013-05-15 05:12:25 +0000
1342@@ -1,5 +1,5 @@
1343 /*
1344- Copyright (C) 2000-2007 MySQL AB
1345+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1346
1347 This program is free software; you can redistribute it and/or modify
1348 it under the terms of the GNU General Public License as published by
1349
1350=== modified file 'Percona-Server/extra/yassl/taocrypt/include/kernelc.hpp'
1351--- Percona-Server/extra/yassl/taocrypt/include/kernelc.hpp 2012-02-10 14:33:27 +0000
1352+++ Percona-Server/extra/yassl/taocrypt/include/kernelc.hpp 2013-05-15 05:12:25 +0000
1353@@ -1,5 +1,5 @@
1354 /*
1355- Copyright (C) 2000-2007 MySQL AB
1356+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1357
1358 This program is free software; you can redistribute it and/or modify
1359 it under the terms of the GNU General Public License as published by
1360
1361=== modified file 'Percona-Server/extra/yassl/taocrypt/include/misc.hpp'
1362--- Percona-Server/extra/yassl/taocrypt/include/misc.hpp 2012-02-13 12:44:54 +0000
1363+++ Percona-Server/extra/yassl/taocrypt/include/misc.hpp 2013-05-15 05:12:25 +0000
1364@@ -1,5 +1,5 @@
1365 /*
1366- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1367+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1368
1369 This program is free software; you can redistribute it and/or modify
1370 it under the terms of the GNU General Public License as published by
1371
1372=== modified file 'Percona-Server/extra/yassl/taocrypt/include/modes.hpp'
1373--- Percona-Server/extra/yassl/taocrypt/include/modes.hpp 2012-02-13 12:44:54 +0000
1374+++ Percona-Server/extra/yassl/taocrypt/include/modes.hpp 2013-05-15 05:12:25 +0000
1375@@ -1,6 +1,5 @@
1376 /*
1377- Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc.
1378- Use is subject to license terms.
1379+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1380
1381 This program is free software; you can redistribute it and/or modify
1382 it under the terms of the GNU General Public License as published by
1383
1384=== modified file 'Percona-Server/extra/yassl/taocrypt/include/pwdbased.hpp'
1385--- Percona-Server/extra/yassl/taocrypt/include/pwdbased.hpp 2012-11-21 13:44:15 +0000
1386+++ Percona-Server/extra/yassl/taocrypt/include/pwdbased.hpp 2013-05-15 05:12:25 +0000
1387@@ -1,5 +1,5 @@
1388 /*
1389- Copyright (C) 2000-2007 MySQL AB
1390+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1391
1392 This program is free software; you can redistribute it and/or modify
1393 it under the terms of the GNU General Public License as published by
1394
1395=== modified file 'Percona-Server/extra/yassl/taocrypt/include/rabbit.hpp'
1396--- Percona-Server/extra/yassl/taocrypt/include/rabbit.hpp 2012-02-10 14:33:27 +0000
1397+++ Percona-Server/extra/yassl/taocrypt/include/rabbit.hpp 2013-05-15 05:12:25 +0000
1398@@ -1,5 +1,5 @@
1399 /*
1400- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1401+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1402
1403 This program is free software; you can redistribute it and/or modify
1404 it under the terms of the GNU General Public License as published by
1405
1406=== modified file 'Percona-Server/extra/yassl/taocrypt/include/rsa.hpp'
1407--- Percona-Server/extra/yassl/taocrypt/include/rsa.hpp 2012-02-13 11:40:12 +0000
1408+++ Percona-Server/extra/yassl/taocrypt/include/rsa.hpp 2013-05-15 05:12:25 +0000
1409@@ -1,5 +1,5 @@
1410 /*
1411- Copyright (C) 2000-2007 MySQL AB
1412+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1413
1414 This program is free software; you can redistribute it and/or modify
1415 it under the terms of the GNU General Public License as published by
1416
1417=== modified file 'Percona-Server/extra/yassl/taocrypt/include/runtime.hpp'
1418--- Percona-Server/extra/yassl/taocrypt/include/runtime.hpp 2012-02-13 12:44:54 +0000
1419+++ Percona-Server/extra/yassl/taocrypt/include/runtime.hpp 2013-05-15 05:12:25 +0000
1420@@ -1,5 +1,5 @@
1421 /*
1422- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1423+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1424
1425 This program is free software; you can redistribute it and/or modify
1426 it under the terms of the GNU General Public License as published by
1427
1428=== modified file 'Percona-Server/extra/yassl/taocrypt/include/types.hpp'
1429--- Percona-Server/extra/yassl/taocrypt/include/types.hpp 2012-02-10 14:33:27 +0000
1430+++ Percona-Server/extra/yassl/taocrypt/include/types.hpp 2013-05-15 05:12:25 +0000
1431@@ -1,5 +1,5 @@
1432 /*
1433- Copyright (C) 2000-2007 MySQL AB
1434+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1435
1436 This program is free software; you can redistribute it and/or modify
1437 it under the terms of the GNU General Public License as published by
1438
1439=== modified file 'Percona-Server/extra/yassl/taocrypt/mySTL/stdexcept.hpp'
1440--- Percona-Server/extra/yassl/taocrypt/mySTL/stdexcept.hpp 2012-02-10 14:33:27 +0000
1441+++ Percona-Server/extra/yassl/taocrypt/mySTL/stdexcept.hpp 2013-05-15 05:12:25 +0000
1442@@ -1,5 +1,5 @@
1443 /*
1444- Copyright (C) 2000-2007 MySQL AB
1445+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1446
1447 This program is free software; you can redistribute it and/or modify
1448 it under the terms of the GNU General Public License as published by
1449
1450=== modified file 'Percona-Server/extra/yassl/taocrypt/mySTL/vector.hpp'
1451--- Percona-Server/extra/yassl/taocrypt/mySTL/vector.hpp 2012-02-10 14:33:27 +0000
1452+++ Percona-Server/extra/yassl/taocrypt/mySTL/vector.hpp 2013-05-15 05:12:25 +0000
1453@@ -1,5 +1,5 @@
1454 /*
1455- Copyright (C) 2000-2007 MySQL AB
1456+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1457
1458 This program is free software; you can redistribute it and/or modify
1459 it under the terms of the GNU General Public License as published by
1460
1461=== modified file 'Percona-Server/extra/yassl/taocrypt/src/aes.cpp'
1462--- Percona-Server/extra/yassl/taocrypt/src/aes.cpp 2012-02-13 12:44:54 +0000
1463+++ Percona-Server/extra/yassl/taocrypt/src/aes.cpp 2013-05-15 05:12:25 +0000
1464@@ -1,5 +1,5 @@
1465 /*
1466- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1467+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1468
1469 This program is free software; you can redistribute it and/or modify
1470 it under the terms of the GNU General Public License as published by
1471
1472=== modified file 'Percona-Server/extra/yassl/taocrypt/src/aestables.cpp'
1473--- Percona-Server/extra/yassl/taocrypt/src/aestables.cpp 2012-02-10 14:33:27 +0000
1474+++ Percona-Server/extra/yassl/taocrypt/src/aestables.cpp 2013-05-15 05:12:25 +0000
1475@@ -1,5 +1,5 @@
1476 /*
1477- Copyright (C) 2000-2007 MySQL AB
1478+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1479
1480 This program is free software; you can redistribute it and/or modify
1481 it under the terms of the GNU General Public License as published by
1482
1483=== modified file 'Percona-Server/extra/yassl/taocrypt/src/algebra.cpp'
1484--- Percona-Server/extra/yassl/taocrypt/src/algebra.cpp 2012-02-13 12:44:54 +0000
1485+++ Percona-Server/extra/yassl/taocrypt/src/algebra.cpp 2013-05-15 05:12:25 +0000
1486@@ -1,5 +1,5 @@
1487 /*
1488- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1489+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1490
1491 This program is free software; you can redistribute it and/or modify
1492 it under the terms of the GNU General Public License as published by
1493
1494=== modified file 'Percona-Server/extra/yassl/taocrypt/src/arc4.cpp'
1495--- Percona-Server/extra/yassl/taocrypt/src/arc4.cpp 2012-02-10 14:33:27 +0000
1496+++ Percona-Server/extra/yassl/taocrypt/src/arc4.cpp 2013-05-15 05:12:25 +0000
1497@@ -1,5 +1,5 @@
1498 /*
1499- Copyright (C) 2000-2007 MySQL AB
1500+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1501
1502 This program is free software; you can redistribute it and/or modify
1503 it under the terms of the GNU General Public License as published by
1504
1505=== modified file 'Percona-Server/extra/yassl/taocrypt/src/blowfish.cpp'
1506--- Percona-Server/extra/yassl/taocrypt/src/blowfish.cpp 2012-02-13 12:44:54 +0000
1507+++ Percona-Server/extra/yassl/taocrypt/src/blowfish.cpp 2013-05-15 05:12:25 +0000
1508@@ -1,5 +1,5 @@
1509 /*
1510- Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1511+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1512
1513 This program is free software; you can redistribute it and/or modify
1514 it under the terms of the GNU General Public License as published by
1515
1516=== modified file 'Percona-Server/extra/yassl/taocrypt/src/coding.cpp'
1517--- Percona-Server/extra/yassl/taocrypt/src/coding.cpp 2012-11-21 13:44:15 +0000
1518+++ Percona-Server/extra/yassl/taocrypt/src/coding.cpp 2013-05-15 05:12:25 +0000
1519@@ -1,5 +1,5 @@
1520 /*
1521- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1522+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1523
1524 This program is free software; you can redistribute it and/or modify
1525 it under the terms of the GNU General Public License as published by
1526
1527=== modified file 'Percona-Server/extra/yassl/taocrypt/src/dsa.cpp'
1528--- Percona-Server/extra/yassl/taocrypt/src/dsa.cpp 2012-02-10 14:33:27 +0000
1529+++ Percona-Server/extra/yassl/taocrypt/src/dsa.cpp 2013-05-15 05:12:25 +0000
1530@@ -1,5 +1,5 @@
1531 /*
1532- Copyright (C) 2000-2007 MySQL AB
1533+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1534
1535 This program is free software; you can redistribute it and/or modify
1536 it under the terms of the GNU General Public License as published by
1537
1538=== modified file 'Percona-Server/extra/yassl/taocrypt/src/hash.cpp'
1539--- Percona-Server/extra/yassl/taocrypt/src/hash.cpp 2012-02-10 14:33:27 +0000
1540+++ Percona-Server/extra/yassl/taocrypt/src/hash.cpp 2013-05-15 05:12:25 +0000
1541@@ -1,5 +1,5 @@
1542 /*
1543- Copyright (C) 2000-2007 MySQL AB
1544+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1545
1546 This program is free software; you can redistribute it and/or modify
1547 it under the terms of the GNU General Public License as published by
1548
1549=== modified file 'Percona-Server/extra/yassl/taocrypt/src/hc128.cpp'
1550--- Percona-Server/extra/yassl/taocrypt/src/hc128.cpp 2012-02-10 14:33:27 +0000
1551+++ Percona-Server/extra/yassl/taocrypt/src/hc128.cpp 2013-05-15 05:12:25 +0000
1552@@ -1,5 +1,5 @@
1553 /*
1554- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1555+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1556
1557 This program is free software; you can redistribute it and/or modify
1558 it under the terms of the GNU General Public License as published by
1559
1560=== modified file 'Percona-Server/extra/yassl/taocrypt/src/make.bat'
1561--- Percona-Server/extra/yassl/taocrypt/src/make.bat 2012-02-10 14:33:27 +0000
1562+++ Percona-Server/extra/yassl/taocrypt/src/make.bat 2013-05-15 05:12:25 +0000
1563@@ -1,4 +1,4 @@
1564-REM Copyright (C) 2006, 2007 MySQL AB
1565+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1566 REM
1567 REM This program is free software; you can redistribute it and/or modify
1568 REM it under the terms of the GNU General Public License as published by
1569
1570=== modified file 'Percona-Server/extra/yassl/taocrypt/src/md4.cpp'
1571--- Percona-Server/extra/yassl/taocrypt/src/md4.cpp 2012-02-10 14:33:27 +0000
1572+++ Percona-Server/extra/yassl/taocrypt/src/md4.cpp 2013-05-15 05:12:25 +0000
1573@@ -1,5 +1,5 @@
1574 /*
1575- Copyright (C) 2000-2007 MySQL AB
1576+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1577
1578 This program is free software; you can redistribute it and/or modify
1579 it under the terms of the GNU General Public License as published by
1580
1581=== modified file 'Percona-Server/extra/yassl/taocrypt/src/md5.cpp'
1582--- Percona-Server/extra/yassl/taocrypt/src/md5.cpp 2012-02-10 14:33:27 +0000
1583+++ Percona-Server/extra/yassl/taocrypt/src/md5.cpp 2013-05-15 05:12:25 +0000
1584@@ -1,5 +1,5 @@
1585 /*
1586- Copyright (C) 2000-2007 MySQL AB
1587+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1588
1589 This program is free software; you can redistribute it and/or modify
1590 it under the terms of the GNU General Public License as published by
1591
1592=== modified file 'Percona-Server/extra/yassl/taocrypt/src/misc.cpp'
1593--- Percona-Server/extra/yassl/taocrypt/src/misc.cpp 2012-02-13 12:44:54 +0000
1594+++ Percona-Server/extra/yassl/taocrypt/src/misc.cpp 2013-05-15 05:12:25 +0000
1595@@ -1,5 +1,5 @@
1596 /*
1597- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1598+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1599
1600 This program is free software; you can redistribute it and/or modify
1601 it under the terms of the GNU General Public License as published by
1602
1603=== modified file 'Percona-Server/extra/yassl/taocrypt/src/rabbit.cpp'
1604--- Percona-Server/extra/yassl/taocrypt/src/rabbit.cpp 2012-02-10 14:33:27 +0000
1605+++ Percona-Server/extra/yassl/taocrypt/src/rabbit.cpp 2013-05-15 05:12:25 +0000
1606@@ -1,5 +1,5 @@
1607 /*
1608- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1609+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1610
1611 This program is free software; you can redistribute it and/or modify
1612 it under the terms of the GNU General Public License as published by
1613
1614=== modified file 'Percona-Server/extra/yassl/taocrypt/src/random.cpp'
1615--- Percona-Server/extra/yassl/taocrypt/src/random.cpp 2012-02-13 12:44:54 +0000
1616+++ Percona-Server/extra/yassl/taocrypt/src/random.cpp 2013-05-15 05:12:25 +0000
1617@@ -1,5 +1,5 @@
1618 /*
1619- Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1620+ Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1621
1622 This program is free software; you can redistribute it and/or modify
1623 it under the terms of the GNU General Public License as published by
1624
1625=== modified file 'Percona-Server/extra/yassl/taocrypt/src/ripemd.cpp'
1626--- Percona-Server/extra/yassl/taocrypt/src/ripemd.cpp 2012-02-10 14:33:27 +0000
1627+++ Percona-Server/extra/yassl/taocrypt/src/ripemd.cpp 2013-05-15 05:12:25 +0000
1628@@ -1,5 +1,5 @@
1629 /*
1630- Copyright (C) 2000-2007 MySQL AB
1631+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1632
1633 This program is free software; you can redistribute it and/or modify
1634 it under the terms of the GNU General Public License as published by
1635
1636=== modified file 'Percona-Server/extra/yassl/taocrypt/src/rsa.cpp'
1637--- Percona-Server/extra/yassl/taocrypt/src/rsa.cpp 2012-02-10 14:33:27 +0000
1638+++ Percona-Server/extra/yassl/taocrypt/src/rsa.cpp 2013-05-15 05:12:25 +0000
1639@@ -1,5 +1,5 @@
1640 /*
1641- Copyright (C) 2000-2007 MySQL AB
1642+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1643
1644 This program is free software; you can redistribute it and/or modify
1645 it under the terms of the GNU General Public License as published by
1646
1647=== modified file 'Percona-Server/extra/yassl/taocrypt/src/sha.cpp'
1648--- Percona-Server/extra/yassl/taocrypt/src/sha.cpp 2012-02-10 14:33:27 +0000
1649+++ Percona-Server/extra/yassl/taocrypt/src/sha.cpp 2013-05-15 05:12:25 +0000
1650@@ -1,5 +1,5 @@
1651 /*
1652- Copyright (C) 2000-2007 MySQL AB
1653+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1654
1655 This program is free software; you can redistribute it and/or modify
1656 it under the terms of the GNU General Public License as published by
1657
1658=== modified file 'Percona-Server/extra/yassl/taocrypt/src/template_instnt.cpp'
1659--- Percona-Server/extra/yassl/taocrypt/src/template_instnt.cpp 2012-02-10 14:33:27 +0000
1660+++ Percona-Server/extra/yassl/taocrypt/src/template_instnt.cpp 2013-05-15 05:12:25 +0000
1661@@ -1,5 +1,5 @@
1662 /*
1663- Copyright (C) 2000-2007 MySQL AB
1664+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1665
1666 This program is free software; you can redistribute it and/or modify
1667 it under the terms of the GNU General Public License as published by
1668
1669=== modified file 'Percona-Server/extra/yassl/taocrypt/src/twofish.cpp'
1670--- Percona-Server/extra/yassl/taocrypt/src/twofish.cpp 2012-02-13 12:44:54 +0000
1671+++ Percona-Server/extra/yassl/taocrypt/src/twofish.cpp 2013-05-15 05:12:25 +0000
1672@@ -1,5 +1,5 @@
1673 /*
1674- Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1675+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1676
1677 This program is free software; you can redistribute it and/or modify
1678 it under the terms of the GNU General Public License as published by
1679
1680=== modified file 'Percona-Server/extra/yassl/taocrypt/test/make.bat'
1681--- Percona-Server/extra/yassl/taocrypt/test/make.bat 2012-02-10 14:33:27 +0000
1682+++ Percona-Server/extra/yassl/taocrypt/test/make.bat 2013-05-15 05:12:25 +0000
1683@@ -1,4 +1,4 @@
1684-REM Copyright (C) 2006, 2007 MySQL AB
1685+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1686 REM
1687 REM This program is free software; you can redistribute it and/or modify
1688 REM it under the terms of the GNU General Public License as published by
1689
1690=== modified file 'Percona-Server/extra/yassl/taocrypt/test/memory.cpp'
1691--- Percona-Server/extra/yassl/taocrypt/test/memory.cpp 2012-11-21 13:44:15 +0000
1692+++ Percona-Server/extra/yassl/taocrypt/test/memory.cpp 2013-05-15 05:12:25 +0000
1693@@ -1,5 +1,5 @@
1694 /*
1695- Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1696+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1697
1698 This program is free software; you can redistribute it and/or modify
1699 it under the terms of the GNU General Public License as published by
1700
1701=== modified file 'Percona-Server/extra/yassl/taocrypt/test/test.cpp'
1702--- Percona-Server/extra/yassl/taocrypt/test/test.cpp 2012-02-13 11:40:12 +0000
1703+++ Percona-Server/extra/yassl/taocrypt/test/test.cpp 2013-05-15 05:12:25 +0000
1704@@ -1,5 +1,5 @@
1705 /*
1706- Copyright (C) 2006, 2007 MySQL AB
1707+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1708
1709 This program is free software; you can redistribute it and/or modify
1710 it under the terms of the GNU General Public License as published by
1711
1712=== modified file 'Percona-Server/extra/yassl/testsuite/make.bat'
1713--- Percona-Server/extra/yassl/testsuite/make.bat 2012-02-10 14:33:27 +0000
1714+++ Percona-Server/extra/yassl/testsuite/make.bat 2013-05-15 05:12:25 +0000
1715@@ -1,4 +1,4 @@
1716-REM Copyright (C) 2006, 2007 MySQL AB
1717+REM Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1718 REM
1719 REM This program is free software; you can redistribute it and/or modify
1720 REM it under the terms of the GNU General Public License as published by
1721
1722=== modified file 'Percona-Server/extra/yassl/testsuite/test.hpp'
1723--- Percona-Server/extra/yassl/testsuite/test.hpp 2012-02-13 12:44:54 +0000
1724+++ Percona-Server/extra/yassl/testsuite/test.hpp 2013-05-15 05:12:25 +0000
1725@@ -1,5 +1,5 @@
1726 /*
1727- Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1728+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1729
1730 This program is free software; you can redistribute it and/or modify
1731 it under the terms of the GNU General Public License as published by
1732
1733=== modified file 'Percona-Server/extra/yassl/testsuite/testsuite.cpp'
1734--- Percona-Server/extra/yassl/testsuite/testsuite.cpp 2012-02-13 11:40:12 +0000
1735+++ Percona-Server/extra/yassl/testsuite/testsuite.cpp 2013-05-15 05:12:25 +0000
1736@@ -1,5 +1,5 @@
1737 /*
1738- Copyright (C) 2006, 2007 MySQL AB
1739+ Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
1740
1741 This program is free software; you can redistribute it and/or modify
1742 it under the terms of the GNU General Public License as published by
1743
1744=== modified file 'Percona-Server/include/base64.h'
1745--- Percona-Server/include/base64.h 2006-12-23 19:20:40 +0000
1746+++ Percona-Server/include/base64.h 2013-05-15 05:12:25 +0000
1747@@ -1,4 +1,5 @@
1748-/* Copyright (C) 2003 MySQL AB
1749+/* Copyright (c) 2003-2006 MySQL AB
1750+ Use is subject to license terms
1751
1752 This program is free software; you can redistribute it and/or modify
1753 it under the terms of the GNU General Public License as published by
1754
1755=== modified file 'Percona-Server/include/ft_global.h'
1756--- Percona-Server/include/ft_global.h 2011-06-30 15:46:53 +0000
1757+++ Percona-Server/include/ft_global.h 2013-05-15 05:12:25 +0000
1758@@ -1,4 +1,4 @@
1759-/* Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
1760+/* Copyright (c) 2000-2005, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
1761 Use is subject to license terms.
1762
1763 This program is free software; you can redistribute it and/or modify
1764
1765=== modified file 'Percona-Server/include/m_ctype.h'
1766--- Percona-Server/include/m_ctype.h 2012-02-16 09:48:16 +0000
1767+++ Percona-Server/include/m_ctype.h 2013-05-15 05:12:25 +0000
1768@@ -1,4 +1,4 @@
1769-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1770+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
1771
1772 This program is free software; you can redistribute it and/or modify
1773 it under the terms of the GNU General Public License as published by
1774@@ -149,6 +149,8 @@
1775 struct charset_info_st;
1776
1777
1778+extern int (*my_string_stack_guard)(int);
1779+
1780 /* See strings/CHARSET_INFO.txt for information about this structure */
1781 typedef struct my_collation_handler_st
1782 {
1783
1784=== modified file 'Percona-Server/include/m_string.h'
1785--- Percona-Server/include/m_string.h 2013-02-24 13:36:00 +0000
1786+++ Percona-Server/include/m_string.h 2013-05-15 05:12:25 +0000
1787@@ -1,5 +1,5 @@
1788 /*
1789- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
1790+ Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1791
1792 This program is free software; you can redistribute it and/or modify
1793 it under the terms of the GNU General Public License as published by
1794
1795=== modified file 'Percona-Server/include/my_md5.h'
1796--- Percona-Server/include/my_md5.h 2009-09-23 21:32:31 +0000
1797+++ Percona-Server/include/my_md5.h 2013-05-15 05:12:25 +0000
1798@@ -1,7 +1,8 @@
1799 #ifndef MY_MD5_INCLUDED
1800 #define MY_MD5_INCLUDED
1801
1802-/* Copyright (C) 2000 MySQL AB
1803+/* Copyright (c) 2000, 2001, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
1804+ Use is subject to license terms
1805
1806 This program is free software; you can redistribute it and/or modify
1807 it under the terms of the GNU General Public License as published by
1808
1809=== modified file 'Percona-Server/include/my_sys.h'
1810--- Percona-Server/include/my_sys.h 2013-03-05 12:16:18 +0000
1811+++ Percona-Server/include/my_sys.h 2013-05-15 05:12:25 +0000
1812@@ -1,4 +1,4 @@
1813-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
1814+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
1815
1816 This program is free software; you can redistribute it and/or modify
1817 it under the terms of the GNU General Public License as published by
1818
1819=== modified file 'Percona-Server/include/my_user.h'
1820--- Percona-Server/include/my_user.h 2007-05-10 09:59:39 +0000
1821+++ Percona-Server/include/my_user.h 2013-05-15 05:12:25 +0000
1822@@ -1,4 +1,5 @@
1823-/* Copyright (C) 2005 MySQL AB
1824+/* Copyright (c) 2005-2007 MySQL AB
1825+ Use is subject to license terms
1826
1827 This program is free software; you can redistribute it and/or modify
1828 it under the terms of the GNU General Public License as published by
1829
1830=== modified file 'Percona-Server/include/my_xml.h'
1831--- Percona-Server/include/my_xml.h 2007-05-10 09:59:39 +0000
1832+++ Percona-Server/include/my_xml.h 2013-05-15 05:12:25 +0000
1833@@ -1,4 +1,5 @@
1834-/* Copyright (C) 2000 MySQL AB
1835+/* Copyright (c) 2000, 2002, 2003, 2005, 2007 MySQL AB
1836+ Use is subject to license terms
1837
1838 This program is free software; you can redistribute it and/or modify
1839 it under the terms of the GNU General Public License as published by
1840
1841=== modified file 'Percona-Server/include/myisampack.h'
1842--- Percona-Server/include/myisampack.h 2011-06-30 15:46:53 +0000
1843+++ Percona-Server/include/myisampack.h 2013-05-15 05:12:25 +0000
1844@@ -1,7 +1,7 @@
1845 #ifndef MYISAMPACK_INCLUDED
1846 #define MYISAMPACK_INCLUDED
1847
1848-/* Copyright (c) 2000-2002, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
1849+/* Copyright (c) 2000-2002, 2004 MySQL AB, 2009 Sun Microsystems, Inc.
1850 Use is subject to license terms.
1851
1852 This program is free software; you can redistribute it and/or modify
1853
1854=== modified file 'Percona-Server/include/mysql.h'
1855--- Percona-Server/include/mysql.h 2012-07-05 06:55:20 +0000
1856+++ Percona-Server/include/mysql.h 2013-05-15 05:12:25 +0000
1857@@ -1,4 +1,4 @@
1858-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
1859+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
1860
1861 This program is free software; you can redistribute it and/or modify
1862 it under the terms of the GNU General Public License as published by
1863
1864=== modified file 'Percona-Server/include/mysql/service_my_snprintf.h'
1865--- Percona-Server/include/mysql/service_my_snprintf.h 2012-12-10 08:55:08 +0000
1866+++ Percona-Server/include/mysql/service_my_snprintf.h 2013-05-15 05:12:25 +0000
1867@@ -1,5 +1,5 @@
1868 #ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED
1869-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
1870+/* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
1871
1872 This program is free software; you can redistribute it and/or modify
1873 it under the terms of the GNU General Public License as published by
1874
1875=== modified file 'Percona-Server/include/mysql/thread_pool_priv.h'
1876--- Percona-Server/include/mysql/thread_pool_priv.h 2012-11-09 09:24:35 +0000
1877+++ Percona-Server/include/mysql/thread_pool_priv.h 2013-05-15 05:12:25 +0000
1878@@ -1,5 +1,5 @@
1879 /*
1880- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
1881+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
1882
1883 This program is free software; you can redistribute it and/or modify
1884 it under the terms of the GNU General Public License as published by
1885
1886=== modified file 'Percona-Server/include/mysql_time.h'
1887--- Percona-Server/include/mysql_time.h 2006-12-31 00:02:27 +0000
1888+++ Percona-Server/include/mysql_time.h 2013-05-15 05:12:25 +0000
1889@@ -1,4 +1,5 @@
1890-/* Copyright (C) 2004 MySQL AB
1891+/* Copyright (c) 2004, 2006 MySQL AB
1892+ Use is subject to license terms
1893
1894 This program is free software; you can redistribute it and/or modify
1895 it under the terms of the GNU General Public License as published by
1896
1897=== modified file 'Percona-Server/include/mysql_version.h.in'
1898--- Percona-Server/include/mysql_version.h.in 2007-09-13 14:19:46 +0000
1899+++ Percona-Server/include/mysql_version.h.in 2013-05-15 05:12:25 +0000
1900@@ -1,4 +1,5 @@
1901-/* Copyright Abandoned 1996, 1999, 2001 MySQL AB
1902+/* Copyright (c) 1996, 1999-2004, 2007 MySQL AB
1903+ Use is subject to license terms
1904 This file is public domain and comes with NO WARRANTY of any kind */
1905
1906 /* Version numbers for protocol & mysqld */
1907
1908=== modified file 'Percona-Server/include/welcome_copyright_notice.h'
1909--- Percona-Server/include/welcome_copyright_notice.h 2013-01-01 02:36:10 +0000
1910+++ Percona-Server/include/welcome_copyright_notice.h 2013-05-15 05:12:25 +0000
1911@@ -1,4 +1,4 @@
1912-/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
1913+/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
1914
1915 This program is free software; you can redistribute it and/or modify
1916 it under the terms of the GNU General Public License as published by
1917
1918=== modified file 'Percona-Server/libmysql/libmysql.c'
1919--- Percona-Server/libmysql/libmysql.c 2013-03-22 03:29:56 +0000
1920+++ Percona-Server/libmysql/libmysql.c 2013-05-15 05:12:25 +0000
1921@@ -2107,7 +2107,14 @@
1922 DBUG_RETURN(1);
1923 }
1924
1925- net_clear(net, 1); /* Sets net->write_pos */
1926+ if (net->vio)
1927+ net_clear(net, 1); /* Sets net->write_pos */
1928+ else
1929+ {
1930+ set_stmt_errmsg(stmt, net);
1931+ DBUG_RETURN(1);
1932+ }
1933+
1934 /* Reserve place for null-marker bytes */
1935 null_count= (stmt->param_count+7) /8;
1936 if (my_realloc_str(net, null_count + 1))
1937
1938=== modified file 'Percona-Server/mysql-test/collections/default.experimental'
1939--- Percona-Server/mysql-test/collections/default.experimental 2012-11-15 14:52:51 +0000
1940+++ Percona-Server/mysql-test/collections/default.experimental 2013-05-15 05:12:25 +0000
1941@@ -6,6 +6,7 @@
1942 funcs_1.charset_collation_1 # depends on compile-time decisions
1943
1944 main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
1945+main.kill @solaris # Bug#16064876 2013-01-02 prthirum main.kill fails on sol10 sparc64
1946 main.lock_multi_bug38499 # Bug#11755645 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
1947 main.outfile_loaddata @solaris # Bug#11755168 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
1948 main.signal_demo3 @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
1949
1950=== modified file 'Percona-Server/mysql-test/include/get_relay_log_pos.inc'
1951--- Percona-Server/mysql-test/include/get_relay_log_pos.inc 2010-10-21 07:37:10 +0000
1952+++ Percona-Server/mysql-test/include/get_relay_log_pos.inc 2013-05-15 05:12:25 +0000
1953@@ -40,7 +40,6 @@
1954 # '# .... end_log_pos 46'
1955 eval LOAD DATA LOCAL INFILE '$_tmp_file' INTO TABLE mysqlbinlog_events
1956 LINES STARTING BY '#' (c2) SET c1 = NULL;
1957---enable_warnings
1958
1959 # Event pos in relay log file is inserted into table events_at
1960 CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
1961@@ -49,6 +48,7 @@
1962 # Event pos in master log file is inserted into table events_pos
1963 CREATE TEMPORARY TABLE events_pos(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
1964 SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE '% end_log_pos %' ORDER BY c1;
1965+--enable_warnings
1966
1967 # events_at events_pos
1968 # c1------c2-------------------------- c1------c2------------------------
1969
1970=== modified file 'Percona-Server/mysql-test/include/rpl_init.inc'
1971--- Percona-Server/mysql-test/include/rpl_init.inc 2010-12-20 14:15:01 +0000
1972+++ Percona-Server/mysql-test/include/rpl_init.inc 2013-05-15 05:12:25 +0000
1973@@ -7,7 +7,6 @@
1974 # well as extra connections server_1_1, server_2_1, ...,
1975 # server_N_1. server_I and server_I_1 are connections to the same
1976 # server.
1977-# - Sets up @@auto_increment_increment and @@auto_increment_increment.
1978 # - Verifies that @@server_id of all servers are different.
1979 # - Calls RESET MASTER, RESET SLAVE, USE test, CHANGE MASTER, START SLAVE.
1980 # - Sets the connection to server_1 before exiting.
1981@@ -179,8 +178,6 @@
1982 RESET MASTER;
1983 RESET SLAVE;
1984 }
1985- eval SET auto_increment_increment= $rpl_server_count;
1986- eval SET auto_increment_offset= $_rpl_server;
1987
1988 --dec $_rpl_server
1989 }
1990
1991=== modified file 'Percona-Server/mysql-test/mysql-test-run.pl'
1992--- Percona-Server/mysql-test/mysql-test-run.pl 2013-02-18 04:48:10 +0000
1993+++ Percona-Server/mysql-test/mysql-test-run.pl 2013-05-15 05:12:25 +0000
1994@@ -700,9 +700,11 @@
1995 mtr_report("\nRetrying test $tname, ".
1996 "attempt($retries/$opt_retry)...\n");
1997 #saving the log file as filename.failed in case of retry
1998- my $worker_logdir= $result->{savedir};
1999- my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
2000- rename $log_file_name,$log_file_name.".failed";
2001+ if ( $result->is_failed() ) {
2002+ my $worker_logdir= $result->{savedir};
2003+ my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log";
2004+ rename $log_file_name,$log_file_name.".failed";
2005+ }
2006 delete($result->{result});
2007 $result->{retries}= $retries+1;
2008 $result->write_test($sock, 'TESTCASE');
2009@@ -3844,6 +3846,7 @@
2010
2011 sub run_testcase ($) {
2012 my $tinfo= shift;
2013+ my $print_freq=20;
2014
2015 mtr_verbose("Running test:", $tinfo->{name});
2016 resfile_report_test($tinfo) if $opt_resfile;
2017@@ -4003,6 +4006,7 @@
2018 my $test= start_mysqltest($tinfo);
2019 # Set only when we have to keep waiting after expectedly died server
2020 my $keep_waiting_proc = 0;
2021+ my $print_timeout= start_timer($print_freq * 60);
2022
2023 while (1)
2024 {
2025@@ -4027,7 +4031,22 @@
2026 }
2027 if (! $keep_waiting_proc)
2028 {
2029- $proc= My::SafeProcess->wait_any_timeout($test_timeout);
2030+ if($test_timeout > $print_timeout)
2031+ {
2032+ $proc= My::SafeProcess->wait_any_timeout($print_timeout);
2033+ if ( $proc->{timeout} )
2034+ {
2035+ #print out that the test is still on
2036+ mtr_print("Test still running: $tinfo->{name}");
2037+ #reset the timer
2038+ $print_timeout= start_timer($print_freq * 60);
2039+ next;
2040+ }
2041+ }
2042+ else
2043+ {
2044+ $proc= My::SafeProcess->wait_any_timeout($test_timeout);
2045+ }
2046 }
2047
2048 # Will be restored if we need to keep waiting
2049
2050=== modified file 'Percona-Server/mysql-test/r/cast.result'
2051--- Percona-Server/mysql-test/r/cast.result 2012-02-22 10:20:52 +0000
2052+++ Percona-Server/mysql-test/r/cast.result 2013-05-15 05:12:25 +0000
2053@@ -477,4 +477,22 @@
2054 AND CAST(a AS BINARY)=x'65736D697468';
2055 a
2056 DROP TABLE t1;
2057+#
2058+# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
2059+# LONGTEXT, UNION, USER VARIABLE
2060+# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
2061+#
2062+CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)),
2063+CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED));
2064+Warnings:
2065+Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
2066+Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
2067+SHOW CREATE TABLE t1;
2068+Table Create Table
2069+t1 CREATE TABLE `t1` (
2070+ `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL DEFAULT '',
2071+ `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL DEFAULT ''
2072+) ENGINE=MyISAM DEFAULT CHARSET=latin1
2073+DROP TABLE t1;
2074+# End of test for Bug#13581962, Bug#14096619
2075 End of 5.1 tests
2076
2077=== modified file 'Percona-Server/mysql-test/r/ctype_utf8mb4.result'
2078--- Percona-Server/mysql-test/r/ctype_utf8mb4.result 2010-09-28 15:15:58 +0000
2079+++ Percona-Server/mysql-test/r/ctype_utf8mb4.result 2013-05-15 05:12:25 +0000
2080@@ -2539,6 +2539,24 @@
2081 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
2082 DROP TABLE t1, t2;
2083 #
2084+# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
2085+# LONGTEXT, UNION, USER VARIABLE
2086+# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
2087+#
2088+CREATE TABLE t1(f1 LONGTEXT CHARACTER SET utf8mb4);
2089+INSERT INTO t1 VALUES ('a');
2090+SELECT @a:= CAST(f1 AS SIGNED) FROM t1
2091+UNION ALL
2092+SELECT CAST(f1 AS SIGNED) FROM t1;
2093+@a:= CAST(f1 AS SIGNED)
2094+0
2095+0
2096+Warnings:
2097+Warning 1292 Truncated incorrect INTEGER value: 'a'
2098+Warning 1292 Truncated incorrect INTEGER value: 'a'
2099+DROP TABLE t1;
2100+# End of test for Bug#13581962,Bug#14096619
2101+#
2102 # End of 5.5 tests
2103 #
2104 #
2105
2106=== modified file 'Percona-Server/mysql-test/r/join_outer.result'
2107--- Percona-Server/mysql-test/r/join_outer.result 2012-02-07 16:32:04 +0000
2108+++ Percona-Server/mysql-test/r/join_outer.result 2013-05-15 05:12:25 +0000
2109@@ -1702,4 +1702,36 @@
2110 f
2111 1
2112 DROP TABLE t1;
2113+#
2114+# Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS
2115+# WRONG RESULT
2116+#
2117+CREATE TABLE t1 (i1 int);
2118+INSERT INTO t1 VALUES (100), (101);
2119+CREATE TABLE t2 (i2 int, i3 int);
2120+INSERT INTO t2 VALUES (20,1),(10,2);
2121+CREATE TABLE t3 (i4 int(11));
2122+INSERT INTO t3 VALUES (1),(2);
2123+
2124+SELECT (
2125+SELECT MAX( t2.i2 )
2126+FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
2127+WHERE t2.i3 <> t1.i1
2128+) AS field1
2129+FROM t1;;
2130+field1
2131+20
2132+20
2133+
2134+SELECT (
2135+SELECT MAX( t2.i2 )
2136+FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
2137+WHERE t2.i3 <> t1.i1
2138+) AS field1
2139+FROM t1 GROUP BY field1;;
2140+field1
2141+20
2142+
2143+drop table t1,t2,t3;
2144+# End of test for Bug#13068506
2145 End of 5.1 tests
2146
2147=== modified file 'Percona-Server/mysql-test/r/partition.result'
2148--- Percona-Server/mysql-test/r/partition.result 2012-01-27 12:21:21 +0000
2149+++ Percona-Server/mysql-test/r/partition.result 2013-05-15 05:12:25 +0000
2150@@ -1758,13 +1758,13 @@
2151 partition by key (a);
2152 REPAIR TABLE t1;
2153 Table Op Msg_type Msg_text
2154-test.t1 repair note The storage engine for the table doesn't support repair
2155+test.t1 repair status OK
2156 OPTIMIZE TABLE t1;
2157 Table Op Msg_type Msg_text
2158 test.t1 optimize note The storage engine for the table doesn't support optimize
2159 CHECK TABLE t1;
2160 Table Op Msg_type Msg_text
2161-test.t1 check note The storage engine for the table doesn't support check
2162+test.t1 check status OK
2163 ANALYZE TABLE t1;
2164 Table Op Msg_type Msg_text
2165 test.t1 analyze note The storage engine for the table doesn't support analyze
2166
2167=== modified file 'Percona-Server/mysql-test/r/percona_server_variables_debug.result'
2168--- Percona-Server/mysql-test/r/percona_server_variables_debug.result 2013-04-04 10:52:07 +0000
2169+++ Percona-Server/mysql-test/r/percona_server_variables_debug.result 2013-05-15 05:12:25 +0000
2170@@ -89,6 +89,7 @@
2171 INNODB_AUTOEXTEND_INCREMENT
2172 INNODB_AUTOINC_LOCK_MODE
2173 INNODB_BLOCKING_BUFFER_POOL_RESTORE
2174+INNODB_BUFFER_POOL_EVICT
2175 INNODB_BUFFER_POOL_INSTANCES
2176 INNODB_BUFFER_POOL_POPULATE
2177 INNODB_BUFFER_POOL_RESTORE_AT_STARTUP
2178
2179=== modified file 'Percona-Server/mysql-test/r/show_check.result'
2180--- Percona-Server/mysql-test/r/show_check.result 2013-01-09 23:45:25 +0000
2181+++ Percona-Server/mysql-test/r/show_check.result 2013-05-15 05:12:25 +0000
2182@@ -15,7 +15,7 @@
2183 def Table 253 128 7 Y 0 31 8
2184 def Op 253 10 5 Y 0 31 8
2185 def Msg_type 253 10 6 Y 0 31 8
2186-def Msg_text 253 255 27 Y 0 31 8
2187+def Msg_text 250 393216 27 Y 0 31 8
2188 Table Op Msg_type Msg_text
2189 test.t1 check status Table is already up to date
2190 check table t1 fast;
2191@@ -23,7 +23,7 @@
2192 def Table 253 128 7 Y 0 31 8
2193 def Op 253 10 5 Y 0 31 8
2194 def Msg_type 253 10 6 Y 0 31 8
2195-def Msg_text 253 255 27 Y 0 31 8
2196+def Msg_text 250 393216 27 Y 0 31 8
2197 Table Op Msg_type Msg_text
2198 test.t1 check status Table is already up to date
2199 check table t1 changed;
2200@@ -31,7 +31,7 @@
2201 def Table 253 128 7 Y 0 31 8
2202 def Op 253 10 5 Y 0 31 8
2203 def Msg_type 253 10 6 Y 0 31 8
2204-def Msg_text 253 255 2 Y 0 31 8
2205+def Msg_text 250 393216 2 Y 0 31 8
2206 Table Op Msg_type Msg_text
2207 test.t1 check status OK
2208 insert into t1 values (5,5,5);
2209@@ -40,7 +40,7 @@
2210 def Table 253 128 7 Y 0 31 8
2211 def Op 253 10 5 Y 0 31 8
2212 def Msg_type 253 10 6 Y 0 31 8
2213-def Msg_text 253 255 2 Y 0 31 8
2214+def Msg_text 250 393216 2 Y 0 31 8
2215 Table Op Msg_type Msg_text
2216 test.t1 check status OK
2217 check table t1 medium;
2218@@ -48,7 +48,7 @@
2219 def Table 253 128 7 Y 0 31 8
2220 def Op 253 10 5 Y 0 31 8
2221 def Msg_type 253 10 6 Y 0 31 8
2222-def Msg_text 253 255 2 Y 0 31 8
2223+def Msg_text 250 393216 2 Y 0 31 8
2224 Table Op Msg_type Msg_text
2225 test.t1 check status OK
2226 check table t1 extended;
2227@@ -56,7 +56,7 @@
2228 def Table 253 128 7 Y 0 31 8
2229 def Op 253 10 5 Y 0 31 8
2230 def Msg_type 253 10 6 Y 0 31 8
2231-def Msg_text 253 255 2 Y 0 31 8
2232+def Msg_text 250 393216 2 Y 0 31 8
2233 Table Op Msg_type Msg_text
2234 test.t1 check status OK
2235 show index from t1;
2236@@ -88,7 +88,7 @@
2237 def Table 253 128 7 Y 0 31 8
2238 def Op 253 10 8 Y 0 31 8
2239 def Msg_type 253 10 6 Y 0 31 8
2240-def Msg_text 253 255 2 Y 0 31 8
2241+def Msg_text 250 393216 2 Y 0 31 8
2242 Table Op Msg_type Msg_text
2243 test.t1 optimize status OK
2244 optimize table t1;
2245@@ -160,7 +160,7 @@
2246 def Table 253 128 7 Y 0 31 8
2247 def Op 253 10 7 Y 0 31 8
2248 def Msg_type 253 10 6 Y 0 31 8
2249-def Msg_text 253 255 2 Y 0 31 8
2250+def Msg_text 250 393216 2 Y 0 31 8
2251 Table Op Msg_type Msg_text
2252 test.t1 analyze status OK
2253 show index from t1;
2254@@ -177,7 +177,7 @@
2255 def Table 253 128 7 Y 0 31 8
2256 def Op 253 10 6 Y 0 31 8
2257 def Msg_type 253 10 6 Y 0 31 8
2258-def Msg_text 253 255 2 Y 0 31 8
2259+def Msg_text 250 393216 2 Y 0 31 8
2260 Table Op Msg_type Msg_text
2261 test.t1 repair status OK
2262 show index from t1;
2263
2264=== modified file 'Percona-Server/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result'
2265--- Percona-Server/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result 2010-06-01 23:25:08 +0000
2266+++ Percona-Server/mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result 2013-05-15 05:12:25 +0000
2267@@ -48,6 +48,7 @@
2268 ################################################################################
2269 # CLEAN UP #
2270 ################################################################################
2271+flush tables;
2272 UNINSTALL PLUGIN example;
2273 SET @@global.binlog_format = @old_binlog_format;
2274 SET @@session.binlog_format = @old_binlog_format;
2275
2276=== modified file 'Percona-Server/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test'
2277--- Percona-Server/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test 2010-06-01 23:25:08 +0000
2278+++ Percona-Server/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test 2013-05-15 05:12:25 +0000
2279@@ -26,7 +26,8 @@
2280 --source include/have_log_bin.inc
2281
2282 SET @old_binlog_format= @@global.binlog_format;
2283-INSTALL PLUGIN example SONAME 'ha_example.so';
2284+--replace_regex /\.dll/.so/
2285+eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN';
2286
2287 --echo ################################################################################
2288 --echo # Verifies if ER_BINLOG_STMT_MODE_AND_ROW_ENGINE happens by setting the binlog
2289@@ -90,6 +91,7 @@
2290 --echo ################################################################################
2291 --echo # CLEAN UP #
2292 --echo ################################################################################
2293+flush tables;
2294 UNINSTALL PLUGIN example;
2295 SET @@global.binlog_format = @old_binlog_format;
2296 SET @@session.binlog_format = @old_binlog_format;
2297
2298=== modified file 'Percona-Server/mysql-test/suite/binlog/t/disabled.def'
2299--- Percona-Server/mysql-test/suite/binlog/t/disabled.def 2011-05-24 06:40:38 +0000
2300+++ Percona-Server/mysql-test/suite/binlog/t/disabled.def 2013-05-15 05:12:25 +0000
2301@@ -10,4 +10,4 @@
2302 #
2303 ##############################################################################
2304 binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
2305-binlog_spurious_ddl_errors : BUG#11761680 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
2306+binlog_spurious_ddl_errors : BUG#11761680 2013-01-18 astha Fixed on mysql-5.6 and trunk
2307
2308=== modified file 'Percona-Server/mysql-test/suite/innodb/r/innodb_bug14147491.result'
2309--- Percona-Server/mysql-test/suite/innodb/r/innodb_bug14147491.result 2012-11-19 09:28:51 +0000
2310+++ Percona-Server/mysql-test/suite/innodb/r/innodb_bug14147491.result 2013-05-15 05:12:25 +0000
2311@@ -4,14 +4,25 @@
2312 CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
2313 INSERT INTO t1 (b) VALUES ('corrupt me');
2314 INSERT INTO t1 (b) VALUES ('corrupt me');
2315-# Restart server to flush buffers
2316+# Write file to make mysql-test-run.pl expect the "crash", but don't
2317+# start it until it's told to
2318+# We give 30 seconds to do a clean shutdown because we do not want
2319+# to redo apply the pages of t1.ibd at the time of recovery.
2320+# We want SQL to initiate the first access to t1.ibd.
2321+# Wait until disconnected.
2322+# Backup the t1.ibd before corrupting
2323 # Corrupt the table
2324 Munged a string.
2325 Munged a string.
2326-# Write file to make mysql-test-run.pl expect crash and restart
2327+# Write file to make mysql-test-run.pl start up the server again
2328+SET DEBUG = '+d,innodb_page_corruption_retries';
2329+# Write file to make mysql-test-run.pl expect the "crash", but don't
2330+# start it until it's told to
2331+# The below SELECT query will crash the server because some pages
2332+# on the disk are corrupted
2333 SELECT * FROM t1;
2334 ERROR HY000: Lost connection to MySQL server during query
2335-# Turn on reconnect
2336-# Wait for server to fully start
2337+# Restore the original t1.ibd
2338+# Write file to make mysql-test-run.pl start up the server again
2339 # Cleanup
2340 DROP TABLE t1;
2341
2342=== modified file 'Percona-Server/mysql-test/suite/innodb/t/innodb_bug12400341.test'
2343--- Percona-Server/mysql-test/suite/innodb/t/innodb_bug12400341.test 2012-01-10 05:23:20 +0000
2344+++ Percona-Server/mysql-test/suite/innodb/t/innodb_bug12400341.test 2013-05-15 05:12:25 +0000
2345@@ -7,6 +7,10 @@
2346 --skip Test requires InnoDB built with UNIV_DEBUG definition.
2347 }
2348
2349+# Don't test under valgrind, undo slots of the previous test might exist still
2350+# and cause unstable result.
2351+--source include/not_valgrind.inc
2352+
2353 call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
2354
2355 --disable_query_log
2356
2357=== modified file 'Percona-Server/mysql-test/suite/innodb/t/innodb_bug14147491.test'
2358--- Percona-Server/mysql-test/suite/innodb/t/innodb_bug14147491.test 2012-11-19 09:28:51 +0000
2359+++ Percona-Server/mysql-test/suite/innodb/t/innodb_bug14147491.test 2013-05-15 05:12:25 +0000
2360@@ -10,6 +10,8 @@
2361 source include/not_embedded.inc;
2362 # Require InnoDB
2363 source include/have_innodb.inc;
2364+# Require Debug for SET DEBUG
2365+source include/have_debug.inc;
2366
2367 CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
2368 CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
2369@@ -27,13 +29,26 @@
2370 --enable_query_log
2371 INSERT INTO t1 (b) VALUES ('corrupt me');
2372
2373---echo # Restart server to flush buffers
2374-source include/restart_mysqld.inc;
2375-
2376---echo # Corrupt the table
2377 let $MYSQLD_DATADIR=`select @@datadir`;
2378 let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
2379
2380+--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
2381+--echo # start it until it's told to
2382+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
2383+
2384+--echo # We give 30 seconds to do a clean shutdown because we do not want
2385+--echo # to redo apply the pages of t1.ibd at the time of recovery.
2386+--echo # We want SQL to initiate the first access to t1.ibd.
2387+shutdown_server 30;
2388+
2389+--echo # Wait until disconnected.
2390+--source include/wait_until_disconnected.inc
2391+
2392+--echo # Backup the t1.ibd before corrupting
2393+--copy_file $t1_IBD $MYSQLD_DATADIR/test/t1.ibd.backup
2394+
2395+--echo # Corrupt the table
2396+
2397 perl;
2398 use strict;
2399 use warnings;
2400@@ -59,17 +74,38 @@
2401 close IBD_FILE;
2402 EOF
2403
2404---echo # Write file to make mysql-test-run.pl expect crash and restart
2405+--echo # Write file to make mysql-test-run.pl start up the server again
2406 --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
2407-
2408+--enable_reconnect
2409+--source include/wait_until_connected_again.inc
2410+
2411+SET DEBUG = '+d,innodb_page_corruption_retries';
2412+
2413+--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
2414+--echo # start it until it's told to
2415+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
2416+
2417+--echo # The below SELECT query will crash the server because some pages
2418+--echo # on the disk are corrupted
2419 --error 2013
2420 SELECT * FROM t1;
2421
2422---echo # Turn on reconnect
2423+# The below mtr command --remove_file fails randomly on windows with
2424+# error number 13 which is permission denied on nix systems. We sleep
2425+# 1 second hoping that any process holding lock on t1.ibd is released.
2426+SLEEP 1;
2427+
2428+--echo # Restore the original t1.ibd
2429+--remove_file $MYSQLD_DATADIR/test/t1.ibd
2430+--move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
2431+
2432+--echo # Write file to make mysql-test-run.pl start up the server again
2433+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
2434 --enable_reconnect
2435-
2436---echo # Wait for server to fully start
2437 --source include/wait_until_connected_again.inc
2438
2439+# Note SET DEBUG = '-d,innodb_page_corruption_retries' is not required
2440+# because the session information is lost after server restart
2441+
2442 --echo # Cleanup
2443 DROP TABLE t1;
2444
2445=== modified file 'Percona-Server/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result'
2446--- Percona-Server/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result 2009-11-25 08:19:34 +0000
2447+++ Percona-Server/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result 2013-05-15 05:12:25 +0000
2448@@ -531,7 +531,7 @@
2449 # check layout success: 1
2450 REPAIR TABLE t1 EXTENDED;
2451 Table Op Msg_type Msg_text
2452-test.t1 repair note The storage engine for the table doesn't support repair
2453+test.t1 repair status OK
2454 # check layout success: 1
2455 TRUNCATE t1;
2456
2457@@ -1023,7 +1023,7 @@
2458 # check layout success: 1
2459 REPAIR TABLE t1 EXTENDED;
2460 Table Op Msg_type Msg_text
2461-test.t1 repair note The storage engine for the table doesn't support repair
2462+test.t1 repair status OK
2463 # check layout success: 1
2464 TRUNCATE t1;
2465
2466@@ -1530,7 +1530,7 @@
2467 # check layout success: 1
2468 REPAIR TABLE t1 EXTENDED;
2469 Table Op Msg_type Msg_text
2470-test.t1 repair note The storage engine for the table doesn't support repair
2471+test.t1 repair status OK
2472 # check layout success: 1
2473 TRUNCATE t1;
2474
2475@@ -2031,7 +2031,7 @@
2476 # check layout success: 1
2477 REPAIR TABLE t1 EXTENDED;
2478 Table Op Msg_type Msg_text
2479-test.t1 repair note The storage engine for the table doesn't support repair
2480+test.t1 repair status OK
2481 # check layout success: 1
2482 TRUNCATE t1;
2483
2484@@ -2530,7 +2530,7 @@
2485 # check layout success: 1
2486 REPAIR TABLE t1 EXTENDED;
2487 Table Op Msg_type Msg_text
2488-test.t1 repair note The storage engine for the table doesn't support repair
2489+test.t1 repair status OK
2490 # check layout success: 1
2491 TRUNCATE t1;
2492
2493@@ -3040,7 +3040,7 @@
2494 # check layout success: 1
2495 REPAIR TABLE t1 EXTENDED;
2496 Table Op Msg_type Msg_text
2497-test.t1 repair note The storage engine for the table doesn't support repair
2498+test.t1 repair status OK
2499 # check layout success: 1
2500 TRUNCATE t1;
2501
2502@@ -3552,7 +3552,7 @@
2503 # check layout success: 1
2504 REPAIR TABLE t1 EXTENDED;
2505 Table Op Msg_type Msg_text
2506-test.t1 repair note The storage engine for the table doesn't support repair
2507+test.t1 repair status OK
2508 # check layout success: 1
2509 TRUNCATE t1;
2510
2511@@ -4052,7 +4052,7 @@
2512 # check layout success: 1
2513 REPAIR TABLE t1 EXTENDED;
2514 Table Op Msg_type Msg_text
2515-test.t1 repair note The storage engine for the table doesn't support repair
2516+test.t1 repair status OK
2517 # check layout success: 1
2518 TRUNCATE t1;
2519
2520@@ -4545,7 +4545,7 @@
2521 # check layout success: 1
2522 REPAIR TABLE t1 EXTENDED;
2523 Table Op Msg_type Msg_text
2524-test.t1 repair note The storage engine for the table doesn't support repair
2525+test.t1 repair status OK
2526 # check layout success: 1
2527 TRUNCATE t1;
2528
2529@@ -5037,7 +5037,7 @@
2530 # check layout success: 1
2531 REPAIR TABLE t1 EXTENDED;
2532 Table Op Msg_type Msg_text
2533-test.t1 repair note The storage engine for the table doesn't support repair
2534+test.t1 repair status OK
2535 # check layout success: 1
2536 TRUNCATE t1;
2537
2538@@ -5544,7 +5544,7 @@
2539 # check layout success: 1
2540 REPAIR TABLE t1 EXTENDED;
2541 Table Op Msg_type Msg_text
2542-test.t1 repair note The storage engine for the table doesn't support repair
2543+test.t1 repair status OK
2544 # check layout success: 1
2545 TRUNCATE t1;
2546
2547@@ -6045,7 +6045,7 @@
2548 # check layout success: 1
2549 REPAIR TABLE t1 EXTENDED;
2550 Table Op Msg_type Msg_text
2551-test.t1 repair note The storage engine for the table doesn't support repair
2552+test.t1 repair status OK
2553 # check layout success: 1
2554 TRUNCATE t1;
2555
2556@@ -6544,7 +6544,7 @@
2557 # check layout success: 1
2558 REPAIR TABLE t1 EXTENDED;
2559 Table Op Msg_type Msg_text
2560-test.t1 repair note The storage engine for the table doesn't support repair
2561+test.t1 repair status OK
2562 # check layout success: 1
2563 TRUNCATE t1;
2564
2565@@ -7054,7 +7054,7 @@
2566 # check layout success: 1
2567 REPAIR TABLE t1 EXTENDED;
2568 Table Op Msg_type Msg_text
2569-test.t1 repair note The storage engine for the table doesn't support repair
2570+test.t1 repair status OK
2571 # check layout success: 1
2572 TRUNCATE t1;
2573
2574@@ -7566,7 +7566,7 @@
2575 # check layout success: 1
2576 REPAIR TABLE t1 EXTENDED;
2577 Table Op Msg_type Msg_text
2578-test.t1 repair note The storage engine for the table doesn't support repair
2579+test.t1 repair status OK
2580 # check layout success: 1
2581 TRUNCATE t1;
2582
2583@@ -8066,7 +8066,7 @@
2584 # check layout success: 1
2585 REPAIR TABLE t1 EXTENDED;
2586 Table Op Msg_type Msg_text
2587-test.t1 repair note The storage engine for the table doesn't support repair
2588+test.t1 repair status OK
2589 # check layout success: 1
2590 TRUNCATE t1;
2591
2592@@ -8576,7 +8576,7 @@
2593 # check layout success: 1
2594 REPAIR TABLE t1 EXTENDED;
2595 Table Op Msg_type Msg_text
2596-test.t1 repair note The storage engine for the table doesn't support repair
2597+test.t1 repair status OK
2598 # check layout success: 1
2599 TRUNCATE t1;
2600
2601@@ -9084,7 +9084,7 @@
2602 # check layout success: 1
2603 REPAIR TABLE t1 EXTENDED;
2604 Table Op Msg_type Msg_text
2605-test.t1 repair note The storage engine for the table doesn't support repair
2606+test.t1 repair status OK
2607 # check layout success: 1
2608 TRUNCATE t1;
2609
2610@@ -9607,7 +9607,7 @@
2611 # check layout success: 1
2612 REPAIR TABLE t1 EXTENDED;
2613 Table Op Msg_type Msg_text
2614-test.t1 repair note The storage engine for the table doesn't support repair
2615+test.t1 repair status OK
2616 # check layout success: 1
2617 TRUNCATE t1;
2618
2619@@ -10124,7 +10124,7 @@
2620 # check layout success: 1
2621 REPAIR TABLE t1 EXTENDED;
2622 Table Op Msg_type Msg_text
2623-test.t1 repair note The storage engine for the table doesn't support repair
2624+test.t1 repair status OK
2625 # check layout success: 1
2626 TRUNCATE t1;
2627
2628@@ -10639,7 +10639,7 @@
2629 # check layout success: 1
2630 REPAIR TABLE t1 EXTENDED;
2631 Table Op Msg_type Msg_text
2632-test.t1 repair note The storage engine for the table doesn't support repair
2633+test.t1 repair status OK
2634 # check layout success: 1
2635 TRUNCATE t1;
2636
2637@@ -11165,7 +11165,7 @@
2638 # check layout success: 1
2639 REPAIR TABLE t1 EXTENDED;
2640 Table Op Msg_type Msg_text
2641-test.t1 repair note The storage engine for the table doesn't support repair
2642+test.t1 repair status OK
2643 # check layout success: 1
2644 TRUNCATE t1;
2645
2646@@ -11693,7 +11693,7 @@
2647 # check layout success: 1
2648 REPAIR TABLE t1 EXTENDED;
2649 Table Op Msg_type Msg_text
2650-test.t1 repair note The storage engine for the table doesn't support repair
2651+test.t1 repair status OK
2652 # check layout success: 1
2653 TRUNCATE t1;
2654
2655@@ -12209,7 +12209,7 @@
2656 # check layout success: 1
2657 REPAIR TABLE t1 EXTENDED;
2658 Table Op Msg_type Msg_text
2659-test.t1 repair note The storage engine for the table doesn't support repair
2660+test.t1 repair status OK
2661 # check layout success: 1
2662 TRUNCATE t1;
2663
2664@@ -12718,7 +12718,7 @@
2665 # check layout success: 1
2666 REPAIR TABLE t1 EXTENDED;
2667 Table Op Msg_type Msg_text
2668-test.t1 repair note The storage engine for the table doesn't support repair
2669+test.t1 repair status OK
2670 # check layout success: 1
2671 TRUNCATE t1;
2672
2673@@ -13226,7 +13226,7 @@
2674 # check layout success: 1
2675 REPAIR TABLE t1 EXTENDED;
2676 Table Op Msg_type Msg_text
2677-test.t1 repair note The storage engine for the table doesn't support repair
2678+test.t1 repair status OK
2679 # check layout success: 1
2680 TRUNCATE t1;
2681
2682@@ -13749,7 +13749,7 @@
2683 # check layout success: 1
2684 REPAIR TABLE t1 EXTENDED;
2685 Table Op Msg_type Msg_text
2686-test.t1 repair note The storage engine for the table doesn't support repair
2687+test.t1 repair status OK
2688 # check layout success: 1
2689 TRUNCATE t1;
2690
2691@@ -14266,7 +14266,7 @@
2692 # check layout success: 1
2693 REPAIR TABLE t1 EXTENDED;
2694 Table Op Msg_type Msg_text
2695-test.t1 repair note The storage engine for the table doesn't support repair
2696+test.t1 repair status OK
2697 # check layout success: 1
2698 TRUNCATE t1;
2699
2700@@ -14781,7 +14781,7 @@
2701 # check layout success: 1
2702 REPAIR TABLE t1 EXTENDED;
2703 Table Op Msg_type Msg_text
2704-test.t1 repair note The storage engine for the table doesn't support repair
2705+test.t1 repair status OK
2706 # check layout success: 1
2707 TRUNCATE t1;
2708
2709@@ -15307,7 +15307,7 @@
2710 # check layout success: 1
2711 REPAIR TABLE t1 EXTENDED;
2712 Table Op Msg_type Msg_text
2713-test.t1 repair note The storage engine for the table doesn't support repair
2714+test.t1 repair status OK
2715 # check layout success: 1
2716 TRUNCATE t1;
2717
2718@@ -15835,7 +15835,7 @@
2719 # check layout success: 1
2720 REPAIR TABLE t1 EXTENDED;
2721 Table Op Msg_type Msg_text
2722-test.t1 repair note The storage engine for the table doesn't support repair
2723+test.t1 repair status OK
2724 # check layout success: 1
2725 TRUNCATE t1;
2726
2727@@ -16351,7 +16351,7 @@
2728 # check layout success: 1
2729 REPAIR TABLE t1 EXTENDED;
2730 Table Op Msg_type Msg_text
2731-test.t1 repair note The storage engine for the table doesn't support repair
2732+test.t1 repair status OK
2733 # check layout success: 1
2734 TRUNCATE t1;
2735
2736@@ -16846,11579 +16846,11579 @@
2737 # check layout success: 1
2738 REPAIR TABLE t1 EXTENDED;
2739 Table Op Msg_type Msg_text
2740-test.t1 repair note The storage engine for the table doesn't support repair
2741-# check layout success: 1
2742-TRUNCATE t1;
2743-
2744-# check TRUNCATE success: 1
2745-# check layout success: 1
2746-# End usability test (inc/partition_check.inc)
2747-DROP TABLE t1;
2748-CREATE TABLE t1 (
2749-f_int1 INTEGER,
2750-f_int2 INTEGER,
2751-f_char1 CHAR(20),
2752-f_char2 CHAR(20),
2753-f_charbig VARCHAR(1000)
2754-
2755-)
2756-PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5;
2757-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
2758-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
2759-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
2760-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
2761-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
2762-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
2763-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
2764-# Start usability test (inc/partition_check.inc)
2765-create_command
2766-SHOW CREATE TABLE t1;
2767-Table Create Table
2768-t1 CREATE TABLE `t1` (
2769- `f_int1` int(11) NOT NULL DEFAULT '0',
2770- `f_int2` int(11) NOT NULL DEFAULT '0',
2771- `f_char1` char(20) DEFAULT NULL,
2772- `f_char2` char(20) DEFAULT NULL,
2773- `f_charbig` varchar(1000) DEFAULT NULL,
2774- PRIMARY KEY (`f_int2`,`f_int1`),
2775- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
2776-) ENGINE=InnoDB DEFAULT CHARSET=latin1
2777-/*!50100 PARTITION BY KEY (f_int1,f_int2)
2778-PARTITIONS 5 */
2779-
2780-# check prerequisites-1 success: 1
2781-# check COUNT(*) success: 1
2782-# check MIN/MAX(f_int1) success: 1
2783-# check MIN/MAX(f_int2) success: 1
2784-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2785-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
2786-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
2787-WHERE f_int1 IN (2,3);
2788-ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
2789-# check prerequisites-3 success: 1
2790-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
2791-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2792-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
2793-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
2794-WHERE f_int1 IN (2,3);
2795-DELETE FROM t1 WHERE f_charbig = 'delete me';
2796-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2797-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
2798-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
2799-WHERE f_int1 IN (2,3);
2800-DELETE FROM t1 WHERE f_charbig = 'delete me';
2801-# check read via f_int1 success: 1
2802-# check read via f_int2 success: 1
2803-
2804-# check multiple-1 success: 1
2805-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
2806-
2807-# check multiple-2 success: 1
2808-INSERT INTO t1 SELECT * FROM t0_template
2809-WHERE MOD(f_int1,3) = 0;
2810-
2811-# check multiple-3 success: 1
2812-UPDATE t1 SET f_int1 = f_int1 + @max_row
2813-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
2814-AND @max_row_div2 + @max_row_div4;
2815-
2816-# check multiple-4 success: 1
2817-DELETE FROM t1
2818-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
2819-AND @max_row_div2 + @max_row_div4 + @max_row;
2820-
2821-# check multiple-5 success: 1
2822-SELECT COUNT(*) INTO @try_count FROM t0_template
2823-WHERE MOD(f_int1,3) = 0
2824-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
2825-SELECT COUNT(*) INTO @clash_count
2826-FROM t1 INNER JOIN t0_template USING(f_int1)
2827-WHERE MOD(f_int1,3) = 0
2828-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
2829-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
2830-INSERT INTO t1
2831-SET f_int1 = @cur_value , f_int2 = @cur_value,
2832-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
2833-f_charbig = '#SINGLE#';
2834-
2835-# check single-1 success: 1
2836-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
2837-INSERT INTO t1
2838-SET f_int1 = @cur_value , f_int2 = @cur_value,
2839-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
2840-f_charbig = '#SINGLE#';
2841-
2842-# check single-2 success: 1
2843-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
2844-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
2845-UPDATE t1 SET f_int1 = @cur_value2
2846-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
2847-
2848-# check single-3 success: 1
2849-SET @cur_value1= -1;
2850-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
2851-UPDATE t1 SET f_int1 = @cur_value1
2852-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
2853-
2854-# check single-4 success: 1
2855-SELECT MAX(f_int1) INTO @cur_value FROM t1;
2856-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
2857-
2858-# check single-5 success: 1
2859-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
2860-
2861-# check single-6 success: 1
2862-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
2863-
2864-# check single-7 success: 1
2865-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
2866-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
2867-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
2868-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
2869-f_charbig = '#NULL#';
2870-INSERT INTO t1
2871-SET f_int1 = NULL , f_int2 = -@max_row,
2872-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
2873-f_charbig = '#NULL#';
2874-ERROR 23000: Column 'f_int1' cannot be null
2875-# check null success: 1
2876-DELETE FROM t1
2877-WHERE f_int1 = 0 AND f_int2 = 0
2878-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
2879-AND f_charbig = '#NULL#';
2880-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2881-SELECT f_int1, f_int1, '', '', 'was inserted'
2882- FROM t0_template source_tab
2883-WHERE MOD(f_int1,3) = 0
2884-AND f_int1 BETWEEN @max_row_div2 AND @max_row
2885-ON DUPLICATE KEY
2886-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
2887-f_int2 = 2 * @max_row + source_tab.f_int1,
2888-f_charbig = 'was updated';
2889-
2890-# check unique-1-a success: 1
2891-
2892-# check unique-1-b success: 1
2893-DELETE FROM t1 WHERE f_charbig = 'was inserted';
2894-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
2895-f_int2 = CAST(f_char1 AS SIGNED INT),
2896-f_charbig = CONCAT('===',f_char1,'===')
2897-WHERE f_charbig = 'was updated';
2898-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2899-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
2900- FROM t0_template source_tab
2901-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
2902-
2903-# check replace success: 1
2904-DELETE FROM t1
2905-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
2906-DELETE FROM t1
2907-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
2908-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
2909-UPDATE t1 SET f_int2 = f_int1,
2910-f_char1 = CAST(f_int1 AS CHAR),
2911-f_char2 = CAST(f_int1 AS CHAR),
2912-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
2913-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
2914-SET AUTOCOMMIT= 0;
2915-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2916-SELECT f_int1, f_int1, '', '', 'was inserted'
2917-FROM t0_template source_tab
2918-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
2919-
2920-# check transactions-1 success: 1
2921-COMMIT WORK;
2922-
2923-# check transactions-2 success: 1
2924-ROLLBACK WORK;
2925-
2926-# check transactions-3 success: 1
2927-DELETE FROM t1 WHERE f_charbig = 'was inserted';
2928-COMMIT WORK;
2929-ROLLBACK WORK;
2930-
2931-# check transactions-4 success: 1
2932-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2933-SELECT f_int1, f_int1, '', '', 'was inserted'
2934-FROM t0_template source_tab
2935-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
2936-
2937-# check transactions-5 success: 1
2938-ROLLBACK WORK;
2939-
2940-# check transactions-6 success: 1
2941-# INFO: Storage engine used for t1 seems to be transactional.
2942-COMMIT;
2943-
2944-# check transactions-7 success: 1
2945-DELETE FROM t1 WHERE f_charbig = 'was inserted';
2946-COMMIT WORK;
2947-SET @@session.sql_mode = 'traditional';
2948-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
2949-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
2950-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
2951-'', '', 'was inserted' FROM t0_template
2952-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
2953-ERROR 22012: Division by 0
2954-COMMIT;
2955-
2956-# check transactions-8 success: 1
2957-# INFO: Storage engine used for t1 seems to be able to revert
2958-# changes made by the failing statement.
2959-SET @@session.sql_mode = '';
2960-SET AUTOCOMMIT= 1;
2961-DELETE FROM t1 WHERE f_charbig = 'was inserted';
2962-COMMIT WORK;
2963-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
2964-
2965-# check special-1 success: 1
2966-UPDATE t1 SET f_charbig = '';
2967-
2968-# check special-2 success: 1
2969-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
2970-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
2971-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
2972-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
2973-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
2974-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
2975-'just inserted' FROM t0_template
2976-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
2977-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
2978-BEGIN
2979-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
2980-f_charbig = 'updated by trigger'
2981- WHERE f_int1 = new.f_int1;
2982-END|
2983-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
2984-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
2985-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
2986-
2987-# check trigger-1 success: 1
2988-DROP TRIGGER trg_1;
2989-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
2990-f_int2 = CAST(f_char1 AS SIGNED INT),
2991-f_charbig = 'just inserted'
2992- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
2993-DELETE FROM t0_aux
2994-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
2995-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
2996-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
2997-'just inserted' FROM t0_template
2998-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
2999-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
3000-BEGIN
3001-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3002-f_charbig = 'updated by trigger'
3003- WHERE f_int1 = new.f_int1;
3004-END|
3005-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3006-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
3007-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3008-
3009-# check trigger-2 success: 1
3010-DROP TRIGGER trg_1;
3011-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3012-f_int2 = CAST(f_char1 AS SIGNED INT),
3013-f_charbig = 'just inserted'
3014- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3015-DELETE FROM t0_aux
3016-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3017-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3018-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3019-'just inserted' FROM t0_template
3020-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3021-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
3022-BEGIN
3023-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3024-f_charbig = 'updated by trigger'
3025- WHERE f_int1 = new.f_int1;
3026-END|
3027-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3028-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3029-
3030-# check trigger-3 success: 1
3031-DROP TRIGGER trg_1;
3032-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3033-f_int2 = CAST(f_char1 AS SIGNED INT),
3034-f_charbig = 'just inserted'
3035- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3036-DELETE FROM t0_aux
3037-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3038-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3039-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3040-'just inserted' FROM t0_template
3041-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3042-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
3043-BEGIN
3044-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3045-f_charbig = 'updated by trigger'
3046- WHERE f_int1 = - old.f_int1;
3047-END|
3048-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3049-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3050-
3051-# check trigger-4 success: 1
3052-DROP TRIGGER trg_1;
3053-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3054-f_int2 = CAST(f_char1 AS SIGNED INT),
3055-f_charbig = 'just inserted'
3056- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3057-DELETE FROM t0_aux
3058-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3059-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3060-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3061-'just inserted' FROM t0_template
3062-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3063-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
3064-BEGIN
3065-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3066-f_charbig = 'updated by trigger'
3067- WHERE f_int1 = new.f_int1;
3068-END|
3069-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3070-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3071-
3072-# check trigger-5 success: 1
3073-DROP TRIGGER trg_1;
3074-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3075-f_int2 = CAST(f_char1 AS SIGNED INT),
3076-f_charbig = 'just inserted'
3077- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3078-DELETE FROM t0_aux
3079-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3080-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3081-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3082-'just inserted' FROM t0_template
3083-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3084-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
3085-BEGIN
3086-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3087-f_charbig = 'updated by trigger'
3088- WHERE f_int1 = - old.f_int1;
3089-END|
3090-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3091-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3092-
3093-# check trigger-6 success: 1
3094-DROP TRIGGER trg_1;
3095-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3096-f_int2 = CAST(f_char1 AS SIGNED INT),
3097-f_charbig = 'just inserted'
3098- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3099-DELETE FROM t0_aux
3100-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3101-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3102-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3103-'just inserted' FROM t0_template
3104-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3105-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
3106-BEGIN
3107-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3108-f_charbig = 'updated by trigger'
3109- WHERE f_int1 = - old.f_int1;
3110-END|
3111-DELETE FROM t0_aux
3112-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3113-
3114-# check trigger-7 success: 1
3115-DROP TRIGGER trg_1;
3116-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3117-f_int2 = CAST(f_char1 AS SIGNED INT),
3118-f_charbig = 'just inserted'
3119- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3120-DELETE FROM t0_aux
3121-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3122-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3123-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3124-'just inserted' FROM t0_template
3125-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3126-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
3127-BEGIN
3128-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3129-f_charbig = 'updated by trigger'
3130- WHERE f_int1 = - old.f_int1;
3131-END|
3132-DELETE FROM t0_aux
3133-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3134-
3135-# check trigger-8 success: 1
3136-DROP TRIGGER trg_1;
3137-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3138-f_int2 = CAST(f_char1 AS SIGNED INT),
3139-f_charbig = 'just inserted'
3140- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3141-DELETE FROM t0_aux
3142-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3143-DELETE FROM t1
3144-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3145-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
3146-BEGIN
3147-SET new.f_int1 = old.f_int1 + @max_row,
3148-new.f_int2 = old.f_int2 - @max_row,
3149-new.f_charbig = '####updated per update trigger####';
3150-END|
3151-UPDATE t1
3152-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
3153-f_charbig = '####updated per update statement itself####';
3154-
3155-# check trigger-9 success: 1
3156-DROP TRIGGER trg_2;
3157-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3158-f_int2 = CAST(f_char1 AS SIGNED INT),
3159-f_charbig = CONCAT('===',f_char1,'===');
3160-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
3161-BEGIN
3162-SET new.f_int1 = new.f_int1 + @max_row,
3163-new.f_int2 = new.f_int2 - @max_row,
3164-new.f_charbig = '####updated per update trigger####';
3165-END|
3166-UPDATE t1
3167-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
3168-f_charbig = '####updated per update statement itself####';
3169-
3170-# check trigger-10 success: 1
3171-DROP TRIGGER trg_2;
3172-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3173-f_int2 = CAST(f_char1 AS SIGNED INT),
3174-f_charbig = CONCAT('===',f_char1,'===');
3175-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
3176-BEGIN
3177-SET new.f_int1 = @my_max1 + @counter,
3178-new.f_int2 = @my_min2 - @counter,
3179-new.f_charbig = '####updated per insert trigger####';
3180-SET @counter = @counter + 1;
3181-END|
3182-SET @counter = 1;
3183-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
3184-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3185-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
3186-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
3187-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
3188-ORDER BY f_int1;
3189-DROP TRIGGER trg_3;
3190-
3191-# check trigger-11 success: 1
3192-DELETE FROM t1
3193-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
3194-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
3195-AND f_charbig = '####updated per insert trigger####';
3196-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
3197-BEGIN
3198-SET new.f_int1 = @my_max1 + @counter,
3199-new.f_int2 = @my_min2 - @counter,
3200-new.f_charbig = '####updated per insert trigger####';
3201-SET @counter = @counter + 1;
3202-END|
3203-SET @counter = 1;
3204-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
3205-INSERT INTO t1 (f_char1, f_char2, f_charbig)
3206-SELECT CAST(f_int1 AS CHAR),
3207-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
3208-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
3209-ORDER BY f_int1;
3210-DROP TRIGGER trg_3;
3211-
3212-# check trigger-12 success: 1
3213-DELETE FROM t1
3214-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
3215-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
3216-AND f_charbig = '####updated per insert trigger####';
3217-ANALYZE TABLE t1;
3218-Table Op Msg_type Msg_text
3219-test.t1 analyze status OK
3220-CHECK TABLE t1 EXTENDED;
3221-Table Op Msg_type Msg_text
3222-test.t1 check status OK
3223-CHECKSUM TABLE t1 EXTENDED;
3224-Table Checksum
3225-test.t1 <some_value>
3226-OPTIMIZE TABLE t1;
3227-Table Op Msg_type Msg_text
3228-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
3229-test.t1 optimize status OK
3230-# check layout success: 1
3231-REPAIR TABLE t1 EXTENDED;
3232-Table Op Msg_type Msg_text
3233-test.t1 repair note The storage engine for the table doesn't support repair
3234-# check layout success: 1
3235-TRUNCATE t1;
3236-
3237-# check TRUNCATE success: 1
3238-# check layout success: 1
3239-# End usability test (inc/partition_check.inc)
3240-DROP TABLE t1;
3241-CREATE TABLE t1 (
3242-f_int1 INTEGER,
3243-f_int2 INTEGER,
3244-f_char1 CHAR(20),
3245-f_char2 CHAR(20),
3246-f_charbig VARCHAR(1000)
3247-
3248-)
3249-PARTITION BY LIST(MOD(f_int1 + f_int2,4))
3250-(PARTITION part_3 VALUES IN (-3),
3251-PARTITION part_2 VALUES IN (-2),
3252-PARTITION part_1 VALUES IN (-1),
3253-PARTITION part_N VALUES IN (NULL),
3254-PARTITION part0 VALUES IN (0),
3255-PARTITION part1 VALUES IN (1),
3256-PARTITION part2 VALUES IN (2),
3257-PARTITION part3 VALUES IN (3));
3258-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
3259-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
3260-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
3261-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
3262-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
3263-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
3264-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
3265-# Start usability test (inc/partition_check.inc)
3266-create_command
3267-SHOW CREATE TABLE t1;
3268-Table Create Table
3269-t1 CREATE TABLE `t1` (
3270- `f_int1` int(11) NOT NULL DEFAULT '0',
3271- `f_int2` int(11) NOT NULL DEFAULT '0',
3272- `f_char1` char(20) DEFAULT NULL,
3273- `f_char2` char(20) DEFAULT NULL,
3274- `f_charbig` varchar(1000) DEFAULT NULL,
3275- PRIMARY KEY (`f_int2`,`f_int1`),
3276- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
3277-) ENGINE=InnoDB DEFAULT CHARSET=latin1
3278-/*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4))
3279-(PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB,
3280- PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB,
3281- PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB,
3282- PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB,
3283- PARTITION part0 VALUES IN (0) ENGINE = InnoDB,
3284- PARTITION part1 VALUES IN (1) ENGINE = InnoDB,
3285- PARTITION part2 VALUES IN (2) ENGINE = InnoDB,
3286- PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
3287-
3288-# check prerequisites-1 success: 1
3289-# check COUNT(*) success: 1
3290-# check MIN/MAX(f_int1) success: 1
3291-# check MIN/MAX(f_int2) success: 1
3292-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3293-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
3294-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
3295-WHERE f_int1 IN (2,3);
3296-ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
3297-# check prerequisites-3 success: 1
3298-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
3299-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3300-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
3301-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
3302-WHERE f_int1 IN (2,3);
3303-DELETE FROM t1 WHERE f_charbig = 'delete me';
3304-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3305-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
3306-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
3307-WHERE f_int1 IN (2,3);
3308-DELETE FROM t1 WHERE f_charbig = 'delete me';
3309-# check read via f_int1 success: 1
3310-# check read via f_int2 success: 1
3311-
3312-# check multiple-1 success: 1
3313-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
3314-
3315-# check multiple-2 success: 1
3316-INSERT INTO t1 SELECT * FROM t0_template
3317-WHERE MOD(f_int1,3) = 0;
3318-
3319-# check multiple-3 success: 1
3320-UPDATE t1 SET f_int1 = f_int1 + @max_row
3321-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
3322-AND @max_row_div2 + @max_row_div4;
3323-
3324-# check multiple-4 success: 1
3325-DELETE FROM t1
3326-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
3327-AND @max_row_div2 + @max_row_div4 + @max_row;
3328-
3329-# check multiple-5 success: 1
3330-SELECT COUNT(*) INTO @try_count FROM t0_template
3331-WHERE MOD(f_int1,3) = 0
3332-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
3333-SELECT COUNT(*) INTO @clash_count
3334-FROM t1 INNER JOIN t0_template USING(f_int1)
3335-WHERE MOD(f_int1,3) = 0
3336-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
3337-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
3338-INSERT INTO t1
3339-SET f_int1 = @cur_value , f_int2 = @cur_value,
3340-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
3341-f_charbig = '#SINGLE#';
3342-
3343-# check single-1 success: 1
3344-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
3345-INSERT INTO t1
3346-SET f_int1 = @cur_value , f_int2 = @cur_value,
3347-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
3348-f_charbig = '#SINGLE#';
3349-
3350-# check single-2 success: 1
3351-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
3352-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
3353-UPDATE t1 SET f_int1 = @cur_value2
3354-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
3355-
3356-# check single-3 success: 1
3357-SET @cur_value1= -1;
3358-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
3359-UPDATE t1 SET f_int1 = @cur_value1
3360-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
3361-
3362-# check single-4 success: 1
3363-SELECT MAX(f_int1) INTO @cur_value FROM t1;
3364-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
3365-
3366-# check single-5 success: 1
3367-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
3368-
3369-# check single-6 success: 1
3370-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
3371-
3372-# check single-7 success: 1
3373-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
3374-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
3375-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
3376-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
3377-f_charbig = '#NULL#';
3378-INSERT INTO t1
3379-SET f_int1 = NULL , f_int2 = -@max_row,
3380-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
3381-f_charbig = '#NULL#';
3382-ERROR 23000: Column 'f_int1' cannot be null
3383-# check null success: 1
3384-DELETE FROM t1
3385-WHERE f_int1 = 0 AND f_int2 = 0
3386-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
3387-AND f_charbig = '#NULL#';
3388-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3389-SELECT f_int1, f_int1, '', '', 'was inserted'
3390- FROM t0_template source_tab
3391-WHERE MOD(f_int1,3) = 0
3392-AND f_int1 BETWEEN @max_row_div2 AND @max_row
3393-ON DUPLICATE KEY
3394-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
3395-f_int2 = 2 * @max_row + source_tab.f_int1,
3396-f_charbig = 'was updated';
3397-
3398-# check unique-1-a success: 1
3399-
3400-# check unique-1-b success: 1
3401-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3402-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3403-f_int2 = CAST(f_char1 AS SIGNED INT),
3404-f_charbig = CONCAT('===',f_char1,'===')
3405-WHERE f_charbig = 'was updated';
3406-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3407-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
3408- FROM t0_template source_tab
3409-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
3410-
3411-# check replace success: 1
3412-DELETE FROM t1
3413-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
3414-DELETE FROM t1
3415-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
3416-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
3417-UPDATE t1 SET f_int2 = f_int1,
3418-f_char1 = CAST(f_int1 AS CHAR),
3419-f_char2 = CAST(f_int1 AS CHAR),
3420-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
3421-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
3422-SET AUTOCOMMIT= 0;
3423-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3424-SELECT f_int1, f_int1, '', '', 'was inserted'
3425-FROM t0_template source_tab
3426-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
3427-
3428-# check transactions-1 success: 1
3429-COMMIT WORK;
3430-
3431-# check transactions-2 success: 1
3432-ROLLBACK WORK;
3433-
3434-# check transactions-3 success: 1
3435-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3436-COMMIT WORK;
3437-ROLLBACK WORK;
3438-
3439-# check transactions-4 success: 1
3440-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3441-SELECT f_int1, f_int1, '', '', 'was inserted'
3442-FROM t0_template source_tab
3443-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
3444-
3445-# check transactions-5 success: 1
3446-ROLLBACK WORK;
3447-
3448-# check transactions-6 success: 1
3449-# INFO: Storage engine used for t1 seems to be transactional.
3450-COMMIT;
3451-
3452-# check transactions-7 success: 1
3453-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3454-COMMIT WORK;
3455-SET @@session.sql_mode = 'traditional';
3456-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
3457-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3458-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
3459-'', '', 'was inserted' FROM t0_template
3460-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
3461-ERROR 22012: Division by 0
3462-COMMIT;
3463-
3464-# check transactions-8 success: 1
3465-# INFO: Storage engine used for t1 seems to be able to revert
3466-# changes made by the failing statement.
3467-SET @@session.sql_mode = '';
3468-SET AUTOCOMMIT= 1;
3469-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3470-COMMIT WORK;
3471-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
3472-
3473-# check special-1 success: 1
3474-UPDATE t1 SET f_charbig = '';
3475-
3476-# check special-2 success: 1
3477-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
3478-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
3479-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
3480-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3481-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3482-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3483-'just inserted' FROM t0_template
3484-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3485-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
3486-BEGIN
3487-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3488-f_charbig = 'updated by trigger'
3489- WHERE f_int1 = new.f_int1;
3490-END|
3491-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3492-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
3493-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3494-
3495-# check trigger-1 success: 1
3496-DROP TRIGGER trg_1;
3497-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3498-f_int2 = CAST(f_char1 AS SIGNED INT),
3499-f_charbig = 'just inserted'
3500- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3501-DELETE FROM t0_aux
3502-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3503-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3504-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3505-'just inserted' FROM t0_template
3506-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3507-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
3508-BEGIN
3509-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3510-f_charbig = 'updated by trigger'
3511- WHERE f_int1 = new.f_int1;
3512-END|
3513-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3514-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
3515-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3516-
3517-# check trigger-2 success: 1
3518-DROP TRIGGER trg_1;
3519-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3520-f_int2 = CAST(f_char1 AS SIGNED INT),
3521-f_charbig = 'just inserted'
3522- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3523-DELETE FROM t0_aux
3524-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3525-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3526-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3527-'just inserted' FROM t0_template
3528-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3529-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
3530-BEGIN
3531-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3532-f_charbig = 'updated by trigger'
3533- WHERE f_int1 = new.f_int1;
3534-END|
3535-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3536-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3537-
3538-# check trigger-3 success: 1
3539-DROP TRIGGER trg_1;
3540-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3541-f_int2 = CAST(f_char1 AS SIGNED INT),
3542-f_charbig = 'just inserted'
3543- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3544-DELETE FROM t0_aux
3545-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3546-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3547-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3548-'just inserted' FROM t0_template
3549-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3550-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
3551-BEGIN
3552-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3553-f_charbig = 'updated by trigger'
3554- WHERE f_int1 = - old.f_int1;
3555-END|
3556-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3557-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3558-
3559-# check trigger-4 success: 1
3560-DROP TRIGGER trg_1;
3561-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3562-f_int2 = CAST(f_char1 AS SIGNED INT),
3563-f_charbig = 'just inserted'
3564- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3565-DELETE FROM t0_aux
3566-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3567-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3568-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3569-'just inserted' FROM t0_template
3570-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3571-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
3572-BEGIN
3573-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3574-f_charbig = 'updated by trigger'
3575- WHERE f_int1 = new.f_int1;
3576-END|
3577-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3578-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3579-
3580-# check trigger-5 success: 1
3581-DROP TRIGGER trg_1;
3582-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3583-f_int2 = CAST(f_char1 AS SIGNED INT),
3584-f_charbig = 'just inserted'
3585- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3586-DELETE FROM t0_aux
3587-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3588-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3589-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3590-'just inserted' FROM t0_template
3591-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3592-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
3593-BEGIN
3594-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3595-f_charbig = 'updated by trigger'
3596- WHERE f_int1 = - old.f_int1;
3597-END|
3598-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
3599-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3600-
3601-# check trigger-6 success: 1
3602-DROP TRIGGER trg_1;
3603-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3604-f_int2 = CAST(f_char1 AS SIGNED INT),
3605-f_charbig = 'just inserted'
3606- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3607-DELETE FROM t0_aux
3608-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3609-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3610-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3611-'just inserted' FROM t0_template
3612-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3613-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
3614-BEGIN
3615-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3616-f_charbig = 'updated by trigger'
3617- WHERE f_int1 = - old.f_int1;
3618-END|
3619-DELETE FROM t0_aux
3620-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3621-
3622-# check trigger-7 success: 1
3623-DROP TRIGGER trg_1;
3624-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3625-f_int2 = CAST(f_char1 AS SIGNED INT),
3626-f_charbig = 'just inserted'
3627- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3628-DELETE FROM t0_aux
3629-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3630-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3631-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3632-'just inserted' FROM t0_template
3633-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3634-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
3635-BEGIN
3636-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3637-f_charbig = 'updated by trigger'
3638- WHERE f_int1 = - old.f_int1;
3639-END|
3640-DELETE FROM t0_aux
3641-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
3642-
3643-# check trigger-8 success: 1
3644-DROP TRIGGER trg_1;
3645-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3646-f_int2 = CAST(f_char1 AS SIGNED INT),
3647-f_charbig = 'just inserted'
3648- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
3649-DELETE FROM t0_aux
3650-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3651-DELETE FROM t1
3652-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3653-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
3654-BEGIN
3655-SET new.f_int1 = old.f_int1 + @max_row,
3656-new.f_int2 = old.f_int2 - @max_row,
3657-new.f_charbig = '####updated per update trigger####';
3658-END|
3659-UPDATE t1
3660-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
3661-f_charbig = '####updated per update statement itself####';
3662-
3663-# check trigger-9 success: 1
3664-DROP TRIGGER trg_2;
3665-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3666-f_int2 = CAST(f_char1 AS SIGNED INT),
3667-f_charbig = CONCAT('===',f_char1,'===');
3668-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
3669-BEGIN
3670-SET new.f_int1 = new.f_int1 + @max_row,
3671-new.f_int2 = new.f_int2 - @max_row,
3672-new.f_charbig = '####updated per update trigger####';
3673-END|
3674-UPDATE t1
3675-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
3676-f_charbig = '####updated per update statement itself####';
3677-
3678-# check trigger-10 success: 1
3679-DROP TRIGGER trg_2;
3680-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3681-f_int2 = CAST(f_char1 AS SIGNED INT),
3682-f_charbig = CONCAT('===',f_char1,'===');
3683-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
3684-BEGIN
3685-SET new.f_int1 = @my_max1 + @counter,
3686-new.f_int2 = @my_min2 - @counter,
3687-new.f_charbig = '####updated per insert trigger####';
3688-SET @counter = @counter + 1;
3689-END|
3690-SET @counter = 1;
3691-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
3692-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3693-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
3694-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
3695-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
3696-ORDER BY f_int1;
3697-DROP TRIGGER trg_3;
3698-
3699-# check trigger-11 success: 1
3700-DELETE FROM t1
3701-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
3702-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
3703-AND f_charbig = '####updated per insert trigger####';
3704-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
3705-BEGIN
3706-SET new.f_int1 = @my_max1 + @counter,
3707-new.f_int2 = @my_min2 - @counter,
3708-new.f_charbig = '####updated per insert trigger####';
3709-SET @counter = @counter + 1;
3710-END|
3711-SET @counter = 1;
3712-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
3713-INSERT INTO t1 (f_char1, f_char2, f_charbig)
3714-SELECT CAST(f_int1 AS CHAR),
3715-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
3716-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
3717-ORDER BY f_int1;
3718-DROP TRIGGER trg_3;
3719-
3720-# check trigger-12 success: 1
3721-DELETE FROM t1
3722-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
3723-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
3724-AND f_charbig = '####updated per insert trigger####';
3725-ANALYZE TABLE t1;
3726-Table Op Msg_type Msg_text
3727-test.t1 analyze status OK
3728-CHECK TABLE t1 EXTENDED;
3729-Table Op Msg_type Msg_text
3730-test.t1 check status OK
3731-CHECKSUM TABLE t1 EXTENDED;
3732-Table Checksum
3733-test.t1 <some_value>
3734-OPTIMIZE TABLE t1;
3735-Table Op Msg_type Msg_text
3736-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
3737-test.t1 optimize status OK
3738-# check layout success: 1
3739-REPAIR TABLE t1 EXTENDED;
3740-Table Op Msg_type Msg_text
3741-test.t1 repair note The storage engine for the table doesn't support repair
3742-# check layout success: 1
3743-TRUNCATE t1;
3744-
3745-# check TRUNCATE success: 1
3746-# check layout success: 1
3747-# End usability test (inc/partition_check.inc)
3748-DROP TABLE t1;
3749-CREATE TABLE t1 (
3750-f_int1 INTEGER,
3751-f_int2 INTEGER,
3752-f_char1 CHAR(20),
3753-f_char2 CHAR(20),
3754-f_charbig VARCHAR(1000)
3755-
3756-)
3757-PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
3758-(PARTITION parta VALUES LESS THAN (0),
3759-PARTITION partb VALUES LESS THAN (5),
3760-PARTITION partc VALUES LESS THAN (10),
3761-PARTITION partd VALUES LESS THAN (10 + 5),
3762-PARTITION parte VALUES LESS THAN (20),
3763-PARTITION partf VALUES LESS THAN (2147483646));
3764-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
3765-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
3766-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
3767-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
3768-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
3769-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
3770-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
3771-# Start usability test (inc/partition_check.inc)
3772-create_command
3773-SHOW CREATE TABLE t1;
3774-Table Create Table
3775-t1 CREATE TABLE `t1` (
3776- `f_int1` int(11) NOT NULL DEFAULT '0',
3777- `f_int2` int(11) NOT NULL DEFAULT '0',
3778- `f_char1` char(20) DEFAULT NULL,
3779- `f_char2` char(20) DEFAULT NULL,
3780- `f_charbig` varchar(1000) DEFAULT NULL,
3781- PRIMARY KEY (`f_int2`,`f_int1`),
3782- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
3783-) ENGINE=InnoDB DEFAULT CHARSET=latin1
3784-/*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2)
3785-(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
3786- PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
3787- PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
3788- PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB,
3789- PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB,
3790- PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
3791-
3792-# check prerequisites-1 success: 1
3793-# check COUNT(*) success: 1
3794-# check MIN/MAX(f_int1) success: 1
3795-# check MIN/MAX(f_int2) success: 1
3796-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3797-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
3798-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
3799-WHERE f_int1 IN (2,3);
3800-ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
3801-# check prerequisites-3 success: 1
3802-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
3803-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3804-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
3805-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
3806-WHERE f_int1 IN (2,3);
3807-DELETE FROM t1 WHERE f_charbig = 'delete me';
3808-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3809-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
3810-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
3811-WHERE f_int1 IN (2,3);
3812-DELETE FROM t1 WHERE f_charbig = 'delete me';
3813-# check read via f_int1 success: 1
3814-# check read via f_int2 success: 1
3815-
3816-# check multiple-1 success: 1
3817-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
3818-
3819-# check multiple-2 success: 1
3820-INSERT INTO t1 SELECT * FROM t0_template
3821-WHERE MOD(f_int1,3) = 0;
3822-
3823-# check multiple-3 success: 1
3824-UPDATE t1 SET f_int1 = f_int1 + @max_row
3825-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
3826-AND @max_row_div2 + @max_row_div4;
3827-
3828-# check multiple-4 success: 1
3829-DELETE FROM t1
3830-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
3831-AND @max_row_div2 + @max_row_div4 + @max_row;
3832-
3833-# check multiple-5 success: 1
3834-SELECT COUNT(*) INTO @try_count FROM t0_template
3835-WHERE MOD(f_int1,3) = 0
3836-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
3837-SELECT COUNT(*) INTO @clash_count
3838-FROM t1 INNER JOIN t0_template USING(f_int1)
3839-WHERE MOD(f_int1,3) = 0
3840-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
3841-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
3842-INSERT INTO t1
3843-SET f_int1 = @cur_value , f_int2 = @cur_value,
3844-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
3845-f_charbig = '#SINGLE#';
3846-
3847-# check single-1 success: 1
3848-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
3849-INSERT INTO t1
3850-SET f_int1 = @cur_value , f_int2 = @cur_value,
3851-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
3852-f_charbig = '#SINGLE#';
3853-
3854-# check single-2 success: 1
3855-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
3856-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
3857-UPDATE t1 SET f_int1 = @cur_value2
3858-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
3859-
3860-# check single-3 success: 1
3861-SET @cur_value1= -1;
3862-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
3863-UPDATE t1 SET f_int1 = @cur_value1
3864-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
3865-
3866-# check single-4 success: 1
3867-SELECT MAX(f_int1) INTO @cur_value FROM t1;
3868-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
3869-
3870-# check single-5 success: 1
3871-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
3872-
3873-# check single-6 success: 1
3874-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
3875-ERROR HY000: Table has no partition for value 2147483647
3876-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
3877-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
3878-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
3879-f_charbig = '#NULL#';
3880-INSERT INTO t1
3881-SET f_int1 = NULL , f_int2 = -@max_row,
3882-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
3883-f_charbig = '#NULL#';
3884-ERROR 23000: Column 'f_int1' cannot be null
3885-# check null success: 1
3886-DELETE FROM t1
3887-WHERE f_int1 = 0 AND f_int2 = 0
3888-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
3889-AND f_charbig = '#NULL#';
3890-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3891-SELECT f_int1, f_int1, '', '', 'was inserted'
3892- FROM t0_template source_tab
3893-WHERE MOD(f_int1,3) = 0
3894-AND f_int1 BETWEEN @max_row_div2 AND @max_row
3895-ON DUPLICATE KEY
3896-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
3897-f_int2 = 2 * @max_row + source_tab.f_int1,
3898-f_charbig = 'was updated';
3899-
3900-# check unique-1-a success: 1
3901-
3902-# check unique-1-b success: 1
3903-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3904-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
3905-f_int2 = CAST(f_char1 AS SIGNED INT),
3906-f_charbig = CONCAT('===',f_char1,'===')
3907-WHERE f_charbig = 'was updated';
3908-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3909-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
3910- FROM t0_template source_tab
3911-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
3912-
3913-# check replace success: 1
3914-DELETE FROM t1
3915-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
3916-DELETE FROM t1
3917-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
3918-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
3919-UPDATE t1 SET f_int2 = f_int1,
3920-f_char1 = CAST(f_int1 AS CHAR),
3921-f_char2 = CAST(f_int1 AS CHAR),
3922-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
3923-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
3924-SET AUTOCOMMIT= 0;
3925-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3926-SELECT f_int1, f_int1, '', '', 'was inserted'
3927-FROM t0_template source_tab
3928-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
3929-
3930-# check transactions-1 success: 1
3931-COMMIT WORK;
3932-
3933-# check transactions-2 success: 1
3934-ROLLBACK WORK;
3935-
3936-# check transactions-3 success: 1
3937-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3938-COMMIT WORK;
3939-ROLLBACK WORK;
3940-
3941-# check transactions-4 success: 1
3942-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3943-SELECT f_int1, f_int1, '', '', 'was inserted'
3944-FROM t0_template source_tab
3945-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
3946-
3947-# check transactions-5 success: 1
3948-ROLLBACK WORK;
3949-
3950-# check transactions-6 success: 1
3951-# INFO: Storage engine used for t1 seems to be transactional.
3952-COMMIT;
3953-
3954-# check transactions-7 success: 1
3955-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3956-COMMIT WORK;
3957-SET @@session.sql_mode = 'traditional';
3958-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
3959-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
3960-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
3961-'', '', 'was inserted' FROM t0_template
3962-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
3963-ERROR 22012: Division by 0
3964-COMMIT;
3965-
3966-# check transactions-8 success: 1
3967-# INFO: Storage engine used for t1 seems to be able to revert
3968-# changes made by the failing statement.
3969-SET @@session.sql_mode = '';
3970-SET AUTOCOMMIT= 1;
3971-DELETE FROM t1 WHERE f_charbig = 'was inserted';
3972-COMMIT WORK;
3973-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
3974-
3975-# check special-1 success: 1
3976-UPDATE t1 SET f_charbig = '';
3977-
3978-# check special-2 success: 1
3979-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
3980-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
3981-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
3982-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3983-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3984-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
3985-'just inserted' FROM t0_template
3986-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3987-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
3988-BEGIN
3989-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
3990-f_charbig = 'updated by trigger'
3991- WHERE f_int1 = new.f_int1;
3992-END|
3993-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
3994-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
3995-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
3996-
3997-# check trigger-1 success: 1
3998-DROP TRIGGER trg_1;
3999-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4000-f_int2 = CAST(f_char1 AS SIGNED INT),
4001-f_charbig = 'just inserted'
4002- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4003-DELETE FROM t0_aux
4004-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4005-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4006-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4007-'just inserted' FROM t0_template
4008-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4009-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
4010-BEGIN
4011-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4012-f_charbig = 'updated by trigger'
4013- WHERE f_int1 = new.f_int1;
4014-END|
4015-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4016-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
4017-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4018-
4019-# check trigger-2 success: 1
4020-DROP TRIGGER trg_1;
4021-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4022-f_int2 = CAST(f_char1 AS SIGNED INT),
4023-f_charbig = 'just inserted'
4024- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4025-DELETE FROM t0_aux
4026-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4027-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4028-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4029-'just inserted' FROM t0_template
4030-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4031-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
4032-BEGIN
4033-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4034-f_charbig = 'updated by trigger'
4035- WHERE f_int1 = new.f_int1;
4036-END|
4037-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4038-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4039-
4040-# check trigger-3 success: 1
4041-DROP TRIGGER trg_1;
4042-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4043-f_int2 = CAST(f_char1 AS SIGNED INT),
4044-f_charbig = 'just inserted'
4045- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4046-DELETE FROM t0_aux
4047-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4048-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4049-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4050-'just inserted' FROM t0_template
4051-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4052-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
4053-BEGIN
4054-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4055-f_charbig = 'updated by trigger'
4056- WHERE f_int1 = - old.f_int1;
4057-END|
4058-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4059-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4060-
4061-# check trigger-4 success: 1
4062-DROP TRIGGER trg_1;
4063-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4064-f_int2 = CAST(f_char1 AS SIGNED INT),
4065-f_charbig = 'just inserted'
4066- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4067-DELETE FROM t0_aux
4068-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4069-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4070-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4071-'just inserted' FROM t0_template
4072-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4073-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
4074-BEGIN
4075-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4076-f_charbig = 'updated by trigger'
4077- WHERE f_int1 = new.f_int1;
4078-END|
4079-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4080-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4081-
4082-# check trigger-5 success: 1
4083-DROP TRIGGER trg_1;
4084-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4085-f_int2 = CAST(f_char1 AS SIGNED INT),
4086-f_charbig = 'just inserted'
4087- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4088-DELETE FROM t0_aux
4089-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4090-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4091-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4092-'just inserted' FROM t0_template
4093-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4094-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
4095-BEGIN
4096-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4097-f_charbig = 'updated by trigger'
4098- WHERE f_int1 = - old.f_int1;
4099-END|
4100-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4101-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4102-
4103-# check trigger-6 success: 1
4104-DROP TRIGGER trg_1;
4105-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4106-f_int2 = CAST(f_char1 AS SIGNED INT),
4107-f_charbig = 'just inserted'
4108- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4109-DELETE FROM t0_aux
4110-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4111-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4112-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4113-'just inserted' FROM t0_template
4114-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4115-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
4116-BEGIN
4117-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4118-f_charbig = 'updated by trigger'
4119- WHERE f_int1 = - old.f_int1;
4120-END|
4121-DELETE FROM t0_aux
4122-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4123-
4124-# check trigger-7 success: 1
4125-DROP TRIGGER trg_1;
4126-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4127-f_int2 = CAST(f_char1 AS SIGNED INT),
4128-f_charbig = 'just inserted'
4129- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4130-DELETE FROM t0_aux
4131-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4132-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4133-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4134-'just inserted' FROM t0_template
4135-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4136-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
4137-BEGIN
4138-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4139-f_charbig = 'updated by trigger'
4140- WHERE f_int1 = - old.f_int1;
4141-END|
4142-DELETE FROM t0_aux
4143-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4144-
4145-# check trigger-8 success: 1
4146-DROP TRIGGER trg_1;
4147-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4148-f_int2 = CAST(f_char1 AS SIGNED INT),
4149-f_charbig = 'just inserted'
4150- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4151-DELETE FROM t0_aux
4152-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4153-DELETE FROM t1
4154-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4155-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
4156-BEGIN
4157-SET new.f_int1 = old.f_int1 + @max_row,
4158-new.f_int2 = old.f_int2 - @max_row,
4159-new.f_charbig = '####updated per update trigger####';
4160-END|
4161-UPDATE t1
4162-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
4163-f_charbig = '####updated per update statement itself####';
4164-
4165-# check trigger-9 success: 1
4166-DROP TRIGGER trg_2;
4167-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4168-f_int2 = CAST(f_char1 AS SIGNED INT),
4169-f_charbig = CONCAT('===',f_char1,'===');
4170-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
4171-BEGIN
4172-SET new.f_int1 = new.f_int1 + @max_row,
4173-new.f_int2 = new.f_int2 - @max_row,
4174-new.f_charbig = '####updated per update trigger####';
4175-END|
4176-UPDATE t1
4177-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
4178-f_charbig = '####updated per update statement itself####';
4179-
4180-# check trigger-10 success: 1
4181-DROP TRIGGER trg_2;
4182-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4183-f_int2 = CAST(f_char1 AS SIGNED INT),
4184-f_charbig = CONCAT('===',f_char1,'===');
4185-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
4186-BEGIN
4187-SET new.f_int1 = @my_max1 + @counter,
4188-new.f_int2 = @my_min2 - @counter,
4189-new.f_charbig = '####updated per insert trigger####';
4190-SET @counter = @counter + 1;
4191-END|
4192-SET @counter = 1;
4193-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
4194-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4195-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
4196-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
4197-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
4198-ORDER BY f_int1;
4199-DROP TRIGGER trg_3;
4200-
4201-# check trigger-11 success: 1
4202-DELETE FROM t1
4203-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
4204-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
4205-AND f_charbig = '####updated per insert trigger####';
4206-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
4207-BEGIN
4208-SET new.f_int1 = @my_max1 + @counter,
4209-new.f_int2 = @my_min2 - @counter,
4210-new.f_charbig = '####updated per insert trigger####';
4211-SET @counter = @counter + 1;
4212-END|
4213-SET @counter = 1;
4214-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
4215-INSERT INTO t1 (f_char1, f_char2, f_charbig)
4216-SELECT CAST(f_int1 AS CHAR),
4217-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
4218-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
4219-ORDER BY f_int1;
4220-DROP TRIGGER trg_3;
4221-
4222-# check trigger-12 success: 1
4223-DELETE FROM t1
4224-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
4225-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
4226-AND f_charbig = '####updated per insert trigger####';
4227-ANALYZE TABLE t1;
4228-Table Op Msg_type Msg_text
4229-test.t1 analyze status OK
4230-CHECK TABLE t1 EXTENDED;
4231-Table Op Msg_type Msg_text
4232-test.t1 check status OK
4233-CHECKSUM TABLE t1 EXTENDED;
4234-Table Checksum
4235-test.t1 <some_value>
4236-OPTIMIZE TABLE t1;
4237-Table Op Msg_type Msg_text
4238-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
4239-test.t1 optimize status OK
4240-# check layout success: 1
4241-REPAIR TABLE t1 EXTENDED;
4242-Table Op Msg_type Msg_text
4243-test.t1 repair note The storage engine for the table doesn't support repair
4244-# check layout success: 1
4245-TRUNCATE t1;
4246-
4247-# check TRUNCATE success: 1
4248-# check layout success: 1
4249-# End usability test (inc/partition_check.inc)
4250-DROP TABLE t1;
4251-CREATE TABLE t1 (
4252-f_int1 INTEGER,
4253-f_int2 INTEGER,
4254-f_char1 CHAR(20),
4255-f_char2 CHAR(20),
4256-f_charbig VARCHAR(1000)
4257-
4258-)
4259-PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
4260-(PARTITION parta VALUES LESS THAN (0),
4261-PARTITION partb VALUES LESS THAN (5),
4262-PARTITION partc VALUES LESS THAN (10),
4263-PARTITION partd VALUES LESS THAN (2147483646));
4264-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
4265-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
4266-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
4267-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
4268-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
4269-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
4270-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
4271-# Start usability test (inc/partition_check.inc)
4272-create_command
4273-SHOW CREATE TABLE t1;
4274-Table Create Table
4275-t1 CREATE TABLE `t1` (
4276- `f_int1` int(11) NOT NULL DEFAULT '0',
4277- `f_int2` int(11) NOT NULL DEFAULT '0',
4278- `f_char1` char(20) DEFAULT NULL,
4279- `f_char2` char(20) DEFAULT NULL,
4280- `f_charbig` varchar(1000) DEFAULT NULL,
4281- PRIMARY KEY (`f_int2`,`f_int1`),
4282- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
4283-) ENGINE=InnoDB DEFAULT CHARSET=latin1
4284-/*!50100 PARTITION BY RANGE (f_int1)
4285-SUBPARTITION BY HASH (f_int2)
4286-SUBPARTITIONS 2
4287-(PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB,
4288- PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB,
4289- PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB,
4290- PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
4291-
4292-# check prerequisites-1 success: 1
4293-# check COUNT(*) success: 1
4294-# check MIN/MAX(f_int1) success: 1
4295-# check MIN/MAX(f_int2) success: 1
4296-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4297-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
4298-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
4299-WHERE f_int1 IN (2,3);
4300-ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
4301-# check prerequisites-3 success: 1
4302-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
4303-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4304-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
4305-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
4306-WHERE f_int1 IN (2,3);
4307-DELETE FROM t1 WHERE f_charbig = 'delete me';
4308-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4309-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
4310-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
4311-WHERE f_int1 IN (2,3);
4312-DELETE FROM t1 WHERE f_charbig = 'delete me';
4313-# check read via f_int1 success: 1
4314-# check read via f_int2 success: 1
4315-
4316-# check multiple-1 success: 1
4317-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
4318-
4319-# check multiple-2 success: 1
4320-INSERT INTO t1 SELECT * FROM t0_template
4321-WHERE MOD(f_int1,3) = 0;
4322-
4323-# check multiple-3 success: 1
4324-UPDATE t1 SET f_int1 = f_int1 + @max_row
4325-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
4326-AND @max_row_div2 + @max_row_div4;
4327-
4328-# check multiple-4 success: 1
4329-DELETE FROM t1
4330-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
4331-AND @max_row_div2 + @max_row_div4 + @max_row;
4332-
4333-# check multiple-5 success: 1
4334-SELECT COUNT(*) INTO @try_count FROM t0_template
4335-WHERE MOD(f_int1,3) = 0
4336-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
4337-SELECT COUNT(*) INTO @clash_count
4338-FROM t1 INNER JOIN t0_template USING(f_int1)
4339-WHERE MOD(f_int1,3) = 0
4340-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
4341-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
4342-INSERT INTO t1
4343-SET f_int1 = @cur_value , f_int2 = @cur_value,
4344-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
4345-f_charbig = '#SINGLE#';
4346-
4347-# check single-1 success: 1
4348-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
4349-INSERT INTO t1
4350-SET f_int1 = @cur_value , f_int2 = @cur_value,
4351-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
4352-f_charbig = '#SINGLE#';
4353-
4354-# check single-2 success: 1
4355-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
4356-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
4357-UPDATE t1 SET f_int1 = @cur_value2
4358-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
4359-
4360-# check single-3 success: 1
4361-SET @cur_value1= -1;
4362-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
4363-UPDATE t1 SET f_int1 = @cur_value1
4364-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
4365-
4366-# check single-4 success: 1
4367-SELECT MAX(f_int1) INTO @cur_value FROM t1;
4368-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
4369-
4370-# check single-5 success: 1
4371-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
4372-
4373-# check single-6 success: 1
4374-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
4375-ERROR HY000: Table has no partition for value 2147483647
4376-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
4377-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
4378-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
4379-f_charbig = '#NULL#';
4380-INSERT INTO t1
4381-SET f_int1 = NULL , f_int2 = -@max_row,
4382-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
4383-f_charbig = '#NULL#';
4384-ERROR 23000: Column 'f_int1' cannot be null
4385-# check null success: 1
4386-DELETE FROM t1
4387-WHERE f_int1 = 0 AND f_int2 = 0
4388-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
4389-AND f_charbig = '#NULL#';
4390-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4391-SELECT f_int1, f_int1, '', '', 'was inserted'
4392- FROM t0_template source_tab
4393-WHERE MOD(f_int1,3) = 0
4394-AND f_int1 BETWEEN @max_row_div2 AND @max_row
4395-ON DUPLICATE KEY
4396-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
4397-f_int2 = 2 * @max_row + source_tab.f_int1,
4398-f_charbig = 'was updated';
4399-
4400-# check unique-1-a success: 1
4401-
4402-# check unique-1-b success: 1
4403-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4404-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4405-f_int2 = CAST(f_char1 AS SIGNED INT),
4406-f_charbig = CONCAT('===',f_char1,'===')
4407-WHERE f_charbig = 'was updated';
4408-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4409-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
4410- FROM t0_template source_tab
4411-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
4412-
4413-# check replace success: 1
4414-DELETE FROM t1
4415-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
4416-DELETE FROM t1
4417-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
4418-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
4419-UPDATE t1 SET f_int2 = f_int1,
4420-f_char1 = CAST(f_int1 AS CHAR),
4421-f_char2 = CAST(f_int1 AS CHAR),
4422-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
4423-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
4424-SET AUTOCOMMIT= 0;
4425-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4426-SELECT f_int1, f_int1, '', '', 'was inserted'
4427-FROM t0_template source_tab
4428-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
4429-
4430-# check transactions-1 success: 1
4431-COMMIT WORK;
4432-
4433-# check transactions-2 success: 1
4434-ROLLBACK WORK;
4435-
4436-# check transactions-3 success: 1
4437-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4438-COMMIT WORK;
4439-ROLLBACK WORK;
4440-
4441-# check transactions-4 success: 1
4442-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4443-SELECT f_int1, f_int1, '', '', 'was inserted'
4444-FROM t0_template source_tab
4445-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
4446-
4447-# check transactions-5 success: 1
4448-ROLLBACK WORK;
4449-
4450-# check transactions-6 success: 1
4451-# INFO: Storage engine used for t1 seems to be transactional.
4452-COMMIT;
4453-
4454-# check transactions-7 success: 1
4455-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4456-COMMIT WORK;
4457-SET @@session.sql_mode = 'traditional';
4458-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
4459-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4460-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
4461-'', '', 'was inserted' FROM t0_template
4462-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
4463-ERROR 22012: Division by 0
4464-COMMIT;
4465-
4466-# check transactions-8 success: 1
4467-# INFO: Storage engine used for t1 seems to be able to revert
4468-# changes made by the failing statement.
4469-SET @@session.sql_mode = '';
4470-SET AUTOCOMMIT= 1;
4471-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4472-COMMIT WORK;
4473-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
4474-
4475-# check special-1 success: 1
4476-UPDATE t1 SET f_charbig = '';
4477-
4478-# check special-2 success: 1
4479-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
4480-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
4481-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
4482-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4483-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4484-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4485-'just inserted' FROM t0_template
4486-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4487-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
4488-BEGIN
4489-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4490-f_charbig = 'updated by trigger'
4491- WHERE f_int1 = new.f_int1;
4492-END|
4493-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4494-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
4495-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4496-
4497-# check trigger-1 success: 1
4498-DROP TRIGGER trg_1;
4499-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4500-f_int2 = CAST(f_char1 AS SIGNED INT),
4501-f_charbig = 'just inserted'
4502- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4503-DELETE FROM t0_aux
4504-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4505-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4506-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4507-'just inserted' FROM t0_template
4508-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4509-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
4510-BEGIN
4511-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4512-f_charbig = 'updated by trigger'
4513- WHERE f_int1 = new.f_int1;
4514-END|
4515-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4516-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
4517-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4518-
4519-# check trigger-2 success: 1
4520-DROP TRIGGER trg_1;
4521-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4522-f_int2 = CAST(f_char1 AS SIGNED INT),
4523-f_charbig = 'just inserted'
4524- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4525-DELETE FROM t0_aux
4526-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4527-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4528-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4529-'just inserted' FROM t0_template
4530-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4531-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
4532-BEGIN
4533-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4534-f_charbig = 'updated by trigger'
4535- WHERE f_int1 = new.f_int1;
4536-END|
4537-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4538-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4539-
4540-# check trigger-3 success: 1
4541-DROP TRIGGER trg_1;
4542-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4543-f_int2 = CAST(f_char1 AS SIGNED INT),
4544-f_charbig = 'just inserted'
4545- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4546-DELETE FROM t0_aux
4547-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4548-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4549-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4550-'just inserted' FROM t0_template
4551-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4552-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
4553-BEGIN
4554-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4555-f_charbig = 'updated by trigger'
4556- WHERE f_int1 = - old.f_int1;
4557-END|
4558-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4559-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4560-
4561-# check trigger-4 success: 1
4562-DROP TRIGGER trg_1;
4563-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4564-f_int2 = CAST(f_char1 AS SIGNED INT),
4565-f_charbig = 'just inserted'
4566- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4567-DELETE FROM t0_aux
4568-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4569-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4570-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4571-'just inserted' FROM t0_template
4572-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4573-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
4574-BEGIN
4575-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4576-f_charbig = 'updated by trigger'
4577- WHERE f_int1 = new.f_int1;
4578-END|
4579-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4580-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4581-
4582-# check trigger-5 success: 1
4583-DROP TRIGGER trg_1;
4584-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4585-f_int2 = CAST(f_char1 AS SIGNED INT),
4586-f_charbig = 'just inserted'
4587- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4588-DELETE FROM t0_aux
4589-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4590-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4591-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4592-'just inserted' FROM t0_template
4593-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4594-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
4595-BEGIN
4596-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4597-f_charbig = 'updated by trigger'
4598- WHERE f_int1 = - old.f_int1;
4599-END|
4600-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
4601-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4602-
4603-# check trigger-6 success: 1
4604-DROP TRIGGER trg_1;
4605-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4606-f_int2 = CAST(f_char1 AS SIGNED INT),
4607-f_charbig = 'just inserted'
4608- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4609-DELETE FROM t0_aux
4610-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4611-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4612-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4613-'just inserted' FROM t0_template
4614-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4615-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
4616-BEGIN
4617-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4618-f_charbig = 'updated by trigger'
4619- WHERE f_int1 = - old.f_int1;
4620-END|
4621-DELETE FROM t0_aux
4622-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4623-
4624-# check trigger-7 success: 1
4625-DROP TRIGGER trg_1;
4626-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4627-f_int2 = CAST(f_char1 AS SIGNED INT),
4628-f_charbig = 'just inserted'
4629- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4630-DELETE FROM t0_aux
4631-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4632-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4633-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4634-'just inserted' FROM t0_template
4635-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4636-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
4637-BEGIN
4638-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
4639-f_charbig = 'updated by trigger'
4640- WHERE f_int1 = - old.f_int1;
4641-END|
4642-DELETE FROM t0_aux
4643-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
4644-
4645-# check trigger-8 success: 1
4646-DROP TRIGGER trg_1;
4647-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4648-f_int2 = CAST(f_char1 AS SIGNED INT),
4649-f_charbig = 'just inserted'
4650- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
4651-DELETE FROM t0_aux
4652-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4653-DELETE FROM t1
4654-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4655-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
4656-BEGIN
4657-SET new.f_int1 = old.f_int1 + @max_row,
4658-new.f_int2 = old.f_int2 - @max_row,
4659-new.f_charbig = '####updated per update trigger####';
4660-END|
4661-UPDATE t1
4662-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
4663-f_charbig = '####updated per update statement itself####';
4664-
4665-# check trigger-9 success: 1
4666-DROP TRIGGER trg_2;
4667-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4668-f_int2 = CAST(f_char1 AS SIGNED INT),
4669-f_charbig = CONCAT('===',f_char1,'===');
4670-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
4671-BEGIN
4672-SET new.f_int1 = new.f_int1 + @max_row,
4673-new.f_int2 = new.f_int2 - @max_row,
4674-new.f_charbig = '####updated per update trigger####';
4675-END|
4676-UPDATE t1
4677-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
4678-f_charbig = '####updated per update statement itself####';
4679-
4680-# check trigger-10 success: 1
4681-DROP TRIGGER trg_2;
4682-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4683-f_int2 = CAST(f_char1 AS SIGNED INT),
4684-f_charbig = CONCAT('===',f_char1,'===');
4685-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
4686-BEGIN
4687-SET new.f_int1 = @my_max1 + @counter,
4688-new.f_int2 = @my_min2 - @counter,
4689-new.f_charbig = '####updated per insert trigger####';
4690-SET @counter = @counter + 1;
4691-END|
4692-SET @counter = 1;
4693-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
4694-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4695-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
4696-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
4697-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
4698-ORDER BY f_int1;
4699-DROP TRIGGER trg_3;
4700-
4701-# check trigger-11 success: 1
4702-DELETE FROM t1
4703-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
4704-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
4705-AND f_charbig = '####updated per insert trigger####';
4706-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
4707-BEGIN
4708-SET new.f_int1 = @my_max1 + @counter,
4709-new.f_int2 = @my_min2 - @counter,
4710-new.f_charbig = '####updated per insert trigger####';
4711-SET @counter = @counter + 1;
4712-END|
4713-SET @counter = 1;
4714-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
4715-INSERT INTO t1 (f_char1, f_char2, f_charbig)
4716-SELECT CAST(f_int1 AS CHAR),
4717-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
4718-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
4719-ORDER BY f_int1;
4720-DROP TRIGGER trg_3;
4721-
4722-# check trigger-12 success: 1
4723-DELETE FROM t1
4724-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
4725-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
4726-AND f_charbig = '####updated per insert trigger####';
4727-ANALYZE TABLE t1;
4728-Table Op Msg_type Msg_text
4729-test.t1 analyze status OK
4730-CHECK TABLE t1 EXTENDED;
4731-Table Op Msg_type Msg_text
4732-test.t1 check status OK
4733-CHECKSUM TABLE t1 EXTENDED;
4734-Table Checksum
4735-test.t1 <some_value>
4736-OPTIMIZE TABLE t1;
4737-Table Op Msg_type Msg_text
4738-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
4739-test.t1 optimize status OK
4740-# check layout success: 1
4741-REPAIR TABLE t1 EXTENDED;
4742-Table Op Msg_type Msg_text
4743-test.t1 repair note The storage engine for the table doesn't support repair
4744-# check layout success: 1
4745-TRUNCATE t1;
4746-
4747-# check TRUNCATE success: 1
4748-# check layout success: 1
4749-# End usability test (inc/partition_check.inc)
4750-DROP TABLE t1;
4751-CREATE TABLE t1 (
4752-f_int1 INTEGER,
4753-f_int2 INTEGER,
4754-f_char1 CHAR(20),
4755-f_char2 CHAR(20),
4756-f_charbig VARCHAR(1000)
4757-
4758-)
4759-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
4760-(PARTITION part1 VALUES LESS THAN (0)
4761-(SUBPARTITION subpart11, SUBPARTITION subpart12),
4762-PARTITION part2 VALUES LESS THAN (5)
4763-(SUBPARTITION subpart21, SUBPARTITION subpart22),
4764-PARTITION part3 VALUES LESS THAN (10)
4765-(SUBPARTITION subpart31, SUBPARTITION subpart32),
4766-PARTITION part4 VALUES LESS THAN (2147483646)
4767-(SUBPARTITION subpart41, SUBPARTITION subpart42));
4768-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
4769-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
4770-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
4771-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
4772-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
4773-SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
4774-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
4775-# Start usability test (inc/partition_check.inc)
4776-create_command
4777-SHOW CREATE TABLE t1;
4778-Table Create Table
4779-t1 CREATE TABLE `t1` (
4780- `f_int1` int(11) NOT NULL DEFAULT '0',
4781- `f_int2` int(11) NOT NULL DEFAULT '0',
4782- `f_char1` char(20) DEFAULT NULL,
4783- `f_char2` char(20) DEFAULT NULL,
4784- `f_charbig` varchar(1000) DEFAULT NULL,
4785- PRIMARY KEY (`f_int2`,`f_int1`),
4786- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
4787-) ENGINE=InnoDB DEFAULT CHARSET=latin1
4788-/*!50100 PARTITION BY RANGE (f_int1)
4789-SUBPARTITION BY KEY (f_int2)
4790-(PARTITION part1 VALUES LESS THAN (0)
4791- (SUBPARTITION subpart11 ENGINE = InnoDB,
4792- SUBPARTITION subpart12 ENGINE = InnoDB),
4793- PARTITION part2 VALUES LESS THAN (5)
4794- (SUBPARTITION subpart21 ENGINE = InnoDB,
4795- SUBPARTITION subpart22 ENGINE = InnoDB),
4796- PARTITION part3 VALUES LESS THAN (10)
4797- (SUBPARTITION subpart31 ENGINE = InnoDB,
4798- SUBPARTITION subpart32 ENGINE = InnoDB),
4799- PARTITION part4 VALUES LESS THAN (2147483646)
4800- (SUBPARTITION subpart41 ENGINE = InnoDB,
4801- SUBPARTITION subpart42 ENGINE = InnoDB)) */
4802-
4803-# check prerequisites-1 success: 1
4804-# check COUNT(*) success: 1
4805-# check MIN/MAX(f_int1) success: 1
4806-# check MIN/MAX(f_int2) success: 1
4807-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4808-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
4809-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
4810-WHERE f_int1 IN (2,3);
4811-ERROR 23000: Duplicate entry '2-2' for key 'PRIMARY'
4812-# check prerequisites-3 success: 1
4813-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
4814-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4815-SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
4816-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
4817-WHERE f_int1 IN (2,3);
4818-DELETE FROM t1 WHERE f_charbig = 'delete me';
4819-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4820-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
4821-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
4822-WHERE f_int1 IN (2,3);
4823-DELETE FROM t1 WHERE f_charbig = 'delete me';
4824-# check read via f_int1 success: 1
4825-# check read via f_int2 success: 1
4826-
4827-# check multiple-1 success: 1
4828-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
4829-
4830-# check multiple-2 success: 1
4831-INSERT INTO t1 SELECT * FROM t0_template
4832-WHERE MOD(f_int1,3) = 0;
4833-
4834-# check multiple-3 success: 1
4835-UPDATE t1 SET f_int1 = f_int1 + @max_row
4836-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
4837-AND @max_row_div2 + @max_row_div4;
4838-
4839-# check multiple-4 success: 1
4840-DELETE FROM t1
4841-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
4842-AND @max_row_div2 + @max_row_div4 + @max_row;
4843-
4844-# check multiple-5 success: 1
4845-SELECT COUNT(*) INTO @try_count FROM t0_template
4846-WHERE MOD(f_int1,3) = 0
4847-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
4848-SELECT COUNT(*) INTO @clash_count
4849-FROM t1 INNER JOIN t0_template USING(f_int1)
4850-WHERE MOD(f_int1,3) = 0
4851-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
4852-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
4853-INSERT INTO t1
4854-SET f_int1 = @cur_value , f_int2 = @cur_value,
4855-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
4856-f_charbig = '#SINGLE#';
4857-
4858-# check single-1 success: 1
4859-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
4860-INSERT INTO t1
4861-SET f_int1 = @cur_value , f_int2 = @cur_value,
4862-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
4863-f_charbig = '#SINGLE#';
4864-
4865-# check single-2 success: 1
4866-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
4867-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
4868-UPDATE t1 SET f_int1 = @cur_value2
4869-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
4870-
4871-# check single-3 success: 1
4872-SET @cur_value1= -1;
4873-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
4874-UPDATE t1 SET f_int1 = @cur_value1
4875-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
4876-
4877-# check single-4 success: 1
4878-SELECT MAX(f_int1) INTO @cur_value FROM t1;
4879-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
4880-
4881-# check single-5 success: 1
4882-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
4883-
4884-# check single-6 success: 1
4885-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
4886-ERROR HY000: Table has no partition for value 2147483647
4887-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
4888-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
4889-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
4890-f_charbig = '#NULL#';
4891-INSERT INTO t1
4892-SET f_int1 = NULL , f_int2 = -@max_row,
4893-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
4894-f_charbig = '#NULL#';
4895-ERROR 23000: Column 'f_int1' cannot be null
4896-# check null success: 1
4897-DELETE FROM t1
4898-WHERE f_int1 = 0 AND f_int2 = 0
4899-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
4900-AND f_charbig = '#NULL#';
4901-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4902-SELECT f_int1, f_int1, '', '', 'was inserted'
4903- FROM t0_template source_tab
4904-WHERE MOD(f_int1,3) = 0
4905-AND f_int1 BETWEEN @max_row_div2 AND @max_row
4906-ON DUPLICATE KEY
4907-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
4908-f_int2 = 2 * @max_row + source_tab.f_int1,
4909-f_charbig = 'was updated';
4910-
4911-# check unique-1-a success: 1
4912-
4913-# check unique-1-b success: 1
4914-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4915-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
4916-f_int2 = CAST(f_char1 AS SIGNED INT),
4917-f_charbig = CONCAT('===',f_char1,'===')
4918-WHERE f_charbig = 'was updated';
4919-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4920-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
4921- FROM t0_template source_tab
4922-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
4923-
4924-# check replace success: 1
4925-DELETE FROM t1
4926-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
4927-DELETE FROM t1
4928-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
4929-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
4930-UPDATE t1 SET f_int2 = f_int1,
4931-f_char1 = CAST(f_int1 AS CHAR),
4932-f_char2 = CAST(f_int1 AS CHAR),
4933-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
4934-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
4935-SET AUTOCOMMIT= 0;
4936-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4937-SELECT f_int1, f_int1, '', '', 'was inserted'
4938-FROM t0_template source_tab
4939-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
4940-
4941-# check transactions-1 success: 1
4942-COMMIT WORK;
4943-
4944-# check transactions-2 success: 1
4945-ROLLBACK WORK;
4946-
4947-# check transactions-3 success: 1
4948-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4949-COMMIT WORK;
4950-ROLLBACK WORK;
4951-
4952-# check transactions-4 success: 1
4953-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4954-SELECT f_int1, f_int1, '', '', 'was inserted'
4955-FROM t0_template source_tab
4956-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
4957-
4958-# check transactions-5 success: 1
4959-ROLLBACK WORK;
4960-
4961-# check transactions-6 success: 1
4962-# INFO: Storage engine used for t1 seems to be transactional.
4963-COMMIT;
4964-
4965-# check transactions-7 success: 1
4966-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4967-COMMIT WORK;
4968-SET @@session.sql_mode = 'traditional';
4969-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
4970-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
4971-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
4972-'', '', 'was inserted' FROM t0_template
4973-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
4974-ERROR 22012: Division by 0
4975-COMMIT;
4976-
4977-# check transactions-8 success: 1
4978-# INFO: Storage engine used for t1 seems to be able to revert
4979-# changes made by the failing statement.
4980-SET @@session.sql_mode = '';
4981-SET AUTOCOMMIT= 1;
4982-DELETE FROM t1 WHERE f_charbig = 'was inserted';
4983-COMMIT WORK;
4984-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
4985-
4986-# check special-1 success: 1
4987-UPDATE t1 SET f_charbig = '';
4988-
4989-# check special-2 success: 1
4990-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
4991-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
4992-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
4993-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4994-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
4995-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
4996-'just inserted' FROM t0_template
4997-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
4998-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
4999-BEGIN
5000-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches