Merge lp:~percona-core/percona-server/release-5.1.66-14.1 into lp:percona-server/5.1

Proposed by Ignacio Nin
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 514
Proposed branch: lp:~percona-core/percona-server/release-5.1.66-14.1
Merge into: lp:percona-server/5.1
Diff against target: 5112 lines (+2955/-403)
95 files modified
Makefile (+2/-2)
Percona-Server/CMakeLists.txt (+3/-0)
Percona-Server/Docs/INSTALL-BINARY (+3/-3)
Percona-Server/client/mysql.cc (+14/-6)
Percona-Server/client/mysql_upgrade.c (+2/-2)
Percona-Server/client/mysqladmin.cc (+3/-3)
Percona-Server/client/mysqlbinlog.cc (+13/-1)
Percona-Server/client/mysqlcheck.c (+2/-2)
Percona-Server/client/mysqldump.c (+1/-1)
Percona-Server/client/mysqlimport.c (+2/-2)
Percona-Server/client/mysqlshow.c (+2/-2)
Percona-Server/client/mysqlslap.c (+3/-3)
Percona-Server/client/mysqltest.cc (+1/-1)
Percona-Server/client/sql_string.h (+7/-3)
Percona-Server/configure.in (+1/-1)
Percona-Server/extra/perror.c (+3/-2)
Percona-Server/extra/yassl/src/ssl.cpp (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/Makefile.am (+1/-1)
Percona-Server/extra/yassl/taocrypt/src/crypto.cpp (+0/-37)
Percona-Server/include/welcome_copyright_notice.h (+13/-8)
Percona-Server/mysql-test/Makefile.am (+1/-0)
Percona-Server/mysql-test/lib/mtr_cases.pm (+33/-0)
Percona-Server/mysql-test/r/information_schema.result (+18/-4)
Percona-Server/mysql-test/r/information_schema_db.result (+4/-1)
Percona-Server/mysql-test/r/mysqlshow.result (+8/-2)
Percona-Server/mysql-test/r/openssl_1.result (+3/-3)
Percona-Server/mysql-test/r/subselect.result (+0/-2)
Percona-Server/mysql-test/suite/federated/federated.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_archive.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_bug_13118.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_bug_25714.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_bug_35333.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_debug.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_innodb.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_server.test (+2/-2)
Percona-Server/mysql-test/suite/federated/federated_transactions.test (+2/-2)
Percona-Server/mysql-test/suite/federated/include/federated.inc (+1/-1)
Percona-Server/mysql-test/suite/funcs_1/t/is_engines_federated.test (+1/-1)
Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-index.result (+1/-1)
Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-zip.result (+3/-3)
Percona-Server/mysql-test/suite/innodb_plugin/r/innodb.result (+1/-1)
Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result (+1/-1)
Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_information_schema_buffer.result (+127/-0)
Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_misc1.result (+1/-1)
Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result (+3/-0)
Percona-Server/mysql-test/suite/innodb_plugin/t/innodb_information_schema_buffer.test (+76/-0)
Percona-Server/mysql-test/t/openssl_1.test (+6/-0)
Percona-Server/mysql-test/t/partition_federated.test (+1/-1)
Percona-Server/scripts/mysql_secure_installation.pl.in (+7/-3)
Percona-Server/scripts/mysql_secure_installation.sh (+13/-5)
Percona-Server/sql/filesort.cc (+2/-3)
Percona-Server/sql/gen_lex_hash.cc (+3/-3)
Percona-Server/sql/ha_partition.cc (+90/-43)
Percona-Server/sql/ha_partition.h (+2/-10)
Percona-Server/sql/handler.cc (+27/-2)
Percona-Server/sql/item.cc (+6/-1)
Percona-Server/sql/item_strfunc.cc (+35/-18)
Percona-Server/sql/item_subselect.cc (+1/-1)
Percona-Server/sql/log_event.h (+1/-1)
Percona-Server/sql/mysqld.cc (+1/-1)
Percona-Server/sql/share/charsets/Index.xml (+1/-1)
Percona-Server/sql/spatial.cc (+6/-5)
Percona-Server/sql/spatial.h (+8/-0)
Percona-Server/sql/sql_prepare.cc (+8/-0)
Percona-Server/sql/sql_select.cc (+9/-6)
Percona-Server/sql/sql_show.cc (+3/-2)
Percona-Server/sql/sql_string.h (+7/-3)
Percona-Server/storage/federated/ha_federated.cc (+1/-1)
Percona-Server/storage/innobase/btr/btr0pcur.c (+32/-37)
Percona-Server/storage/innobase/handler/ha_innodb.cc (+0/-1)
Percona-Server/storage/innodb_plugin/ChangeLog (+29/-0)
Percona-Server/storage/innodb_plugin/btr/btr0btr.c (+41/-6)
Percona-Server/storage/innodb_plugin/btr/btr0cur.c (+23/-18)
Percona-Server/storage/innodb_plugin/btr/btr0pcur.c (+31/-36)
Percona-Server/storage/innodb_plugin/buf/buf0buf.c (+129/-0)
Percona-Server/storage/innodb_plugin/handler/ha_innodb.cc (+20/-6)
Percona-Server/storage/innodb_plugin/handler/i_s.cc (+1757/-0)
Percona-Server/storage/innodb_plugin/handler/i_s.h (+3/-0)
Percona-Server/storage/innodb_plugin/ibuf/ibuf0ibuf.c (+13/-5)
Percona-Server/storage/innodb_plugin/include/buf0buf.h (+102/-1)
Percona-Server/storage/innodb_plugin/include/buf0buf.ic (+20/-0)
Percona-Server/storage/innodb_plugin/include/fil0fil.h (+2/-0)
Percona-Server/storage/innodb_plugin/include/log0log.h (+3/-0)
Percona-Server/storage/innodb_plugin/include/univ.i (+18/-0)
Percona-Server/storage/innodb_plugin/page/page0cur.c (+1/-0)
Percona-Server/storage/innodb_plugin/page/page0page.c (+19/-12)
Percona-Server/storage/innodb_plugin/row/row0ins.c (+8/-1)
Percona-Server/storage/innodb_plugin/row/row0merge.c (+14/-0)
Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins.sql (+3/-0)
Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins_win.sql (+3/-0)
Percona-Server/support-files/mysql.spec.sh (+6/-1)
Percona-Server/vio/viosslfactories.c (+59/-41)
build/debian/rules (+1/-1)
build/percona-server.spec (+2/-6)
build/percona-shared-compat.spec (+1/-1)
To merge this branch: bzr merge lp:~percona-core/percona-server/release-5.1.66-14.1
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+131961@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve
Revision history for this message
Stewart Smith (stewart) wrote :

As discussed on IRC between Alexey and myself, we're going to hold off pushing this into PS 5.1 trunk until the next MySQL 5.5 release, which will contain the MySQL changesets that are in 5.1.66 but not in 5.5.28.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2012-08-20 03:14:02 +0000
+++ Makefile 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1MYSQL_VERSION=5.1.651MYSQL_VERSION=5.1.66
2PERCONA_SERVER_VERSION=rel14.02PERCONA_SERVER_VERSION=rel14.1
3PERCONA_SERVER ?=Percona-Server-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)3PERCONA_SERVER ?=Percona-Server-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)
4PERCONA_SERVER_SHORT_1 ?=Percona-Server-$(MYSQL_VERSION)4PERCONA_SERVER_SHORT_1 ?=Percona-Server-$(MYSQL_VERSION)
5PERCONA_SERVER_SHORT_2 ?=Percona-Server5PERCONA_SERVER_SHORT_2 ?=Percona-Server
66
=== modified file 'Percona-Server/CMakeLists.txt'
--- Percona-Server/CMakeLists.txt 2011-07-03 15:47:37 +0000
+++ Percona-Server/CMakeLists.txt 2012-11-08 17:45:27 +0000
@@ -310,3 +310,6 @@
310 ADD_SUBDIRECTORY(libmysqld/examples)310 ADD_SUBDIRECTORY(libmysqld/examples)
311ENDIF(WITH_EMBEDDED_SERVER)311ENDIF(WITH_EMBEDDED_SERVER)
312ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)312ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
313IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt)
314 ADD_SUBDIRECTORY(internal)
315ENDIF()
313316
=== modified file 'Percona-Server/Docs/INSTALL-BINARY'
--- Percona-Server/Docs/INSTALL-BINARY 2012-08-20 00:29:22 +0000
+++ Percona-Server/Docs/INSTALL-BINARY 2012-11-08 17:45:27 +0000
@@ -1,8 +1,8 @@
11
2You can find information about how to install binary distributions at2You can find information about installing MySQL at
33
4 http://dev.mysql.com/doc/refman/5.1/en/quick-standard-installation.html4 http://dev.mysql.com/doc/refman/5.1/en/installing.html
55
6The MySQL Reference Manual is also available in various formats on6The MySQL Reference Manual is also available in various formats on
7http://dev.mysql.com/doc; if you're interested in the DocBook XML7http://dev.mysql.com/doc; if you're interested in the DocBook XML
8sources go to http://svn.mysql.com.8sources go to http://dev.mysql.com/doc/index-other.html.
99
=== modified file 'Percona-Server/client/mysql.cc'
--- Percona-Server/client/mysql.cc 2011-11-24 16:33:30 +0000
+++ Percona-Server/client/mysql.cc 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -1178,7 +1178,7 @@
1178 mysql_thread_id(&mysql), server_version_string(&mysql));1178 mysql_thread_id(&mysql), server_version_string(&mysql));
1179 put_info((char*) glob_buffer.ptr(),INFO_INFO);1179 put_info((char*) glob_buffer.ptr(),INFO_INFO);
11801180
1181 put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"), INFO_INFO);1181 put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO);
11821182
1183#ifdef HAVE_READLINE1183#ifdef HAVE_READLINE
1184 initialize_readline((char*) my_progname);1184 initialize_readline((char*) my_progname);
@@ -1605,7 +1605,7 @@
16051605
1606 if (version)1606 if (version)
1607 return;1607 return;
1608 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));1608 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
1609 printf("Usage: %s [OPTIONS] [database]\n", my_progname);1609 printf("Usage: %s [OPTIONS] [database]\n", my_progname);
1610 my_print_help(my_long_options);1610 my_print_help(my_long_options);
1611 print_defaults("my", load_default_groups);1611 print_defaults("my", load_default_groups);
@@ -2858,7 +2858,7 @@
2858 char *line __attribute__((unused)), char *help_arg)2858 char *line __attribute__((unused)), char *help_arg)
2859{2859{
2860 MYSQL_ROW cur;2860 MYSQL_ROW cur;
2861 const char *server_cmd= buffer->ptr();2861 const char *server_cmd;
2862 char cmd_buf[100 + 1];2862 char cmd_buf[100 + 1];
2863 MYSQL_RES *result;2863 MYSQL_RES *result;
2864 int error;2864 int error;
@@ -2873,9 +2873,12 @@
2873 *++end_arg= '\0';2873 *++end_arg= '\0';
2874 }2874 }
2875 (void) strxnmov(cmd_buf, sizeof(cmd_buf), "help '", help_arg, "'", NullS);2875 (void) strxnmov(cmd_buf, sizeof(cmd_buf), "help '", help_arg, "'", NullS);
2876 server_cmd= cmd_buf;
2877 }2876 }
2878 2877 else
2878 (void) strxnmov(cmd_buf, sizeof(cmd_buf), "help ", help_arg, NullS);
2879
2880 server_cmd= cmd_buf;
2881
2879 if (!status.batch)2882 if (!status.batch)
2880 {2883 {
2881 old_buffer= *buffer;2884 old_buffer= *buffer;
@@ -2943,6 +2946,11 @@
2943 else2946 else
2944 {2947 {
2945 put_info("\nNothing found", INFO_INFO);2948 put_info("\nNothing found", INFO_INFO);
2949 if (strncasecmp(server_cmd, "help 'contents'", 15) == 0)
2950 {
2951 put_info("\nPlease check if 'help tables' are loaded.\n", INFO_INFO);
2952 goto err;
2953 }
2946 put_info("Please try to run 'help contents' for a list of all accessible topics\n", INFO_INFO);2954 put_info("Please try to run 'help contents' for a list of all accessible topics\n", INFO_INFO);
2947 }2955 }
2948 }2956 }
29492957
=== modified file 'Percona-Server/client/mysql_upgrade.c'
--- Percona-Server/client/mysql_upgrade.c 2011-07-22 07:46:45 +0000
+++ Percona-Server/client/mysql_upgrade.c 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -230,7 +230,7 @@
230 switch (optid) {230 switch (optid) {
231231
232 case '?':232 case '?':
233 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));233 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
234 printf("%s Ver %s Distrib %s, for %s (%s)\n",234 printf("%s Ver %s Distrib %s, for %s (%s)\n",
235 my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);235 my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
236 puts("MySQL utility for upgrading databases to new MySQL versions.\n");236 puts("MySQL utility for upgrading databases to new MySQL versions.\n");
237237
=== modified file 'Percona-Server/client/mysqladmin.cc'
--- Percona-Server/client/mysqladmin.cc 2011-07-22 07:46:45 +0000
+++ Percona-Server/client/mysqladmin.cc 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -693,7 +693,7 @@
693 case ADMIN_VER:693 case ADMIN_VER:
694 new_line=1;694 new_line=1;
695 print_version();695 print_version();
696 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));696 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
697 printf("Server version\t\t%s\n", mysql_get_server_info(mysql));697 printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
698 printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));698 printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
699 printf("Connection\t\t%s\n",mysql_get_host_info(mysql));699 printf("Connection\t\t%s\n",mysql_get_host_info(mysql));
@@ -1072,7 +1072,7 @@
1072static void usage(void)1072static void usage(void)
1073{1073{
1074 print_version();1074 print_version();
1075 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));1075 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
1076 puts("Administration program for the mysqld daemon.");1076 puts("Administration program for the mysqld daemon.");
1077 printf("Usage: %s [OPTIONS] command command....\n", my_progname);1077 printf("Usage: %s [OPTIONS] command command....\n", my_progname);
1078 my_print_help(my_long_options);1078 my_print_help(my_long_options);
10791079
=== modified file 'Percona-Server/client/mysqlbinlog.cc'
--- Percona-Server/client/mysqlbinlog.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/client/mysqlbinlog.cc 2012-11-08 17:45:27 +0000
@@ -36,6 +36,7 @@
36#include "mysql_priv.h" 36#include "mysql_priv.h"
37#include "log_event.h"37#include "log_event.h"
38#include "sql_common.h"38#include "sql_common.h"
39#include "my_dir.h"
39#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE40#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
4041
41/* Needed for Rpl_filter */42/* Needed for Rpl_filter */
@@ -1357,7 +1358,7 @@
1357static void usage()1358static void usage()
1358{1359{
1359 print_version();1360 print_version();
1360 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));1361 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
1361 printf("\1362 printf("\
1362Dumps a MySQL binary log in a format usable for viewing or for piping to\n\1363Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
1363the mysql command line client.\n\n");1364the mysql command line client.\n\n");
@@ -1897,6 +1898,7 @@
1897 uchar header[BIN_LOG_HEADER_SIZE];1898 uchar header[BIN_LOG_HEADER_SIZE];
1898 uchar buf[PROBE_HEADER_LEN];1899 uchar buf[PROBE_HEADER_LEN];
1899 my_off_t tmp_pos, pos;1900 my_off_t tmp_pos, pos;
1901 MY_STAT my_file_stat;
19001902
1901 delete glob_description_event;1903 delete glob_description_event;
1902 if (!(glob_description_event= new Format_description_log_event(3)))1904 if (!(glob_description_event= new Format_description_log_event(3)))
@@ -1907,6 +1909,16 @@
19071909
1908 pos= my_b_tell(file);1910 pos= my_b_tell(file);
1909 DBUG_ASSERT(pos == 0);1911 DBUG_ASSERT(pos == 0);
1912
1913 /* fstat the file to check if the file is a regular file. */
1914 if (my_fstat(file->file, &my_file_stat, MYF(0)) == -1)
1915 {
1916 error("Unable to stat the file.");
1917 return ERROR_STOP;
1918 }
1919 if ((my_file_stat.st_mode & S_IFMT) == S_IFREG)
1920 my_b_seek(file, (my_off_t)0);
1921
1910 if (my_b_read(file, header, sizeof(header)))1922 if (my_b_read(file, header, sizeof(header)))
1911 {1923 {
1912 error("Failed reading header; probably an empty file.");1924 error("Failed reading header; probably an empty file.");
19131925
=== modified file 'Percona-Server/client/mysqlcheck.c'
--- Percona-Server/client/mysqlcheck.c 2011-07-22 07:46:45 +0000
+++ Percona-Server/client/mysqlcheck.c 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -222,7 +222,7 @@
222static void usage(void)222static void usage(void)
223{223{
224 print_version();224 print_version();
225 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));225 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
226 puts("This program can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a),");226 puts("This program can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a),");
227 puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be");227 puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be");
228 puts("used at the same time. Not all options are supported by all storage engines.");228 puts("used at the same time. Not all options are supported by all storage engines.");
229229
=== modified file 'Percona-Server/client/mysqldump.c'
--- Percona-Server/client/mysqldump.c 2012-08-20 03:14:02 +0000
+++ Percona-Server/client/mysqldump.c 2012-11-08 17:45:27 +0000
@@ -601,7 +601,7 @@
601static void usage(void)601static void usage(void)
602{602{
603 print_version();603 print_version();
604 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));604 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
605 puts("Dumping structure and contents of MySQL databases and tables.");605 puts("Dumping structure and contents of MySQL databases and tables.");
606 short_usage_sub();606 short_usage_sub();
607 print_defaults("my",load_default_groups);607 print_defaults("my",load_default_groups);
608608
=== modified file 'Percona-Server/client/mysqlimport.c'
--- Percona-Server/client/mysqlimport.c 2011-07-22 07:46:45 +0000
+++ Percona-Server/client/mysqlimport.c 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -196,7 +196,7 @@
196static void usage(void)196static void usage(void)
197{197{
198 print_version();198 print_version();
199 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));199 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
200 printf("\200 printf("\
201Loads tables from text files in various formats. The base name of the\n\201Loads tables from text files in various formats. The base name of the\n\
202text file must be the name of the table that should be used.\n\202text file must be the name of the table that should be used.\n\
203203
=== modified file 'Percona-Server/client/mysqlshow.c'
--- Percona-Server/client/mysqlshow.c 2011-07-22 07:46:45 +0000
+++ Percona-Server/client/mysqlshow.c 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -256,7 +256,7 @@
256static void usage(void)256static void usage(void)
257{257{
258 print_version();258 print_version();
259 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011)"));259 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
260 puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");260 puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
261 printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);261 printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
262 puts("\n\262 puts("\n\
263263
=== modified file 'Percona-Server/client/mysqlslap.c'
--- Percona-Server/client/mysqlslap.c 2012-04-09 11:12:41 +0000
+++ Percona-Server/client/mysqlslap.c 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -95,6 +95,7 @@
95#include <sys/wait.h>95#include <sys/wait.h>
96#endif96#endif
97#include <ctype.h>97#include <ctype.h>
98#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
9899
99#ifdef __WIN__100#ifdef __WIN__
100#define srandom srand101#define srandom srand
@@ -691,8 +692,7 @@
691static void usage(void)692static void usage(void)
692{693{
693 print_version();694 print_version();
694 puts("Copyright (C) 2005 MySQL AB");695 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2005"));
695 puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
696 puts("Run a query multiple times against the server.\n");696 puts("Run a query multiple times against the server.\n");
697 printf("Usage: %s [OPTIONS]\n",my_progname);697 printf("Usage: %s [OPTIONS]\n",my_progname);
698 print_defaults("my",load_default_groups);698 print_defaults("my",load_default_groups);
699699
=== modified file 'Percona-Server/client/mysqltest.cc'
--- Percona-Server/client/mysqltest.cc 2012-08-20 00:29:22 +0000
+++ Percona-Server/client/mysqltest.cc 2012-11-08 17:45:27 +0000
@@ -6135,7 +6135,7 @@
6135void usage()6135void usage()
6136{6136{
6137 print_version();6137 print_version();
6138 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));6138 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
6139 printf("Runs a test against the mysql server and compares output with a results file.\n\n");6139 printf("Runs a test against the mysql server and compares output with a results file.\n\n");
6140 printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname);6140 printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname);
6141 my_print_help(my_long_options);6141 my_print_help(my_long_options);
61426142
=== modified file 'Percona-Server/client/sql_string.h'
--- Percona-Server/client/sql_string.h 2012-02-09 15:03:59 +0000
+++ Percona-Server/client/sql_string.h 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -198,8 +198,12 @@
198 }198 }
199 bool real_alloc(uint32 arg_length); // Empties old string199 bool real_alloc(uint32 arg_length); // Empties old string
200 bool realloc(uint32 arg_length);200 bool realloc(uint32 arg_length);
201 inline void shrink(uint32 arg_length) // Shrink buffer201
202 // Shrink the buffer, but only if it is allocated on the heap.
203 inline void shrink(uint32 arg_length)
202 {204 {
205 if (!is_alloced())
206 return;
203 if (arg_length < Alloced_length)207 if (arg_length < Alloced_length)
204 {208 {
205 char *new_ptr;209 char *new_ptr;
@@ -215,7 +219,7 @@
215 }219 }
216 }220 }
217 }221 }
218 bool is_alloced() { return alloced; }222 bool is_alloced() const { return alloced; }
219 inline String& operator = (const String &s)223 inline String& operator = (const String &s)
220 {224 {
221 if (&s != this)225 if (&s != this)
222226
=== modified file 'Percona-Server/configure.in'
--- Percona-Server/configure.in 2012-10-10 10:43:22 +0000
+++ Percona-Server/configure.in 2012-11-08 17:45:27 +0000
@@ -12,7 +12,7 @@
12dnl When changing the major version number please also check the switch12dnl When changing the major version number please also check the switch
13dnl statement in mysqlbinlog::check_master_version(). You may also need13dnl statement in mysqlbinlog::check_master_version(). You may also need
14dnl to update version.c in ndb.14dnl to update version.c in ndb.
15AC_INIT([MySQL Server], [5.1.65], [], [mysql])15AC_INIT([MySQL Server], [5.1.66], [], [mysql])
1616
17AC_CONFIG_SRCDIR([sql/mysqld.cc])17AC_CONFIG_SRCDIR([sql/mysqld.cc])
18AC_CANONICAL_SYSTEM18AC_CANONICAL_SYSTEM
1919
=== modified file 'Percona-Server/extra/perror.c'
--- Percona-Server/extra/perror.c 2011-07-03 15:47:37 +0000
+++ Percona-Server/extra/perror.c 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -29,6 +29,7 @@
29#include "../storage/ndb/src/kernel/error/ndbd_exit_codes.c"29#include "../storage/ndb/src/kernel/error/ndbd_exit_codes.c"
30#include "../storage/ndb/include/mgmapi/mgmapi_error.h"30#include "../storage/ndb/include/mgmapi/mgmapi_error.h"
31#endif31#endif
32#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
3233
33static my_bool verbose, print_all_codes;34static my_bool verbose, print_all_codes;
3435
@@ -115,7 +116,7 @@
115static void usage(void)116static void usage(void)
116{117{
117 print_version();118 print_version();
118 puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");119 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
119 printf("Print a description for a system error code or a MySQL error code.\n");120 printf("Print a description for a system error code or a MySQL error code.\n");
120 printf("If you want to get the error for a negative error code, you should use\n-- before the first error code to tell perror that there was no more options.\n\n");121 printf("If you want to get the error for a negative error code, you should use\n-- before the first error code to tell perror that there was no more options.\n\n");
121 printf("Usage: %s [OPTIONS] [ERRORCODE [ERRORCODE...]]\n",my_progname);122 printf("Usage: %s [OPTIONS] [ERRORCODE [ERRORCODE...]]\n",my_progname);
122123
=== modified file 'Percona-Server/extra/yassl/src/ssl.cpp'
--- Percona-Server/extra/yassl/src/ssl.cpp 2012-02-13 11:40:12 +0000
+++ Percona-Server/extra/yassl/src/ssl.cpp 2012-11-08 17:45:27 +0000
@@ -747,7 +747,7 @@
747int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file,747int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file,
748 const char* path)748 const char* path)
749{749{
750 int ret = SSL_SUCCESS;750 int ret = SSL_FAILURE;
751 const int HALF_PATH = 128;751 const int HALF_PATH = 128;
752752
753 if (file) ret = read_file(ctx, file, SSL_FILETYPE_PEM, CA);753 if (file) ret = read_file(ctx, file, SSL_FILETYPE_PEM, CA);
754754
=== modified file 'Percona-Server/extra/yassl/taocrypt/src/Makefile.am'
--- Percona-Server/extra/yassl/taocrypt/src/Makefile.am 2012-08-27 05:43:12 +0000
+++ Percona-Server/extra/yassl/taocrypt/src/Makefile.am 2012-11-08 17:45:27 +0000
@@ -21,7 +21,7 @@
21 asn.cpp bftables.cpp blowfish.cpp coding.cpp des.cpp dh.cpp \21 asn.cpp bftables.cpp blowfish.cpp coding.cpp des.cpp dh.cpp \
22 dsa.cpp file.cpp hash.cpp integer.cpp md2.cpp md4.cpp md5.cpp misc.cpp \22 dsa.cpp file.cpp hash.cpp integer.cpp md2.cpp md4.cpp md5.cpp misc.cpp \
23 random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \23 random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \
24 tftables.cpp twofish.cpp crypto.cpp rabbit.cpp hc128.cpp24 tftables.cpp twofish.cpp rabbit.cpp hc128.cpp
2525
26libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \26libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \
27 @yassl_thread_cxxflags@ -fno-omit-frame-pointer27 @yassl_thread_cxxflags@ -fno-omit-frame-pointer
2828
=== removed file 'Percona-Server/extra/yassl/taocrypt/src/crypto.cpp'
--- Percona-Server/extra/yassl/taocrypt/src/crypto.cpp 2007-08-28 08:35:55 +0000
+++ Percona-Server/extra/yassl/taocrypt/src/crypto.cpp 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
1/*
2 Copyright (C) 2000-2007 MySQL AB
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; see the file COPYING. If not, write to the
15 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
16 MA 02110-1301 USA.
17*/
18
19/* put features that other apps expect from OpenSSL type crypto */
20
21
22
23extern "C" {
24
25 // for libcurl configure test, these are the signatures they use
26 // locking handled internally by library
27 char CRYPTO_lock() { return 0;}
28 char CRYPTO_add_lock() { return 0;}
29
30
31 // for openvpn, test are the signatures they use
32 char EVP_CIPHER_CTX_init() { return 0; }
33 char CRYPTO_mem_ctrl() { return 0; }
34} // extern "C"
35
36
37
380
=== modified file 'Percona-Server/include/welcome_copyright_notice.h'
--- Percona-Server/include/welcome_copyright_notice.h 2011-07-11 16:11:41 +0000
+++ Percona-Server/include/welcome_copyright_notice.h 2012-11-08 17:45:27 +0000
@@ -1,4 +1,4 @@
1/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.1/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
22
3 This program is free software; you can redistribute it and/or modify3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by4 it under the terms of the GNU General Public License as published by
@@ -16,16 +16,21 @@
16#ifndef _welcome_copyright_notice_h_16#ifndef _welcome_copyright_notice_h_
17#define _welcome_copyright_notice_h_17#define _welcome_copyright_notice_h_
1818
19#define COPYRIGHT_NOTICE_CURRENT_YEAR "2012"
20
19/*21/*
20 This define specifies copyright notice which is displayed by every MySQL22 This define specifies copyright notice which is displayed by every MySQL
21 program on start, or on help screen.23 program on start, or on help screen.
22*/24*/
2325#define ORACLE_WELCOME_COPYRIGHT_NOTICE(first_year) \
24#define ORACLE_WELCOME_COPYRIGHT_NOTICE(years) \26 (strcmp(first_year, COPYRIGHT_NOTICE_CURRENT_YEAR) ? \
25 "Copyright (c) " years ", Oracle and/or its affiliates. All rights reserved.\n" \27 "Copyright (c) " first_year ", " COPYRIGHT_NOTICE_CURRENT_YEAR ", " \
26 "\n" \28 "Oracle and/or its affiliates. All rights reserved.\n\nOracle is a " \
27 "Oracle is a registered trademark of Oracle Corporation and/or its\n" \29 "registered trademark of Oracle Corporation and/or its\naffiliates. " \
28 "affiliates. Other names may be trademarks of their respective\n" \30 "Other names may be trademarks of their respective\nowners.\n" : \
29 "owners.\n"31 "Copyright (c) " first_year ", Oracle and/or its affiliates. " \
32 "All rights reserved.\n\nOracle is a registered trademark of " \
33 "Oracle Corporation and/or its\naffiliates. Other names may be " \
34 "trademarks of their respective\nowners.\n")
3035
31#endif /* _welcome_copyright_notice_h_ */36#endif /* _welcome_copyright_notice_h_ */
3237
=== modified file 'Percona-Server/mysql-test/Makefile.am'
--- Percona-Server/mysql-test/Makefile.am 2012-07-10 01:50:02 +0000
+++ Percona-Server/mysql-test/Makefile.am 2012-11-08 17:45:27 +0000
@@ -82,6 +82,7 @@
82 extra/binlog_tests/ extra/rpl_tests \82 extra/binlog_tests/ extra/rpl_tests \
83 suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \83 suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \
84 suite/federated \84 suite/federated \
85 suite/federated/include \
85 suite/funcs_1 suite/funcs_1/bitdata \86 suite/funcs_1 suite/funcs_1/bitdata \
86 suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \87 suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \
87 suite/funcs_1/t suite/funcs_1/views suite/funcs_1/cursors \88 suite/funcs_1/t suite/funcs_1/views suite/funcs_1/cursors \
8889
=== modified file 'Percona-Server/mysql-test/lib/mtr_cases.pm'
--- Percona-Server/mysql-test/lib/mtr_cases.pm 2012-08-20 03:14:02 +0000
+++ Percona-Server/mysql-test/lib/mtr_cases.pm 2012-11-08 17:45:27 +0000
@@ -980,6 +980,39 @@
980 return $tinfo;980 return $tinfo;
981 }981 }
982 }982 }
983 elsif ( $tinfo->{'innodb_plugin_test'} )
984 {
985 # This is a test that needs the innodb plugin
986 if (!&find_innodb_plugin)
987 {
988 # innodb plugin is not supported, skip it
989 $tinfo->{'skip'}= 1;
990 $tinfo->{'comment'}= "No innodb plugin support";
991 return $tinfo;
992 }
993
994 my $sep= (IS_WINDOWS) ? ';' : ':';
995 my $plugin_filename= basename($lib_innodb_plugin);
996 my $plugin_list=
997 "innodb=$plugin_filename$sep" .
998 "innodb_trx=$plugin_filename$sep" .
999 "innodb_locks=$plugin_filename$sep" .
1000 "innodb_lock_waits=$plugin_filename$sep" .
1001 "innodb_cmp=$plugin_filename$sep" .
1002 "innodb_cmp_reset=$plugin_filename$sep" .
1003 "innodb_cmpmem=$plugin_filename$sep" .
1004 "innodb_buffer_page=$plugin_filename$sep" .
1005 "innodb_buffer_page_lru=$plugin_filename$sep" .
1006 "innodb_buffer_pool_stats=$plugin_filename$sep" .
1007 "innodb_cmpmem_reset=$plugin_filename";
1008
1009 foreach my $k ('master_opt', 'slave_opt')
1010 {
1011 push(@{$tinfo->{$k}}, '--ignore-builtin-innodb');
1012 push(@{$tinfo->{$k}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
1013 push(@{$tinfo->{$k}}, "--plugin-load=$plugin_list");
1014 }
1015 }
983 else1016 else
984 {1017 {
985 push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb");1018 push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb");
9861019
=== modified file 'Percona-Server/mysql-test/r/information_schema.result'
--- Percona-Server/mysql-test/r/information_schema.result 2012-08-15 14:05:13 +0000
+++ Percona-Server/mysql-test/r/information_schema.result 2012-11-08 17:45:27 +0000
@@ -89,7 +89,7 @@
89INNODB_LOCK_WAITS89INNODB_LOCK_WAITS
90INNODB_SYS_TABLES90INNODB_SYS_TABLES
91INNODB_CMP91INNODB_CMP
92INNODB_SYS_STATS92INNODB_BUFFER_POOL_STATS
93INNODB_CMP_RESET93INNODB_CMP_RESET
94INNODB_CMPMEM94INNODB_CMPMEM
95INNODB_INDEX_STATS95INNODB_INDEX_STATS
@@ -97,6 +97,9 @@
97INNODB_BUFFER_POOL_PAGES_BLOB97INNODB_BUFFER_POOL_PAGES_BLOB
98INNODB_CMPMEM_RESET98INNODB_CMPMEM_RESET
99INNODB_LOCKS99INNODB_LOCKS
100INNODB_BUFFER_PAGE
101INNODB_SYS_STATS
102INNODB_BUFFER_PAGE_LRU
100columns_priv103columns_priv
101db104db
102event105event
@@ -903,12 +906,14 @@
903VIEWS TABLE_NAME select906VIEWS TABLE_NAME select
904INNODB_TABLE_STATS table_name select907INNODB_TABLE_STATS table_name select
905INNODB_INDEX_STATS table_name select908INNODB_INDEX_STATS table_name select
909INNODB_BUFFER_PAGE TABLE_NAME select
910INNODB_BUFFER_PAGE_LRU TABLE_NAME select
906delete from mysql.user where user='mysqltest_4';911delete from mysql.user where user='mysqltest_4';
907delete from mysql.db where user='mysqltest_4';912delete from mysql.db where user='mysqltest_4';
908flush privileges;913flush privileges;
909SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;914SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
910table_schema count(*)915table_schema count(*)
911information_schema 54916information_schema 57
912mysql 22917mysql 22
913create table t1 (i int, j int);918create table t1 (i int, j int);
914create trigger trg1 before insert on t1 for each row919create trigger trg1 before insert on t1 for each row
@@ -1341,7 +1346,7 @@
1341INNODB_LOCK_WAITS requesting_trx_id1346INNODB_LOCK_WAITS requesting_trx_id
1342INNODB_SYS_TABLES SCHEMA1347INNODB_SYS_TABLES SCHEMA
1343INNODB_CMP page_size1348INNODB_CMP page_size
1344INNODB_SYS_STATS INDEX_ID1349INNODB_BUFFER_POOL_STATS POOL_SIZE
1345INNODB_CMP_RESET page_size1350INNODB_CMP_RESET page_size
1346INNODB_CMPMEM page_size1351INNODB_CMPMEM page_size
1347INNODB_INDEX_STATS table_schema1352INNODB_INDEX_STATS table_schema
@@ -1349,6 +1354,9 @@
1349INNODB_BUFFER_POOL_PAGES_BLOB space_id1354INNODB_BUFFER_POOL_PAGES_BLOB space_id
1350INNODB_CMPMEM_RESET page_size1355INNODB_CMPMEM_RESET page_size
1351INNODB_LOCKS lock_id1356INNODB_LOCKS lock_id
1357INNODB_BUFFER_PAGE BLOCK_ID
1358INNODB_SYS_STATS INDEX_ID
1359INNODB_BUFFER_PAGE_LRU LRU_POSITION
1352SELECT t.table_name, c1.column_name1360SELECT t.table_name, c1.column_name
1353FROM information_schema.tables t1361FROM information_schema.tables t
1354INNER JOIN1362INNER JOIN
@@ -1410,7 +1418,7 @@
1410INNODB_LOCK_WAITS requesting_trx_id1418INNODB_LOCK_WAITS requesting_trx_id
1411INNODB_SYS_TABLES SCHEMA1419INNODB_SYS_TABLES SCHEMA
1412INNODB_CMP page_size1420INNODB_CMP page_size
1413INNODB_SYS_STATS INDEX_ID1421INNODB_BUFFER_POOL_STATS POOL_SIZE
1414INNODB_CMP_RESET page_size1422INNODB_CMP_RESET page_size
1415INNODB_CMPMEM page_size1423INNODB_CMPMEM page_size
1416INNODB_INDEX_STATS table_schema1424INNODB_INDEX_STATS table_schema
@@ -1418,6 +1426,9 @@
1418INNODB_BUFFER_POOL_PAGES_BLOB space_id1426INNODB_BUFFER_POOL_PAGES_BLOB space_id
1419INNODB_CMPMEM_RESET page_size1427INNODB_CMPMEM_RESET page_size
1420INNODB_LOCKS lock_id1428INNODB_LOCKS lock_id
1429INNODB_BUFFER_PAGE BLOCK_ID
1430INNODB_SYS_STATS INDEX_ID
1431INNODB_BUFFER_PAGE_LRU LRU_POSITION
1421SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');1432SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
1422MAX(table_name)1433MAX(table_name)
1423XTRADB_ADMIN_COMMAND1434XTRADB_ADMIN_COMMAND
@@ -1497,9 +1508,12 @@
1497GLOBAL_TEMPORARY_TABLES information_schema.GLOBAL_TEMPORARY_TABLES 11508GLOBAL_TEMPORARY_TABLES information_schema.GLOBAL_TEMPORARY_TABLES 1
1498GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 11509GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
1499INDEX_STATISTICS information_schema.INDEX_STATISTICS 11510INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
1511INNODB_BUFFER_PAGE information_schema.INNODB_BUFFER_PAGE 1
1512INNODB_BUFFER_PAGE_LRU information_schema.INNODB_BUFFER_PAGE_LRU 1
1500INNODB_BUFFER_POOL_PAGES information_schema.INNODB_BUFFER_POOL_PAGES 11513INNODB_BUFFER_POOL_PAGES information_schema.INNODB_BUFFER_POOL_PAGES 1
1501INNODB_BUFFER_POOL_PAGES_BLOB information_schema.INNODB_BUFFER_POOL_PAGES_BLOB 11514INNODB_BUFFER_POOL_PAGES_BLOB information_schema.INNODB_BUFFER_POOL_PAGES_BLOB 1
1502INNODB_BUFFER_POOL_PAGES_INDEX information_schema.INNODB_BUFFER_POOL_PAGES_INDEX 11515INNODB_BUFFER_POOL_PAGES_INDEX information_schema.INNODB_BUFFER_POOL_PAGES_INDEX 1
1516INNODB_BUFFER_POOL_STATS information_schema.INNODB_BUFFER_POOL_STATS 1
1503INNODB_CHANGED_PAGES information_schema.INNODB_CHANGED_PAGES 11517INNODB_CHANGED_PAGES information_schema.INNODB_CHANGED_PAGES 1
1504INNODB_CMP information_schema.INNODB_CMP 11518INNODB_CMP information_schema.INNODB_CMP 1
1505INNODB_CMPMEM information_schema.INNODB_CMPMEM 11519INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
15061520
=== modified file 'Percona-Server/mysql-test/r/information_schema_db.result'
--- Percona-Server/mysql-test/r/information_schema_db.result 2012-08-15 14:05:13 +0000
+++ Percona-Server/mysql-test/r/information_schema_db.result 2012-11-08 17:45:27 +0000
@@ -51,7 +51,7 @@
51INNODB_LOCK_WAITS51INNODB_LOCK_WAITS
52INNODB_SYS_TABLES52INNODB_SYS_TABLES
53INNODB_CMP53INNODB_CMP
54INNODB_SYS_STATS54INNODB_BUFFER_POOL_STATS
55INNODB_CMP_RESET55INNODB_CMP_RESET
56INNODB_CMPMEM56INNODB_CMPMEM
57INNODB_INDEX_STATS57INNODB_INDEX_STATS
@@ -59,6 +59,9 @@
59INNODB_BUFFER_POOL_PAGES_BLOB59INNODB_BUFFER_POOL_PAGES_BLOB
60INNODB_CMPMEM_RESET60INNODB_CMPMEM_RESET
61INNODB_LOCKS61INNODB_LOCKS
62INNODB_BUFFER_PAGE
63INNODB_SYS_STATS
64INNODB_BUFFER_PAGE_LRU
62show tables from INFORMATION_SCHEMA like 'T%';65show tables from INFORMATION_SCHEMA like 'T%';
63Tables_in_information_schema (T%)66Tables_in_information_schema (T%)
64TABLES67TABLES
6568
=== modified file 'Percona-Server/mysql-test/r/mysqlshow.result'
--- Percona-Server/mysql-test/r/mysqlshow.result 2012-08-15 14:05:13 +0000
+++ Percona-Server/mysql-test/r/mysqlshow.result 2012-11-08 17:45:27 +0000
@@ -125,7 +125,7 @@
125| INNODB_LOCK_WAITS |125| INNODB_LOCK_WAITS |
126| INNODB_SYS_TABLES |126| INNODB_SYS_TABLES |
127| INNODB_CMP |127| INNODB_CMP |
128| INNODB_SYS_STATS |128| INNODB_BUFFER_POOL_STATS |
129| INNODB_CMP_RESET |129| INNODB_CMP_RESET |
130| INNODB_CMPMEM |130| INNODB_CMPMEM |
131| INNODB_INDEX_STATS |131| INNODB_INDEX_STATS |
@@ -133,6 +133,9 @@
133| INNODB_BUFFER_POOL_PAGES_BLOB |133| INNODB_BUFFER_POOL_PAGES_BLOB |
134| INNODB_CMPMEM_RESET |134| INNODB_CMPMEM_RESET |
135| INNODB_LOCKS |135| INNODB_LOCKS |
136| INNODB_BUFFER_PAGE |
137| INNODB_SYS_STATS |
138| INNODB_BUFFER_PAGE_LRU |
136+---------------------------------------+139+---------------------------------------+
137Database: INFORMATION_SCHEMA140Database: INFORMATION_SCHEMA
138+---------------------------------------+141+---------------------------------------+
@@ -184,7 +187,7 @@
184| INNODB_LOCK_WAITS |187| INNODB_LOCK_WAITS |
185| INNODB_SYS_TABLES |188| INNODB_SYS_TABLES |
186| INNODB_CMP |189| INNODB_CMP |
187| INNODB_SYS_STATS |190| INNODB_BUFFER_POOL_STATS |
188| INNODB_CMP_RESET |191| INNODB_CMP_RESET |
189| INNODB_CMPMEM |192| INNODB_CMPMEM |
190| INNODB_INDEX_STATS |193| INNODB_INDEX_STATS |
@@ -192,6 +195,9 @@
192| INNODB_BUFFER_POOL_PAGES_BLOB |195| INNODB_BUFFER_POOL_PAGES_BLOB |
193| INNODB_CMPMEM_RESET |196| INNODB_CMPMEM_RESET |
194| INNODB_LOCKS |197| INNODB_LOCKS |
198| INNODB_BUFFER_PAGE |
199| INNODB_SYS_STATS |
200| INNODB_BUFFER_PAGE_LRU |
195+---------------------------------------+201+---------------------------------------+
196Wildcard: inf_rmation_schema202Wildcard: inf_rmation_schema
197+--------------------+203+--------------------+
198204
=== modified file 'Percona-Server/mysql-test/r/openssl_1.result'
--- Percona-Server/mysql-test/r/openssl_1.result 2010-01-29 14:54:27 +0000
+++ Percona-Server/mysql-test/r/openssl_1.result 2012-11-08 17:45:27 +0000
@@ -44,9 +44,9 @@
44drop user ssl_user1@localhost, ssl_user2@localhost,44drop user ssl_user1@localhost, ssl_user2@localhost,
45ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;45ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
46drop table t1;46drop table t1;
47mysqltest: Could not open connection 'default': 2026 SSL connection error47mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
48mysqltest: Could not open connection 'default': 2026 SSL connection error48mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
49mysqltest: Could not open connection 'default': 2026 SSL connection error49mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
50SSL error: Unable to get private key from ''50SSL error: Unable to get private key from ''
51mysqltest: Could not open connection 'default': 2026 SSL connection error51mysqltest: Could not open connection 'default': 2026 SSL connection error
52SSL error: Unable to get certificate from ''52SSL error: Unable to get certificate from ''
5353
=== modified file 'Percona-Server/mysql-test/r/subselect.result'
--- Percona-Server/mysql-test/r/subselect.result 2012-03-27 12:39:27 +0000
+++ Percona-Server/mysql-test/r/subselect.result 2012-11-08 17:45:27 +0000
@@ -4555,8 +4555,6 @@
4555WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);4555WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
4556pk a4556pk a
45571 1045571 10
45583 30
45592 20
4560DROP TABLE t1,t2;4558DROP TABLE t1,t2;
4561CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), KEY b (b));4559CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), KEY b (b));
4562INSERT INTO t1 VALUES (1,NULL), (9,NULL);4560INSERT INTO t1 VALUES (1,NULL), (9,NULL);
45634561
=== modified file 'Percona-Server/mysql-test/suite/federated/federated.test'
--- Percona-Server/mysql-test/suite/federated/federated.test 2010-03-05 10:51:37 +0000
+++ Percona-Server/mysql-test/suite/federated/federated.test 2012-11-08 17:45:27 +0000
@@ -6,7 +6,7 @@
66
7# should work with embedded server after mysqltest is fixed7# should work with embedded server after mysqltest is fixed
8--source include/not_embedded.inc8--source include/not_embedded.inc
9--source federated.inc9--source suite/federated/include/federated.inc
1010
11connection default;11connection default;
1212
@@ -1999,4 +1999,4 @@
1999SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;1999SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
20002000
2001connection default;2001connection default;
2002source federated_cleanup.inc;2002source suite/federated/include/federated_cleanup.inc;
20032003
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_archive.test'
--- Percona-Server/mysql-test/suite/federated/federated_archive.test 2007-12-12 17:19:24 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_archive.test 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1source include/have_archive.inc;1source include/have_archive.inc;
2source federated.inc;2source suite/federated/include/federated.inc;
33
44
5connection slave;5connection slave;
@@ -54,5 +54,5 @@
54DROP TABLE federated.archive_table;54DROP TABLE federated.archive_table;
5555
5656
57source federated_cleanup.inc;57source suite/federated/include/federated_cleanup.inc;
5858
5959
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_bug_13118.test'
--- Percona-Server/mysql-test/suite/federated/federated_bug_13118.test 2007-12-12 17:19:24 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_bug_13118.test 2012-11-08 17:45:27 +0000
@@ -1,4 +1,4 @@
1source federated.inc;1source suite/federated/include/federated.inc;
22
3connection slave;3connection slave;
4--disable_warnings4--disable_warnings
@@ -37,5 +37,5 @@
37DROP TABLE federated.bug_13118_table;37DROP TABLE federated.bug_13118_table;
3838
3939
40source federated_cleanup.inc;40source suite/federated/include/federated_cleanup.inc;
4141
4242
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_bug_25714.test'
--- Percona-Server/mysql-test/suite/federated/federated_bug_25714.test 2009-02-02 11:36:03 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_bug_25714.test 2012-11-08 17:45:27 +0000
@@ -4,7 +4,7 @@
4 skip Need bug25714 test program;4 skip Need bug25714 test program;
5}5}
66
7source federated.inc;7source suite/federated/include/federated.inc;
88
9connection master;9connection master;
10# Disable concurrent inserts to avoid test failures when reading10# Disable concurrent inserts to avoid test failures when reading
@@ -59,4 +59,4 @@
5959
6060
6161
62source federated_cleanup.inc;62source suite/federated/include/federated_cleanup.inc;
6363
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_bug_35333.test'
--- Percona-Server/mysql-test/suite/federated/federated_bug_35333.test 2010-11-30 04:46:43 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_bug_35333.test 2012-11-08 17:45:27 +0000
@@ -9,7 +9,7 @@
9--echo # to complete while still indicating a problem. This fix applies to any non-fatal system9--echo # to complete while still indicating a problem. This fix applies to any non-fatal system
10--echo # error that occurs during a query against I_S.TABLES.de10--echo # error that occurs during a query against I_S.TABLES.de
1111
12--source federated.inc12--source suite/federated/include/federated.inc
1313
14--disable_warnings14--disable_warnings
15CREATE DATABASE IF NOT EXISTS realdb;15CREATE DATABASE IF NOT EXISTS realdb;
@@ -71,4 +71,4 @@
71DROP DATABASE realdb;71DROP DATABASE realdb;
72--enable_warnings72--enable_warnings
7373
74--source federated_cleanup.inc74--source suite/federated/include/federated_cleanup.inc
7575
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_debug.test'
--- Percona-Server/mysql-test/suite/federated/federated_debug.test 2009-09-30 22:25:06 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_debug.test 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1--source include/have_debug.inc1--source include/have_debug.inc
2--source federated.inc2--source suite/federated/include/federated.inc
33
4--echo #4--echo #
5--echo # Bug#47525: MySQL crashed (Federated)5--echo # Bug#47525: MySQL crashed (Federated)
@@ -36,4 +36,4 @@
3636
37connection default;37connection default;
38--echo # Federated cleanup38--echo # Federated cleanup
39source federated_cleanup.inc;39source suite/federated/include/federated_cleanup.inc;
4040
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_innodb.test'
--- Percona-Server/mysql-test/suite/federated/federated_innodb.test 2008-12-13 19:42:12 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_innodb.test 2012-11-08 17:45:27 +0000
@@ -4,7 +4,7 @@
4# See Bug #40645 Test main.federated_innodb does not always clean up after itself4# See Bug #40645 Test main.federated_innodb does not always clean up after itself
55
6source include/have_innodb.inc;6source include/have_innodb.inc;
7source federated.inc;7source suite/federated/include/federated.inc;
88
9#9#
10# Bug#25513 Federated transaction failures10# Bug#25513 Federated transaction failures
@@ -36,4 +36,4 @@
36drop table federated.t1;36drop table federated.t1;
3737
3838
39source federated_cleanup.inc;39source suite/federated/include/federated_cleanup.inc;
4040
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_server.test'
--- Percona-Server/mysql-test/suite/federated/federated_server.test 2012-04-02 02:09:15 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_server.test 2012-11-08 17:45:27 +0000
@@ -1,6 +1,6 @@
1# WL #3031 This test tests the new servers table as well as1# WL #3031 This test tests the new servers table as well as
2# if federated can utilise the servers table2# if federated can utilise the servers table
3-- source federated.inc3-- source suite/federated/include/federated.inc
44
5connection slave;5connection slave;
6create database first_db;6create database first_db;
@@ -333,4 +333,4 @@
333drop server if exists s;333drop server if exists s;
334334
335335
336source federated_cleanup.inc;336source suite/federated/include/federated_cleanup.inc;
337337
=== modified file 'Percona-Server/mysql-test/suite/federated/federated_transactions.test'
--- Percona-Server/mysql-test/suite/federated/federated_transactions.test 2007-12-12 17:19:24 +0000
+++ Percona-Server/mysql-test/suite/federated/federated_transactions.test 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1source include/have_innodb.inc;1source include/have_innodb.inc;
2source federated.inc;2source suite/federated/include/federated.inc;
33
4connection slave;4connection slave;
5DROP TABLE IF EXISTS federated.t1;5DROP TABLE IF EXISTS federated.t1;
@@ -35,4 +35,4 @@
35SELECT * FROM federated.t1;35SELECT * FROM federated.t1;
36DELETE FROM federated.t1;36DELETE FROM federated.t1;
3737
38source federated_cleanup.inc;38source suite/federated/include/federated_cleanup.inc;
3939
=== added directory 'Percona-Server/mysql-test/suite/federated/include'
=== renamed file 'Percona-Server/mysql-test/suite/federated/federated.inc' => 'Percona-Server/mysql-test/suite/federated/include/federated.inc'
--- Percona-Server/mysql-test/suite/federated/federated.inc 2009-02-02 11:36:03 +0000
+++ Percona-Server/mysql-test/suite/federated/include/federated.inc 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1--source include/not_embedded.inc1--source include/not_embedded.inc
2--source have_federated_db.inc2--source suite/federated/include/have_federated_db.inc
33
4connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);4connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
5connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);5connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
66
=== renamed file 'Percona-Server/mysql-test/suite/federated/federated_cleanup.inc' => 'Percona-Server/mysql-test/suite/federated/include/federated_cleanup.inc'
=== renamed file 'Percona-Server/mysql-test/suite/federated/have_federated_db.inc' => 'Percona-Server/mysql-test/suite/federated/include/have_federated_db.inc'
=== modified file 'Percona-Server/mysql-test/suite/funcs_1/t/is_engines_federated.test'
--- Percona-Server/mysql-test/suite/funcs_1/t/is_engines_federated.test 2009-01-31 19:22:59 +0000
+++ Percona-Server/mysql-test/suite/funcs_1/t/is_engines_federated.test 2012-11-08 17:45:27 +0000
@@ -9,7 +9,7 @@
9#9#
1010
11let $engine_type= FEDERATED;11let $engine_type= FEDERATED;
12--source suite/federated/have_federated_db.inc12--source suite/federated/include/have_federated_db.inc
13--vertical_results13--vertical_results
14eval SELECT * FROM information_schema.engines14eval SELECT * FROM information_schema.engines
15WHERE ENGINE = '$engine_type';15WHERE ENGINE = '$engine_type';
1616
=== modified file 'Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-index.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-index.result 2012-02-02 11:38:32 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-index.result 2012-11-08 17:45:27 +0000
@@ -1096,7 +1096,7 @@
1096INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7731));1096INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7731));
1097COMMIT;1097COMMIT;
1098UPDATE bug12547647 SET c = REPEAT('b',16928);1098UPDATE bug12547647 SET c = REPEAT('b',16928);
1099ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs1099ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
1100DROP TABLE bug12547647;1100DROP TABLE bug12547647;
1101SET @r=REPEAT('a',500);1101SET @r=REPEAT('a',500);
1102CREATE TABLE t1(a INT,1102CREATE TABLE t1(a INT,
11031103
=== modified file 'Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-zip.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-zip.result 2011-08-08 08:22:18 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/innodb-zip.result 2012-11-08 17:45:27 +0000
@@ -125,12 +125,12 @@
125c TEXT NOT NULL, d TEXT NOT NULL,125c TEXT NOT NULL, d TEXT NOT NULL,
126PRIMARY KEY (c(767),d(767)))126PRIMARY KEY (c(767),d(767)))
127ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;127ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
128ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs128ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
129CREATE TABLE t1(129CREATE TABLE t1(
130c TEXT NOT NULL, d TEXT NOT NULL,130c TEXT NOT NULL, d TEXT NOT NULL,
131PRIMARY KEY (c(767),d(767)))131PRIMARY KEY (c(767),d(767)))
132ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;132ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
133ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs133ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
134CREATE TABLE t1(134CREATE TABLE t1(
135c TEXT NOT NULL, d TEXT NOT NULL,135c TEXT NOT NULL, d TEXT NOT NULL,
136PRIMARY KEY (c(767),d(767)))136PRIMARY KEY (c(767),d(767)))
@@ -138,7 +138,7 @@
138drop table t1;138drop table t1;
139CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))139CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
140ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;140ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
141ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs141ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
142CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))142CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
143ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;143ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
144INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));144INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
145145
=== modified file 'Percona-Server/mysql-test/suite/innodb_plugin/r/innodb.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/innodb.result 2011-12-13 08:56:12 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/innodb.result 2012-11-08 17:45:27 +0000
@@ -3151,7 +3151,7 @@
3151c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),3151c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
3152c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)3152c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
3153) ENGINE = InnoDB;3153) ENGINE = InnoDB;
3154ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs3154ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
3155DROP TABLE IF EXISTS t1;3155DROP TABLE IF EXISTS t1;
3156Warnings:3156Warnings:
3157Note 1051 Unknown table 't1'3157Note 1051 Unknown table 't1'
31583158
=== modified file 'Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result 2011-09-27 10:56:05 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result 2012-11-08 17:45:27 +0000
@@ -8,7 +8,7 @@
8SHOW WARNINGS;8SHOW WARNINGS;
9Level Code Message9Level Code Message
10Error 139 Too big row10Error 139 Too big row
11Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs11Error 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
12Error 1030 Got error 139 from storage engine12Error 1030 Got error 139 from storage engine
13DROP TABLE bug53591;13DROP TABLE bug53591;
14SET GLOBAL innodb_file_format=Antelope;14SET GLOBAL innodb_file_format=Antelope;
1515
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_information_schema_buffer.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_information_schema_buffer.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_information_schema_buffer.result 2012-11-08 17:45:27 +0000
@@ -0,0 +1,127 @@
1SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
2SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
3SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
4SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
5CREATE TABLE infoschema_buffer_test (col1 INT) ENGINE = INNODB;
6INSERT INTO infoschema_buffer_test VALUES(9);
7SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
8FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
9WHERE TABLE_NAME like "%infoschema_buffer_test"
10 and PAGE_STATE="file_page" and PAGE_TYPE="index";
11TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
12test/infoschema_buffer_test GEN_CLUST_INDEX 1 29 FILE_PAGE INDEX
13INSERT INTO infoschema_buffer_test VALUES(19);
14SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
15FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
16WHERE TABLE_NAME like "%infoschema_buffer_test"
17and PAGE_STATE="file_page" and PAGE_TYPE="index";
18TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
19test/infoschema_buffer_test GEN_CLUST_INDEX 2 58 FILE_PAGE INDEX
20CREATE INDEX idx ON infoschema_buffer_test(col1);
21SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
22FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
23WHERE TABLE_NAME like "%infoschema_buffer_test"
24and PAGE_STATE="file_page" and INDEX_NAME = "idx" and PAGE_TYPE="index";
25TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
26test/infoschema_buffer_test idx 2 32 FILE_PAGE INDEX
27DROP TABLE infoschema_buffer_test;
28SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
29FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
30WHERE TABLE_NAME like "%infoschema_buffer_test";
31TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE PAGE_STATE PAGE_TYPE
32CREATE TABLE infoschema_parent (id INT NOT NULL, PRIMARY KEY (id))
33ENGINE=INNODB;
34CREATE TABLE infoschema_child (id INT, parent_id INT, INDEX par_ind (parent_id),
35FOREIGN KEY (parent_id)
36REFERENCES infoschema_parent(id)
37ON DELETE CASCADE)
38ENGINE=INNODB;
39SELECT count(*)
40FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
41WHERE TABLE_NAME like "%infoschema_child" and PAGE_STATE="file_page"
42and PAGE_TYPE="index";
43count(*)
442
45DROP TABLE infoschema_child;
46DROP TABLE infoschema_parent;
47show create table information_schema.innodb_buffer_page;
48Table Create Table
49INNODB_BUFFER_PAGE CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE` (
50 `BLOCK_ID` bigint(21) unsigned NOT NULL DEFAULT '0',
51 `SPACE` bigint(21) unsigned NOT NULL DEFAULT '0',
52 `PAGE_NUMBER` bigint(21) unsigned NOT NULL DEFAULT '0',
53 `PAGE_TYPE` varchar(64) DEFAULT NULL,
54 `FLUSH_TYPE` bigint(21) unsigned NOT NULL DEFAULT '0',
55 `FIX_COUNT` bigint(21) unsigned NOT NULL DEFAULT '0',
56 `IS_HASHED` varchar(3) DEFAULT NULL,
57 `NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
58 `OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
59 `ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT '0',
60 `TABLE_NAME` varchar(1024) DEFAULT NULL,
61 `INDEX_NAME` varchar(1024) DEFAULT NULL,
62 `NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT '0',
63 `DATA_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
64 `COMPRESSED_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
65 `PAGE_STATE` varchar(64) DEFAULT NULL,
66 `IO_FIX` varchar(64) DEFAULT NULL,
67 `IS_OLD` varchar(3) DEFAULT NULL,
68 `FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL DEFAULT '0'
69) ENGINE=MEMORY DEFAULT CHARSET=utf8
70show create table information_schema.innodb_buffer_page_lru;
71Table Create Table
72INNODB_BUFFER_PAGE_LRU CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE_LRU` (
73 `LRU_POSITION` bigint(21) unsigned NOT NULL DEFAULT '0',
74 `SPACE` bigint(21) unsigned NOT NULL DEFAULT '0',
75 `PAGE_NUMBER` bigint(21) unsigned NOT NULL DEFAULT '0',
76 `PAGE_TYPE` varchar(64) DEFAULT NULL,
77 `FLUSH_TYPE` bigint(21) unsigned NOT NULL DEFAULT '0',
78 `FIX_COUNT` bigint(21) unsigned NOT NULL DEFAULT '0',
79 `IS_HASHED` varchar(3) DEFAULT NULL,
80 `NEWEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
81 `OLDEST_MODIFICATION` bigint(21) unsigned NOT NULL DEFAULT '0',
82 `ACCESS_TIME` bigint(21) unsigned NOT NULL DEFAULT '0',
83 `TABLE_NAME` varchar(1024) DEFAULT NULL,
84 `INDEX_NAME` varchar(1024) DEFAULT NULL,
85 `NUMBER_RECORDS` bigint(21) unsigned NOT NULL DEFAULT '0',
86 `DATA_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
87 `COMPRESSED_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
88 `COMPRESSED` varchar(3) DEFAULT NULL,
89 `IO_FIX` varchar(64) DEFAULT NULL,
90 `IS_OLD` varchar(3) DEFAULT NULL,
91 `FREE_PAGE_CLOCK` bigint(21) unsigned NOT NULL DEFAULT '0'
92) ENGINE=MEMORY DEFAULT CHARSET=utf8
93show create table information_schema.innodb_buffer_pool_stats;
94Table Create Table
95INNODB_BUFFER_POOL_STATS CREATE TEMPORARY TABLE `INNODB_BUFFER_POOL_STATS` (
96 `POOL_SIZE` bigint(21) unsigned NOT NULL DEFAULT '0',
97 `FREE_BUFFERS` bigint(21) unsigned NOT NULL DEFAULT '0',
98 `DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT '0',
99 `OLD_DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT '0',
100 `MODIFIED_DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT '0',
101 `PENDING_DECOMPRESS` bigint(21) unsigned NOT NULL DEFAULT '0',
102 `PENDING_READS` bigint(21) unsigned NOT NULL DEFAULT '0',
103 `PENDING_FLUSH_LRU` bigint(21) unsigned NOT NULL DEFAULT '0',
104 `PENDING_FLUSH_LIST` bigint(21) unsigned NOT NULL DEFAULT '0',
105 `PAGES_MADE_YOUNG` bigint(21) unsigned NOT NULL DEFAULT '0',
106 `PAGES_NOT_MADE_YOUNG` bigint(21) unsigned NOT NULL DEFAULT '0',
107 `PAGES_MADE_YOUNG_RATE` double NOT NULL DEFAULT '0',
108 `PAGES_MADE_NOT_YOUNG_RATE` double NOT NULL DEFAULT '0',
109 `NUMBER_PAGES_READ` bigint(21) unsigned NOT NULL DEFAULT '0',
110 `NUMBER_PAGES_CREATED` bigint(21) unsigned NOT NULL DEFAULT '0',
111 `NUMBER_PAGES_WRITTEN` bigint(21) unsigned NOT NULL DEFAULT '0',
112 `PAGES_READ_RATE` double NOT NULL DEFAULT '0',
113 `PAGES_CREATE_RATE` double NOT NULL DEFAULT '0',
114 `PAGES_WRITTEN_RATE` double NOT NULL DEFAULT '0',
115 `NUMBER_PAGES_GET` bigint(21) unsigned NOT NULL DEFAULT '0',
116 `HIT_RATE` bigint(21) unsigned NOT NULL DEFAULT '0',
117 `YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL DEFAULT '0',
118 `NOT_YOUNG_MAKE_PER_THOUSAND_GETS` bigint(21) unsigned NOT NULL DEFAULT '0',
119 `NUMBER_PAGES_READ_AHEAD` bigint(21) unsigned NOT NULL DEFAULT '0',
120 `NUMBER_READ_AHEAD_EVICTED` bigint(21) unsigned NOT NULL DEFAULT '0',
121 `READ_AHEAD_RATE` double NOT NULL DEFAULT '0',
122 `READ_AHEAD_EVICTED_RATE` double NOT NULL DEFAULT '0',
123 `LRU_IO_TOTAL` bigint(21) unsigned NOT NULL DEFAULT '0',
124 `LRU_IO_CURRENT` bigint(21) unsigned NOT NULL DEFAULT '0',
125 `UNCOMPRESS_TOTAL` bigint(21) unsigned NOT NULL DEFAULT '0',
126 `UNCOMPRESS_CURRENT` bigint(21) unsigned NOT NULL DEFAULT '0'
127) ENGINE=MEMORY DEFAULT CHARSET=utf8
0128
=== modified file 'Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_misc1.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_misc1.result 2011-10-26 06:38:28 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/innodb_misc1.result 2012-11-08 17:45:27 +0000
@@ -774,7 +774,7 @@
774c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),774c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
775c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)775c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
776) ENGINE = InnoDB;776) ENGINE = InnoDB;
777ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs777ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
778SET innodb_strict_mode=OFF;778SET innodb_strict_mode=OFF;
779DROP TABLE IF EXISTS t1;779DROP TABLE IF EXISTS t1;
780Warnings:780Warnings:
781781
=== modified file 'Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result'
--- Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result 2012-08-15 14:05:13 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/r/percona_skip_innodb_i_s.result 2012-11-08 17:45:27 +0000
@@ -1,8 +1,11 @@
1SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'INNODB%' ORDER BY TABLE_NAME;1SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' AND TABLE_NAME LIKE 'INNODB%' ORDER BY TABLE_NAME;
2TABLE_NAME2TABLE_NAME
3INNODB_BUFFER_PAGE
4INNODB_BUFFER_PAGE_LRU
3INNODB_BUFFER_POOL_PAGES5INNODB_BUFFER_POOL_PAGES
4INNODB_BUFFER_POOL_PAGES_BLOB6INNODB_BUFFER_POOL_PAGES_BLOB
5INNODB_BUFFER_POOL_PAGES_INDEX7INNODB_BUFFER_POOL_PAGES_INDEX
8INNODB_BUFFER_POOL_STATS
6INNODB_CHANGED_PAGES9INNODB_CHANGED_PAGES
7INNODB_CMP10INNODB_CMP
8INNODB_CMPMEM11INNODB_CMPMEM
912
=== added file 'Percona-Server/mysql-test/suite/innodb_plugin/t/innodb_information_schema_buffer.test'
--- Percona-Server/mysql-test/suite/innodb_plugin/t/innodb_information_schema_buffer.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/innodb_plugin/t/innodb_information_schema_buffer.test 2012-11-08 17:45:27 +0000
@@ -0,0 +1,76 @@
1# Exercise the code path for INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS
2# and INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
3
4-- source include/have_innodb_plugin.inc
5
6-- disable_result_log
7SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
8
9# How many buffer pools we have
10SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
11
12SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
13
14# This gives the over all buffer pool size
15SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
16
17-- enable_result_log
18
19# Create a table and check its page info behave correctly in the pool
20CREATE TABLE infoschema_buffer_test (col1 INT) ENGINE = INNODB;
21
22INSERT INTO infoschema_buffer_test VALUES(9);
23
24# We should be able to see this table in the buffer pool if we check
25# right away
26SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
27FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
28WHERE TABLE_NAME like "%infoschema_buffer_test"
29 and PAGE_STATE="file_page" and PAGE_TYPE="index";
30
31# The NUMBER_RECORDS and DATA_SIZE should check with each insertion
32INSERT INTO infoschema_buffer_test VALUES(19);
33
34SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
35FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
36WHERE TABLE_NAME like "%infoschema_buffer_test"
37and PAGE_STATE="file_page" and PAGE_TYPE="index";
38
39CREATE INDEX idx ON infoschema_buffer_test(col1);
40
41SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
42FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
43WHERE TABLE_NAME like "%infoschema_buffer_test"
44and PAGE_STATE="file_page" and INDEX_NAME = "idx" and PAGE_TYPE="index";
45
46
47# Check the buffer after dropping the table
48DROP TABLE infoschema_buffer_test;
49
50SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
51FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
52WHERE TABLE_NAME like "%infoschema_buffer_test";
53
54# Do one more test
55#--replace_regex /'*[0-9]*'/'NUM'/
56CREATE TABLE infoschema_parent (id INT NOT NULL, PRIMARY KEY (id))
57ENGINE=INNODB;
58
59CREATE TABLE infoschema_child (id INT, parent_id INT, INDEX par_ind (parent_id),
60 FOREIGN KEY (parent_id)
61 REFERENCES infoschema_parent(id)
62 ON DELETE CASCADE)
63ENGINE=INNODB;
64
65SELECT count(*)
66FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
67WHERE TABLE_NAME like "%infoschema_child" and PAGE_STATE="file_page"
68and PAGE_TYPE="index";
69
70DROP TABLE infoschema_child;
71DROP TABLE infoschema_parent;
72
73show create table information_schema.innodb_buffer_page;
74show create table information_schema.innodb_buffer_page_lru;
75show create table information_schema.innodb_buffer_pool_stats;
76
077
=== modified file 'Percona-Server/mysql-test/t/openssl_1.test'
--- Percona-Server/mysql-test/t/openssl_1.test 2010-01-29 14:54:27 +0000
+++ Percona-Server/mysql-test/t/openssl_1.test 2012-11-08 17:45:27 +0000
@@ -73,22 +73,28 @@
73# a different cacert73# a different cacert
74#74#
75--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql75--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql
76--replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
76--error 177--error 1
77--exec $MYSQL_TEST --ssl-ca=$MYSQL_TEST_DIR/std_data/untrusted-cacert.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&178--exec $MYSQL_TEST --ssl-ca=$MYSQL_TEST_DIR/std_data/untrusted-cacert.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
79--echo
7880
79#81#
80# Test that we can't open connection to server if we are using82# Test that we can't open connection to server if we are using
81# a blank ca83# a blank ca
82#84#
85--replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
83--error 186--error 1
84--exec $MYSQL_TEST --ssl-ca= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&187--exec $MYSQL_TEST --ssl-ca= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
88--echo
8589
86#90#
87# Test that we can't open connection to server if we are using91# Test that we can't open connection to server if we are using
88# a nonexistent ca file92# a nonexistent ca file
89#93#
94--replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
90--error 195--error 1
91--exec $MYSQL_TEST --ssl-ca=nonexisting_file.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&196--exec $MYSQL_TEST --ssl-ca=nonexisting_file.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
97--echo
9298
93#99#
94# Test that we can't open connection to server if we are using100# Test that we can't open connection to server if we are using
95101
=== modified file 'Percona-Server/mysql-test/t/partition_federated.test'
--- Percona-Server/mysql-test/t/partition_federated.test 2007-12-12 17:19:24 +0000
+++ Percona-Server/mysql-test/t/partition_federated.test 2012-11-08 17:45:27 +0000
@@ -3,7 +3,7 @@
3#3#
4-- source include/have_partition.inc4-- source include/have_partition.inc
5-- source include/not_embedded.inc5-- source include/not_embedded.inc
6-- source suite/federated/have_federated_db.inc6-- source suite/federated/include/have_federated_db.inc
77
8--disable_warnings8--disable_warnings
9drop table if exists t1;9drop table if exists t1;
1010
=== modified file 'Percona-Server/scripts/mysql_secure_installation.pl.in'
--- Percona-Server/scripts/mysql_secure_installation.pl.in 2011-06-30 15:37:13 +0000
+++ Percona-Server/scripts/mysql_secure_installation.pl.in 2012-11-08 17:45:27 +0000
@@ -1,7 +1,7 @@
1#!/usr/bin/perl1#!/usr/bin/perl
2# -*- cperl -*-2# -*- cperl -*-
3#3#
4# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.4# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
5#5#
6# This program is free software; you can redistribute it and/or modify6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by7# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
28my $rootpass = "";28my $rootpass = "";
2929
3030
31$SIG{QUIT} = $SIG{INT} = sub {31$SIG{QUIT} = $SIG{INT} = $SIG{TERM} = $SIG{ABRT} = $SIG{HUP} = sub {
32 print "\nAborting!\n\n";32 print "\nAborting!\n\n";
33 echo_on();33 echo_on();
34 cleanup();34 cleanup();
@@ -242,7 +242,11 @@
242}242}
243243
244sub cleanup {244sub cleanup {
245 unlink($config,$command);245 print "Cleaning up...\n";
246
247 foreach my $file ($config, $command) {
248 unlink $file or warn "Warning: Could not unlink $file: $!\n";
249 }
246}250}
247251
248252
249253
=== modified file 'Percona-Server/scripts/mysql_secure_installation.sh'
--- Percona-Server/scripts/mysql_secure_installation.sh 2011-06-30 15:37:13 +0000
+++ Percona-Server/scripts/mysql_secure_installation.sh 2012-11-08 17:45:27 +0000
@@ -1,6 +1,6 @@
1#!/bin/sh1#!/bin/sh
22
3# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.3# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
4# 4#
5# This program is free software; you can redistribute it and/or modify5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by6# it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
19command=".mysql.$$"19command=".mysql.$$"
20mysql_client=""20mysql_client=""
2121
22trap "interrupt" 222trap "interrupt" 1 2 3 6 15
2323
24rootpass=""24rootpass=""
25echo_n=25echo_n=
@@ -139,13 +139,16 @@
139 if [ $? -eq 0 ]; then139 if [ $? -eq 0 ]; then
140 echo "Password updated successfully!"140 echo "Password updated successfully!"
141 echo "Reloading privilege tables.."141 echo "Reloading privilege tables.."
142 reload_privilege_tables || exit 1142 reload_privilege_tables
143 if [ $? -eq 1 ]; then
144 clean_and_exit
145 fi
143 echo146 echo
144 rootpass=$password1147 rootpass=$password1
145 make_config148 make_config
146 else149 else
147 echo "Password update failed!"150 echo "Password update failed!"
148 exit 1151 clean_and_exit
149 fi152 fi
150153
151 return 0154 return 0
@@ -157,7 +160,7 @@
157 echo " ... Success!"160 echo " ... Success!"
158 else161 else
159 echo " ... Failed!"162 echo " ... Failed!"
160 exit 1163 clean_and_exit
161 fi164 fi
162165
163 return 0166 return 0
@@ -217,6 +220,11 @@
217 rm -f $config $command220 rm -f $config $command
218}221}
219222
223# Remove the files before exiting.
224clean_and_exit() {
225 cleanup
226 exit 1
227}
220228
221# The actual script starts here229# The actual script starts here
222230
223231
=== modified file 'Percona-Server/sql/filesort.cc'
--- Percona-Server/sql/filesort.cc 2012-04-02 02:09:15 +0000
+++ Percona-Server/sql/filesort.cc 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -298,8 +298,7 @@
298 Use also the space previously used by string pointers in sort_buffer298 Use also the space previously used by string pointers in sort_buffer
299 for temporary key storage.299 for temporary key storage.
300 */300 */
301 param.keys=((param.keys*(param.rec_length+sizeof(char*))) /301 param.keys= table_sort.sort_keys_size / param.rec_length;
302 param.rec_length-1);
303 maxbuffer--; // Offset from 0302 maxbuffer--; // Offset from 0
304 if (merge_many_buff(&param,(uchar*) sort_keys,buffpek,&maxbuffer,303 if (merge_many_buff(&param,(uchar*) sort_keys,buffpek,&maxbuffer,
305 &tempfile))304 &tempfile))
306305
=== modified file 'Percona-Server/sql/gen_lex_hash.cc'
--- Percona-Server/sql/gen_lex_hash.cc 2011-07-22 07:46:45 +0000
+++ Percona-Server/sql/gen_lex_hash.cc 2012-11-08 17:45:27 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.2 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
33
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by5 it under the terms of the GNU General Public License as published by
@@ -350,7 +350,7 @@
350 my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);350 my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
351 if (version)351 if (version)
352 return;352 return;
353 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));353 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
354 puts("This program generates a perfect hashing function for the sql_lex.cc");354 puts("This program generates a perfect hashing function for the sql_lex.cc");
355 printf("Usage: %s [OPTIONS]\n\n", my_progname);355 printf("Usage: %s [OPTIONS]\n\n", my_progname);
356 my_print_help(my_long_options);356 my_print_help(my_long_options);
@@ -453,7 +453,7 @@
453 printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");453 printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
454454
455 puts("/*");455 puts("/*");
456 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));456 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
457 puts("*/");457 puts("*/");
458458
459 /* Broken up to indicate that it's not advice to you, gentle reader. */459 /* Broken up to indicate that it's not advice to you, gentle reader. */
460460
=== modified file 'Percona-Server/sql/ha_partition.cc'
--- Percona-Server/sql/ha_partition.cc 2012-02-29 19:51:38 +0000
+++ Percona-Server/sql/ha_partition.cc 2012-11-08 17:45:27 +0000
@@ -320,7 +320,7 @@
320 for (i= 0; i < m_tot_parts; i++)320 for (i= 0; i < m_tot_parts; i++)
321 delete m_file[i];321 delete m_file[i];
322 }322 }
323 my_free((char*) m_ordered_rec_buffer, MYF(MY_ALLOW_ZERO_PTR));323 destroy_record_priority_queue();
324324
325 clear_handler_file();325 clear_handler_file();
326 DBUG_VOID_RETURN;326 DBUG_VOID_RETURN;
@@ -2594,7 +2594,6 @@
2594{2594{
2595 char *name_buffer_ptr;2595 char *name_buffer_ptr;
2596 int error= HA_ERR_INITIALIZATION;2596 int error= HA_ERR_INITIALIZATION;
2597 uint alloc_len;
2598 handler **file;2597 handler **file;
2599 char name_buff[FN_REFLEN];2598 char name_buff[FN_REFLEN];
2600 bool is_not_tmp_table= (table_share->tmp_table == NO_TMP_TABLE);2599 bool is_not_tmp_table= (table_share->tmp_table == NO_TMP_TABLE);
@@ -2612,32 +2611,6 @@
2612 m_start_key.length= 0;2611 m_start_key.length= 0;
2613 m_rec0= table->record[0];2612 m_rec0= table->record[0];
2614 m_rec_length= table_share->reclength;2613 m_rec_length= table_share->reclength;
2615 alloc_len= m_tot_parts * (m_rec_length + PARTITION_BYTES_IN_POS);
2616 alloc_len+= table_share->max_key_length;
2617 if (!m_ordered_rec_buffer)
2618 {
2619 if (!(m_ordered_rec_buffer= (uchar*)my_malloc(alloc_len, MYF(MY_WME))))
2620 {
2621 DBUG_RETURN(error);
2622 }
2623 {
2624 /*
2625 We set-up one record per partition and each record has 2 bytes in
2626 front where the partition id is written. This is used by ordered
2627 index_read.
2628 We also set-up a reference to the first record for temporary use in
2629 setting up the scan.
2630 */
2631 char *ptr= (char*)m_ordered_rec_buffer;
2632 uint i= 0;
2633 do
2634 {
2635 int2store(ptr, i);
2636 ptr+= m_rec_length + PARTITION_BYTES_IN_POS;
2637 } while (++i < m_tot_parts);
2638 m_start_key.key= (const uchar*)ptr;
2639 }
2640 }
26412614
2642 /* Initialize the bitmap we use to minimize ha_start_bulk_insert calls */2615 /* Initialize the bitmap we use to minimize ha_start_bulk_insert calls */
2643 if (bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE))2616 if (bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE))
@@ -2657,7 +2630,7 @@
26572630
2658 if (m_is_clone_of)2631 if (m_is_clone_of)
2659 {2632 {
2660 uint i;2633 uint i, alloc_len;
2661 DBUG_ASSERT(m_clone_mem_root);2634 DBUG_ASSERT(m_clone_mem_root);
2662 /* Allocate an array of handler pointers for the partitions handlers. */2635 /* Allocate an array of handler pointers for the partitions handlers. */
2663 alloc_len= (m_tot_parts + 1) * sizeof(handler*);2636 alloc_len= (m_tot_parts + 1) * sizeof(handler*);
@@ -2733,12 +2706,6 @@
2733 being opened once.2706 being opened once.
2734 */2707 */
2735 clear_handler_file();2708 clear_handler_file();
2736 /*
2737 Initialize priority queue, initialized to reading forward.
2738 */
2739 if ((error= init_queue(&m_queue, m_tot_parts, (uint) PARTITION_BYTES_IN_POS,
2740 0, key_rec_cmp, (void*)this)))
2741 goto err_handler;
27422709
2743 /*2710 /*
2744 Use table_share->ha_data to share auto_increment_value among all handlers2711 Use table_share->ha_data to share auto_increment_value among all handlers
@@ -2861,7 +2828,7 @@
2861 DBUG_ENTER("ha_partition::close");2828 DBUG_ENTER("ha_partition::close");
28622829
2863 DBUG_ASSERT(table->s == table_share);2830 DBUG_ASSERT(table->s == table_share);
2864 delete_queue(&m_queue);2831 destroy_record_priority_queue();
2865 bitmap_free(&m_bulk_insert_started);2832 bitmap_free(&m_bulk_insert_started);
2866 if (!m_is_clone_of)2833 if (!m_is_clone_of)
2867 bitmap_free(&(m_part_info->used_partitions));2834 bitmap_free(&(m_part_info->used_partitions));
@@ -4073,6 +4040,78 @@
4073 subset of the partitions are used, then only use those partitions.4040 subset of the partitions are used, then only use those partitions.
4074*/4041*/
40754042
4043
4044/**
4045 Setup the ordered record buffer and the priority queue.
4046*/
4047
4048bool ha_partition::init_record_priority_queue()
4049{
4050 DBUG_ENTER("ha_partition::init_record_priority_queue");
4051 DBUG_ASSERT(!m_ordered_rec_buffer);
4052 /*
4053 Initialize the ordered record buffer.
4054 */
4055 if (!m_ordered_rec_buffer)
4056 {
4057 uint alloc_len;
4058 uint used_parts= bitmap_bits_set(&m_part_info->used_partitions);
4059 /* Allocate record buffer for each used partition. */
4060 alloc_len= used_parts * (m_rec_length + PARTITION_BYTES_IN_POS);
4061 /* Allocate a key for temporary use when setting up the scan. */
4062 alloc_len+= table_share->max_key_length;
4063
4064 if (!(m_ordered_rec_buffer= (uchar*)my_malloc(alloc_len, MYF(MY_WME))))
4065 DBUG_RETURN(true);
4066
4067 /*
4068 We set-up one record per partition and each record has 2 bytes in
4069 front where the partition id is written. This is used by ordered
4070 index_read.
4071 We also set-up a reference to the first record for temporary use in
4072 setting up the scan.
4073 */
4074 char *ptr= (char*) m_ordered_rec_buffer;
4075 uint16 i= 0;
4076 do
4077 {
4078 if (bitmap_is_set(&m_part_info->used_partitions, i))
4079 {
4080 int2store(ptr, i);
4081 ptr+= m_rec_length + PARTITION_BYTES_IN_POS;
4082 }
4083 } while (++i < m_tot_parts);
4084 m_start_key.key= (const uchar*)ptr;
4085 /* Initialize priority queue, initialized to reading forward. */
4086 if (init_queue(&m_queue, used_parts, (uint) PARTITION_BYTES_IN_POS,
4087 0, key_rec_cmp, (void*)m_curr_key_info))
4088 {
4089 my_free(m_ordered_rec_buffer, MYF(0));
4090 m_ordered_rec_buffer= NULL;
4091 DBUG_RETURN(true);
4092 }
4093 }
4094 DBUG_RETURN(false);
4095}
4096
4097
4098/**
4099 Destroy the ordered record buffer and the priority queue.
4100*/
4101
4102void ha_partition::destroy_record_priority_queue()
4103{
4104 DBUG_ENTER("ha_partition::destroy_record_priority_queue");
4105 if (m_ordered_rec_buffer)
4106 {
4107 delete_queue(&m_queue);
4108 my_free(m_ordered_rec_buffer, MYF(0));
4109 m_ordered_rec_buffer= NULL;
4110 }
4111 DBUG_VOID_RETURN;
4112}
4113
4114
4076/*4115/*
4077 Initialize handler before start of index scan4116 Initialize handler before start of index scan
40784117
@@ -4114,6 +4153,10 @@
4114 }4153 }
4115 else4154 else
4116 m_curr_key_info[1]= NULL;4155 m_curr_key_info[1]= NULL;
4156
4157 if (init_record_priority_queue())
4158 DBUG_RETURN(HA_ERR_OUT_OF_MEM);
4159
4117 /*4160 /*
4118 Some handlers only read fields as specified by the bitmap for the4161 Some handlers only read fields as specified by the bitmap for the
4119 read set. For partitioned handlers we always require that the4162 read set. For partitioned handlers we always require that the
@@ -4188,11 +4231,11 @@
4188 do4231 do
4189 {4232 {
4190 int tmp;4233 int tmp;
4191 /* TODO RONM: Change to index_end() when code is stable */
4192 if (bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))4234 if (bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
4193 if ((tmp= (*file)->ha_index_end()))4235 if ((tmp= (*file)->ha_index_end()))
4194 error= tmp;4236 error= tmp;
4195 } while (*(++file));4237 } while (*(++file));
4238 destroy_record_priority_queue();
4196 DBUG_RETURN(error);4239 DBUG_RETURN(error);
4197}4240}
41984241
@@ -4932,6 +4975,7 @@
4932 uint i;4975 uint i;
4933 uint j= 0;4976 uint j= 0;
4934 bool found= FALSE;4977 bool found= FALSE;
4978 uchar *part_rec_buf_ptr= m_ordered_rec_buffer;
4935 DBUG_ENTER("ha_partition::handle_ordered_index_scan");4979 DBUG_ENTER("ha_partition::handle_ordered_index_scan");
49364980
4937 m_top_entry= NO_CURRENT_PART_ID;4981 m_top_entry= NO_CURRENT_PART_ID;
@@ -4942,7 +4986,7 @@
4942 {4986 {
4943 if (!(bitmap_is_set(&(m_part_info->used_partitions), i)))4987 if (!(bitmap_is_set(&(m_part_info->used_partitions), i)))
4944 continue;4988 continue;
4945 uchar *rec_buf_ptr= rec_buf(i);4989 uchar *rec_buf_ptr= part_rec_buf_ptr + PARTITION_BYTES_IN_POS;
4946 int error;4990 int error;
4947 handler *file= m_file[i];4991 handler *file= m_file[i];
49484992
@@ -4989,12 +5033,13 @@
4989 /*5033 /*
4990 Initialize queue without order first, simply insert5034 Initialize queue without order first, simply insert
4991 */5035 */
4992 queue_element(&m_queue, j++)= (uchar*)queue_buf(i);5036 queue_element(&m_queue, j++)= part_rec_buf_ptr;
4993 }5037 }
4994 else if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)5038 else if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
4995 {5039 {
4996 DBUG_RETURN(error);5040 DBUG_RETURN(error);
4997 }5041 }
5042 part_rec_buf_ptr+= m_rec_length + PARTITION_BYTES_IN_POS;
4998 }5043 }
4999 if (found)5044 if (found)
5000 {5045 {
@@ -5057,18 +5102,19 @@
5057{5102{
5058 int error;5103 int error;
5059 uint part_id= m_top_entry;5104 uint part_id= m_top_entry;
5105 uchar *rec_buf= queue_top(&m_queue) + PARTITION_BYTES_IN_POS;
5060 handler *file= m_file[part_id];5106 handler *file= m_file[part_id];
5061 DBUG_ENTER("ha_partition::handle_ordered_next");5107 DBUG_ENTER("ha_partition::handle_ordered_next");
5062 5108
5063 if (m_index_scan_type == partition_read_range)5109 if (m_index_scan_type == partition_read_range)
5064 {5110 {
5065 error= file->read_range_next();5111 error= file->read_range_next();
5066 memcpy(rec_buf(part_id), table->record[0], m_rec_length);5112 memcpy(rec_buf, table->record[0], m_rec_length);
5067 }5113 }
5068 else if (!is_next_same)5114 else if (!is_next_same)
5069 error= file->index_next(rec_buf(part_id));5115 error= file->index_next(rec_buf);
5070 else5116 else
5071 error= file->index_next_same(rec_buf(part_id), m_start_key.key,5117 error= file->index_next_same(rec_buf, m_start_key.key,
5072 m_start_key.length);5118 m_start_key.length);
5073 if (error)5119 if (error)
5074 {5120 {
@@ -5111,10 +5157,11 @@
5111{5157{
5112 int error;5158 int error;
5113 uint part_id= m_top_entry;5159 uint part_id= m_top_entry;
5160 uchar *rec_buf= queue_top(&m_queue) + PARTITION_BYTES_IN_POS;
5114 handler *file= m_file[part_id];5161 handler *file= m_file[part_id];
5115 DBUG_ENTER("ha_partition::handle_ordered_prev");5162 DBUG_ENTER("ha_partition::handle_ordered_prev");
51165163
5117 if ((error= file->index_prev(rec_buf(part_id))))5164 if ((error= file->index_prev(rec_buf)))
5118 {5165 {
5119 if (error == HA_ERR_END_OF_FILE)5166 if (error == HA_ERR_END_OF_FILE)
5120 {5167 {
51215168
=== modified file 'Percona-Server/sql/ha_partition.h'
--- Percona-Server/sql/ha_partition.h 2012-02-29 19:51:38 +0000
+++ Percona-Server/sql/ha_partition.h 2012-11-08 17:45:27 +0000
@@ -517,21 +517,13 @@
517 virtual int read_range_next();517 virtual int read_range_next();
518518
519private:519private:
520 bool init_record_priority_queue();
521 void destroy_record_priority_queue();
520 int common_index_read(uchar * buf, bool have_start_key);522 int common_index_read(uchar * buf, bool have_start_key);
521 int common_first_last(uchar * buf);523 int common_first_last(uchar * buf);
522 int partition_scan_set_up(uchar * buf, bool idx_read_flag);524 int partition_scan_set_up(uchar * buf, bool idx_read_flag);
523 int handle_unordered_next(uchar * buf, bool next_same);525 int handle_unordered_next(uchar * buf, bool next_same);
524 int handle_unordered_scan_next_partition(uchar * buf);526 int handle_unordered_scan_next_partition(uchar * buf);
525 uchar *queue_buf(uint part_id)
526 {
527 return (m_ordered_rec_buffer +
528 (part_id * (m_rec_length + PARTITION_BYTES_IN_POS)));
529 }
530 uchar *rec_buf(uint part_id)
531 {
532 return (queue_buf(part_id) +
533 PARTITION_BYTES_IN_POS);
534 }
535 int handle_ordered_index_scan(uchar * buf, bool reverse_order);527 int handle_ordered_index_scan(uchar * buf, bool reverse_order);
536 int handle_ordered_next(uchar * buf, bool next_same);528 int handle_ordered_next(uchar * buf, bool next_same);
537 int handle_ordered_prev(uchar * buf);529 int handle_ordered_prev(uchar * buf);
538530
=== modified file 'Percona-Server/sql/handler.cc'
--- Percona-Server/sql/handler.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/handler.cc 2012-11-08 17:45:27 +0000
@@ -4400,7 +4400,19 @@
4400 ? HA_ERR_END_OF_FILE4400 ? HA_ERR_END_OF_FILE
4401 : result);4401 : result);
44024402
4403 DBUG_RETURN (compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE);4403 if (compare_key(end_range) <= 0)
4404 {
4405 DBUG_RETURN(0);
4406 }
4407 else
4408 {
4409 /*
4410 The last read row does not fall in the range. So request
4411 storage engine to release row lock if possible.
4412 */
4413 unlock_row();
4414 DBUG_RETURN(HA_ERR_END_OF_FILE);
4415 }
4404}4416}
44054417
44064418
@@ -4432,7 +4444,20 @@
4432 result= index_next(table->record[0]);4444 result= index_next(table->record[0]);
4433 if (result)4445 if (result)
4434 DBUG_RETURN(result);4446 DBUG_RETURN(result);
4435 DBUG_RETURN(compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE);4447
4448 if (compare_key(end_range) <= 0)
4449 {
4450 DBUG_RETURN(0);
4451 }
4452 else
4453 {
4454 /*
4455 The last read row does not fall in the range. So request
4456 storage engine to release row lock if possible.
4457 */
4458 unlock_row();
4459 DBUG_RETURN(HA_ERR_END_OF_FILE);
4460 }
4436}4461}
44374462
44384463
44394464
=== modified file 'Percona-Server/sql/item.cc'
--- Percona-Server/sql/item.cc 2012-08-20 00:29:22 +0000
+++ Percona-Server/sql/item.cc 2012-11-08 17:45:27 +0000
@@ -6010,7 +6010,12 @@
6010 if (from_field != not_found_field)6010 if (from_field != not_found_field)
6011 {6011 {
6012 Item_field* fld;6012 Item_field* fld;
6013 if (!(fld= new Item_field(thd, last_checked_context, from_field)))6013 Query_arena backup, *arena;
6014 arena= thd->activate_stmt_arena_if_needed(&backup);
6015 fld= new Item_field(thd, last_checked_context, from_field);
6016 if (arena)
6017 thd->restore_active_arena(arena, &backup);
6018 if (!fld)
6014 goto error;6019 goto error;
6015 thd->change_item_tree(reference, fld);6020 thd->change_item_tree(reference, fld);
6016 mark_as_dependent(thd, last_checked_context->select_lex,6021 mark_as_dependent(thd, last_checked_context->select_lex,
60176022
=== modified file 'Percona-Server/sql/item_strfunc.cc'
--- Percona-Server/sql/item_strfunc.cc 2012-02-15 16:21:38 +0000
+++ Percona-Server/sql/item_strfunc.cc 2012-11-08 17:45:27 +0000
@@ -3047,23 +3047,21 @@
3047String* Item_func_export_set::val_str(String* str)3047String* Item_func_export_set::val_str(String* str)
3048{3048{
3049 DBUG_ASSERT(fixed == 1);3049 DBUG_ASSERT(fixed == 1);
3050 ulonglong the_set = (ulonglong) args[0]->val_int();3050 String yes_buf, no_buf, sep_buf;
3051 String yes_buf, *yes;3051 const ulonglong the_set = (ulonglong) args[0]->val_int();
3052 yes = args[1]->val_str(&yes_buf);3052 const String *yes= args[1]->val_str(&yes_buf);
3053 String no_buf, *no;3053 const String *no= args[2]->val_str(&no_buf);
3054 no = args[2]->val_str(&no_buf);3054 const String *sep= NULL;
3055 String *sep = NULL, sep_buf ;
30563055
3057 uint num_set_values = 64;3056 uint num_set_values = 64;
3058 ulonglong mask = 0x1;
3059 str->length(0);3057 str->length(0);
3060 str->set_charset(collation.collation);3058 str->set_charset(collation.collation);
30613059
3062 /* Check if some argument is a NULL value */3060 /* Check if some argument is a NULL value */
3063 if (args[0]->null_value || args[1]->null_value || args[2]->null_value)3061 if (args[0]->null_value || args[1]->null_value || args[2]->null_value)
3064 {3062 {
3065 null_value=1;3063 null_value= true;
3066 return 0;3064 return NULL;
3067 }3065 }
3068 /*3066 /*
3069 Arg count can only be 3, 4 or 5 here. This is guaranteed from the3067 Arg count can only be 3, 4 or 5 here. This is guaranteed from the
@@ -3076,37 +3074,56 @@
3076 num_set_values=64;3074 num_set_values=64;
3077 if (args[4]->null_value)3075 if (args[4]->null_value)
3078 {3076 {
3079 null_value=1;3077 null_value= true;
3080 return 0;3078 return NULL;
3081 }3079 }
3082 /* Fall through */3080 /* Fall through */
3083 case 4:3081 case 4:
3084 if (!(sep = args[3]->val_str(&sep_buf))) // Only true if NULL3082 if (!(sep = args[3]->val_str(&sep_buf))) // Only true if NULL
3085 {3083 {
3086 null_value=1;3084 null_value= true;
3087 return 0;3085 return NULL;
3088 }3086 }
3089 break;3087 break;
3090 case 3:3088 case 3:
3091 {3089 {
3092 /* errors is not checked - assume "," can always be converted */3090 /* errors is not checked - assume "," can always be converted */
3093 uint errors;3091 uint errors;
3094 sep_buf.copy(STRING_WITH_LEN(","), &my_charset_bin, collation.collation, &errors);3092 sep_buf.copy(STRING_WITH_LEN(","), &my_charset_bin,
3093 collation.collation, &errors);
3095 sep = &sep_buf;3094 sep = &sep_buf;
3096 }3095 }
3097 break;3096 break;
3098 default:3097 default:
3099 DBUG_ASSERT(0); // cannot happen3098 DBUG_ASSERT(0); // cannot happen
3100 }3099 }
3101 null_value=0;3100 null_value= false;
31023101
3103 for (uint i = 0; i < num_set_values; i++, mask = (mask << 1))3102 const ulong max_allowed_packet= current_thd->variables.max_allowed_packet;
3103 const uint num_separators= num_set_values > 0 ? num_set_values - 1 : 0;
3104 const ulonglong max_total_length=
3105 num_set_values * max(yes->length(), no->length()) +
3106 num_separators * sep->length();
3107
3108 if (unlikely(max_total_length > max_allowed_packet))
3109 {
3110 push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
3111 ER_WARN_ALLOWED_PACKET_OVERFLOWED,
3112 ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
3113 func_name(), max_allowed_packet);
3114 null_value= true;
3115 return NULL;
3116 }
3117
3118 uint ix;
3119 ulonglong mask;
3120 for (ix= 0, mask=0x1; ix < num_set_values; ++ix, mask = (mask << 1))
3104 {3121 {
3105 if (the_set & mask)3122 if (the_set & mask)
3106 str->append(*yes);3123 str->append(*yes);
3107 else3124 else
3108 str->append(*no);3125 str->append(*no);
3109 if (i != num_set_values - 1)3126 if (ix != num_separators)
3110 str->append(*sep);3127 str->append(*sep);
3111 }3128 }
3112 return str;3129 return str;
31133130
=== modified file 'Percona-Server/sql/item_subselect.cc'
--- Percona-Server/sql/item_subselect.cc 2012-04-10 11:21:57 +0000
+++ Percona-Server/sql/item_subselect.cc 2012-11-08 17:45:27 +0000
@@ -1135,7 +1135,7 @@
1135 }1135 }
1136 else1136 else
1137 {1137 {
1138 Item *item= (Item*) select_lex->item_list.head();1138 Item *item= (Item*) select_lex->item_list.head()->real_item();
11391139
1140 if (select_lex->table_list.elements)1140 if (select_lex->table_list.elements)
1141 {1141 {
11421142
=== modified file 'Percona-Server/sql/log_event.h'
--- Percona-Server/sql/log_event.h 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/log_event.h 2012-11-08 17:45:27 +0000
@@ -2505,7 +2505,7 @@
2505 User_var_log_event(THD* thd_arg, char *name_arg, uint name_len_arg,2505 User_var_log_event(THD* thd_arg, char *name_arg, uint name_len_arg,
2506 char *val_arg, ulong val_len_arg, Item_result type_arg,2506 char *val_arg, ulong val_len_arg, Item_result type_arg,
2507 uint charset_number_arg)2507 uint charset_number_arg)
2508 :Log_event(), name(name_arg), name_len(name_len_arg), val(val_arg),2508 :Log_event(thd_arg,0,0), name(name_arg), name_len(name_len_arg), val(val_arg),
2509 val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg),2509 val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg),
2510 deferred(false)2510 deferred(false)
2511 { is_null= !val; }2511 { is_null= !val; }
25122512
=== modified file 'Percona-Server/sql/mysqld.cc'
--- Percona-Server/sql/mysqld.cc 2012-09-05 22:27:47 +0000
+++ Percona-Server/sql/mysqld.cc 2012-11-08 17:45:27 +0000
@@ -8028,7 +8028,7 @@
8028 if (!default_collation_name)8028 if (!default_collation_name)
8029 default_collation_name= (char*) default_charset_info->name;8029 default_collation_name= (char*) default_charset_info->name;
8030 print_version();8030 print_version();
8031 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));8031 puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
8032 puts("Starts the MySQL database server.\n");8032 puts("Starts the MySQL database server.\n");
8033 printf("Usage: %s [OPTIONS]\n", my_progname);8033 printf("Usage: %s [OPTIONS]\n", my_progname);
8034 if (!opt_verbose)8034 if (!opt_verbose)
80358035
=== modified file 'Percona-Server/sql/share/charsets/Index.xml'
--- Percona-Server/sql/share/charsets/Index.xml 2006-12-23 19:20:40 +0000
+++ Percona-Server/sql/share/charsets/Index.xml 2012-11-08 17:45:27 +0000
@@ -3,7 +3,7 @@
3<charsets max-id="99">3<charsets max-id="99">
44
5<copyright>5<copyright>
6 Copyright (C) 2003 MySQL AB6 Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
77
8 This program is free software; you can redistribute it and/or modify8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by9 it under the terms of the GNU General Public License as published by
1010
=== modified file 'Percona-Server/sql/spatial.cc'
--- Percona-Server/sql/spatial.cc 2012-03-05 17:58:07 +0000
+++ Percona-Server/sql/spatial.cc 2012-11-08 17:45:27 +0000
@@ -525,12 +525,13 @@
525 const char *wkb_end;525 const char *wkb_end;
526 Gis_point p;526 Gis_point p;
527527
528 if (len < 4)528 if (len < 4 ||
529 (n_points= wkb_get_uint(wkb, bo)) < 1 ||
530 n_points > max_n_points)
529 return 0;531 return 0;
530 n_points= wkb_get_uint(wkb, bo);
531 proper_length= 4 + n_points * POINT_DATA_SIZE;532 proper_length= 4 + n_points * POINT_DATA_SIZE;
532533
533 if (!n_points || len < proper_length || res->reserve(proper_length))534 if (len < proper_length || res->reserve(proper_length))
534 return 0;535 return 0;
535536
536 res->q_append(n_points);537 res->q_append(n_points);
@@ -1072,9 +1073,9 @@
1072 Gis_point p;1073 Gis_point p;
1073 const char *wkb_end;1074 const char *wkb_end;
10741075
1075 if (len < 4)1076 if (len < 4 ||
1077 (n_points= wkb_get_uint(wkb, bo)) > max_n_points)
1076 return 0;1078 return 0;
1077 n_points= wkb_get_uint(wkb, bo);
1078 proper_size= 4 + n_points * (WKB_HEADER_SIZE + POINT_DATA_SIZE);1079 proper_size= 4 + n_points * (WKB_HEADER_SIZE + POINT_DATA_SIZE);
1079 1080
1080 if (len < proper_size || res->reserve(proper_size))1081 if (len < proper_size || res->reserve(proper_size))
10811082
=== modified file 'Percona-Server/sql/spatial.h'
--- Percona-Server/sql/spatial.h 2011-06-30 15:37:13 +0000
+++ Percona-Server/sql/spatial.h 2012-11-08 17:45:27 +0000
@@ -379,6 +379,10 @@
379379
380class Gis_line_string: public Geometry380class Gis_line_string: public Geometry
381{381{
382 // Maximum number of points in LineString that can fit into String
383 static const uint32 max_n_points=
384 (uint32) (UINT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
385 POINT_DATA_SIZE;
382public:386public:
383 Gis_line_string() {} /* Remove gcc warning */387 Gis_line_string() {} /* Remove gcc warning */
384 virtual ~Gis_line_string() {} /* Remove gcc warning */388 virtual ~Gis_line_string() {} /* Remove gcc warning */
@@ -435,6 +439,10 @@
435439
436class Gis_multi_point: public Geometry440class Gis_multi_point: public Geometry
437{441{
442 // Maximum number of points in MultiPoint that can fit into String
443 static const uint32 max_n_points=
444 (uint32) (UINT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
445 (WKB_HEADER_SIZE + POINT_DATA_SIZE);
438public:446public:
439 Gis_multi_point() {} /* Remove gcc warning */447 Gis_multi_point() {} /* Remove gcc warning */
440 virtual ~Gis_multi_point() {} /* Remove gcc warning */448 virtual ~Gis_multi_point() {} /* Remove gcc warning */
441449
=== modified file 'Percona-Server/sql/sql_prepare.cc'
--- Percona-Server/sql/sql_prepare.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/sql_prepare.cc 2012-11-08 17:45:27 +0000
@@ -788,6 +788,14 @@
788 param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));788 param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));
789 if (param->state == Item_param::NO_VALUE)789 if (param->state == Item_param::NO_VALUE)
790 DBUG_RETURN(1);790 DBUG_RETURN(1);
791
792 if (param->limit_clause_param && param->item_type != Item::INT_ITEM)
793 {
794 param->set_int(param->val_int(), MY_INT64_NUM_DECIMAL_DIGITS);
795 param->item_type= Item::INT_ITEM;
796 if (!param->unsigned_flag && param->value.integer < 0)
797 DBUG_RETURN(1);
798 }
791 }799 }
792 }800 }
793 /*801 /*
794802
=== modified file 'Percona-Server/sql/sql_select.cc'
--- Percona-Server/sql/sql_select.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/sql_select.cc 2012-11-08 17:45:27 +0000
@@ -551,8 +551,6 @@
551 551
552 if (having)552 if (having)
553 {553 {
554 Query_arena backup, *arena;
555 arena= thd->activate_stmt_arena_if_needed(&backup);
556 nesting_map save_allow_sum_func= thd->lex->allow_sum_func;554 nesting_map save_allow_sum_func= thd->lex->allow_sum_func;
557 thd->where="having clause";555 thd->where="having clause";
558 thd->lex->allow_sum_func|= 1 << select_lex_arg->nest_level;556 thd->lex->allow_sum_func|= 1 << select_lex_arg->nest_level;
@@ -562,8 +560,6 @@
562 having->check_cols(1)));560 having->check_cols(1)));
563 select_lex->having_fix_field= 0;561 select_lex->having_fix_field= 0;
564 select_lex->having= having;562 select_lex->having= having;
565 if (arena)
566 thd->restore_active_arena(arena, &backup);
567563
568 if (having_fix_rc || thd->is_error())564 if (having_fix_rc || thd->is_error())
569 DBUG_RETURN(-1); /* purecov: inspected */565 DBUG_RETURN(-1); /* purecov: inspected */
@@ -1505,12 +1501,19 @@
1505 DBUG_RETURN(1);1501 DBUG_RETURN(1);
1506 }1502 }
1507 }1503 }
1508 1504 /*
1505 Calculate a possible 'limit' of table rows for 'GROUP BY': 'need_tmp'
1506 implies that there will be more postprocessing so the specified
1507 'limit' should not be enforced yet in the call to
1508 'test_if_skip_sort_order'.
1509 */
1510 const ha_rows limit = need_tmp ? HA_POS_ERROR : unit->select_limit_cnt;
1511
1509 if (!(select_options & SELECT_BIG_RESULT) &&1512 if (!(select_options & SELECT_BIG_RESULT) &&
1510 ((group_list &&1513 ((group_list &&
1511 (!simple_group ||1514 (!simple_group ||
1512 !test_if_skip_sort_order(&join_tab[const_tables], group_list,1515 !test_if_skip_sort_order(&join_tab[const_tables], group_list,
1513 unit->select_limit_cnt, 0, 1516 limit, 0,
1514 &join_tab[const_tables].table->1517 &join_tab[const_tables].table->
1515 keys_in_use_for_group_by))) ||1518 keys_in_use_for_group_by))) ||
1516 select_distinct) &&1519 select_distinct) &&
15171520
=== modified file 'Percona-Server/sql/sql_show.cc'
--- Percona-Server/sql/sql_show.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/sql_show.cc 2012-11-08 17:45:27 +0000
@@ -3489,8 +3489,9 @@
3489 /* Restore original LEX value, statement's arena and THD arena values. */3489 /* Restore original LEX value, statement's arena and THD arena values. */
3490 lex_end(thd->lex);3490 lex_end(thd->lex);
34913491
3492 if (i_s_arena.free_list)3492 // Free items, before restoring backup_arena below.
3493 i_s_arena.free_items();3493 DBUG_ASSERT(i_s_arena.free_list == NULL);
3494 thd->free_items();
34943495
3495 /*3496 /*
3496 For safety reset list of open temporary tables before closing3497 For safety reset list of open temporary tables before closing
34973498
=== modified file 'Percona-Server/sql/sql_string.h'
--- Percona-Server/sql/sql_string.h 2012-02-09 15:03:59 +0000
+++ Percona-Server/sql/sql_string.h 2012-11-08 17:45:27 +0000
@@ -2,7 +2,7 @@
2#define MYSQL_SQL_STRING_H_INCLUDED2#define MYSQL_SQL_STRING_H_INCLUDED
33
4/*4/*
5 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.5 Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
66
7 This program is free software; you can redistribute it and/or modify7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by8 it under the terms of the GNU General Public License as published by
@@ -232,8 +232,12 @@
232 }232 }
233 bool real_alloc(uint32 arg_length); // Empties old string233 bool real_alloc(uint32 arg_length); // Empties old string
234 bool realloc(uint32 arg_length);234 bool realloc(uint32 arg_length);
235 inline void shrink(uint32 arg_length) // Shrink buffer235
236 // Shrink the buffer, but only if it is allocated on the heap.
237 inline void shrink(uint32 arg_length)
236 {238 {
239 if (!is_alloced())
240 return;
237 if (arg_length < Alloced_length)241 if (arg_length < Alloced_length)
238 {242 {
239 char *new_ptr;243 char *new_ptr;
@@ -249,7 +253,7 @@
249 }253 }
250 }254 }
251 }255 }
252 bool is_alloced() { return alloced; }256 bool is_alloced() const { return alloced; }
253 inline String& operator = (const String &s)257 inline String& operator = (const String &s)
254 {258 {
255 if (&s != this)259 if (&s != this)
256260
=== modified file 'Percona-Server/storage/federated/ha_federated.cc'
--- Percona-Server/storage/federated/ha_federated.cc 2012-04-02 04:58:41 +0000
+++ Percona-Server/storage/federated/ha_federated.cc 2012-11-08 17:45:27 +0000
@@ -1364,7 +1364,7 @@
1364 break;1364 break;
1365 }1365 }
1366 DBUG_PRINT("info", ("federated HA_READ_AFTER_KEY %d", i));1366 DBUG_PRINT("info", ("federated HA_READ_AFTER_KEY %d", i));
1367 if (store_length >= length) /* end key */1367 if ((store_length >= length) || (i > 0)) /* for all parts of end key*/
1368 {1368 {
1369 if (emit_key_part_name(&tmp, key_part))1369 if (emit_key_part_name(&tmp, key_part))
1370 goto err;1370 goto err;
13711371
=== modified file 'Percona-Server/storage/innobase/btr/btr0pcur.c'
--- Percona-Server/storage/innobase/btr/btr0pcur.c 2012-03-08 15:10:10 +0000
+++ Percona-Server/storage/innobase/btr/btr0pcur.c 2012-11-08 17:45:27 +0000
@@ -312,45 +312,40 @@
312 /* Restore the old search mode */312 /* Restore the old search mode */
313 cursor->search_mode = old_mode;313 cursor->search_mode = old_mode;
314314
315 if (btr_pcur_is_on_user_rec(cursor, mtr)) {315 switch (cursor->rel_pos) {
316 switch (cursor->rel_pos) {316 case BTR_PCUR_ON:
317 case BTR_PCUR_ON:317 if (btr_pcur_is_on_user_rec(cursor, mtr)
318 if (!cmp_dtuple_rec(318 && !cmp_dtuple_rec(
319 tuple, btr_pcur_get_rec(cursor),319 tuple, btr_pcur_get_rec(cursor),
320 rec_get_offsets(btr_pcur_get_rec(cursor),320 rec_get_offsets(btr_pcur_get_rec(cursor),
321 index, NULL,321 index, NULL,
322 ULINT_UNDEFINED, &heap))) {322 ULINT_UNDEFINED, &heap))) {
323323
324 /* We have to store the NEW value for324 /* We have to store the NEW value for
325 the modify clock, since the cursor can325 the modify clock, since the cursor can
326 now be on a different page! But we can326 now be on a different page! But we can
327 retain the value of old_rec */327 retain the value of old_rec */
328328
329 cursor->block_when_stored =329 cursor->block_when_stored =
330 buf_block_align(330 buf_block_align(
331 btr_pcur_get_page(cursor));331 btr_pcur_get_page(cursor));
332 cursor->modify_clock =332 cursor->modify_clock =
333 buf_block_get_modify_clock(333 buf_block_get_modify_clock(
334 cursor->block_when_stored);334 cursor->block_when_stored);
335 cursor->old_stored = BTR_PCUR_OLD_STORED;335 cursor->old_stored = BTR_PCUR_OLD_STORED;
336336
337 mem_heap_free(heap);337 mem_heap_free(heap);
338338
339 return(TRUE);339 return(TRUE);
340 }340 }
341
342 break;
343 case BTR_PCUR_BEFORE:
344 page_cur_move_to_next(btr_pcur_get_page_cur(cursor));
345 break;
346 case BTR_PCUR_AFTER:
347 page_cur_move_to_prev(btr_pcur_get_page_cur(cursor));
348 break;
349#ifdef UNIV_DEBUG341#ifdef UNIV_DEBUG
350 default:342 /* fall through */
351 ut_error;343 case BTR_PCUR_BEFORE:
344 case BTR_PCUR_AFTER:
345 break;
346 default:
347 ut_error;
352#endif /* UNIV_DEBUG */348#endif /* UNIV_DEBUG */
353 }
354 }349 }
355350
356 mem_heap_free(heap);351 mem_heap_free(heap);
357352
=== modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc'
--- Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2012-11-08 17:45:27 +0000
@@ -6389,7 +6389,6 @@
6389 void* heap2;6389 void* heap2;
63906390
6391 DBUG_ENTER("records_in_range");6391 DBUG_ENTER("records_in_range");
6392 DBUG_ASSERT(min_key || max_key);
63936392
6394 ut_a(prebuilt->trx == thd_to_trx(ha_thd()));6393 ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
63956394
63966395
=== modified file 'Percona-Server/storage/innodb_plugin/ChangeLog'
--- Percona-Server/storage/innodb_plugin/ChangeLog 2012-03-21 12:53:09 +0000
+++ Percona-Server/storage/innodb_plugin/ChangeLog 2012-11-08 17:45:27 +0000
@@ -1,3 +1,32 @@
12012-08-29 The InnoDB Team
2
3 * btr/btr0btr.c, page/page0cur.c, page/page0page.c:
4 Fix Bug#14554000 CRASH IN PAGE_REC_GET_NTH_CONST(NTH=0)
5 DURING COMPRESSED PAGE SPLIT
6
72012-08-16 The InnoDB Team
8
9 * btr/btr0cur.c:
10 Fix Bug#12595091 POSSIBLY INVALID ASSERTION IN
11 BTR_CUR_PESSIMISTIC_UPDATE()
12
132012-08-16 The InnoDB Team
14
15 * btr/btr0btr.c, btr/btr0cur.c:
16 Fix Bug#12845774 OPTIMISTIC INSERT/UPDATE USES WRONG HEURISTICS FOR
17 COMPRESSED PAGE SIZE
18
192012-08-16 The InnoDB Team
20
21 * btr/btr0cur.c, page/page0page.c:
22 Fix Bug#13523839 ASSERTION FAILURES ON COMPRESSED INNODB TABLES
23
242012-08-07 The InnoDB Team
25
26 * btr/btr0pcur.c, row/row0merge.c:
27 Fix Bug#14399148 INNODB TABLES UNDER LOAD PRODUCE DUPLICATE COPIES
28 OF ROWS IN QUERIES
29
12012-03-15 The InnoDB Team302012-03-15 The InnoDB Team
231
3 * fil/fil0fil.c, ibuf/ibuf0ibuf.c, include/fil0fil.h,32 * fil/fil0fil.c, ibuf/ibuf0ibuf.c, include/fil0fil.h,
433
=== modified file 'Percona-Server/storage/innodb_plugin/btr/btr0btr.c'
--- Percona-Server/storage/innodb_plugin/btr/btr0btr.c 2012-09-14 12:19:29 +0000
+++ Percona-Server/storage/innodb_plugin/btr/btr0btr.c 2012-11-08 17:45:27 +0000
@@ -1869,6 +1869,7 @@
1869 root = btr_cur_get_page(cursor);1869 root = btr_cur_get_page(cursor);
1870 root_block = btr_cur_get_block(cursor);1870 root_block = btr_cur_get_block(cursor);
1871 root_page_zip = buf_block_get_page_zip(root_block);1871 root_page_zip = buf_block_get_page_zip(root_block);
1872 ut_ad(page_get_n_recs(root) > 0);
1872#ifdef UNIV_ZIP_DEBUG1873#ifdef UNIV_ZIP_DEBUG
1873 ut_a(!root_page_zip || page_zip_validate(root_page_zip, root));1874 ut_a(!root_page_zip || page_zip_validate(root_page_zip, root));
1874#endif /* UNIV_ZIP_DEBUG */1875#endif /* UNIV_ZIP_DEBUG */
@@ -2349,12 +2350,20 @@
2349 BTR_CONT_MODIFY_TREE,2350 BTR_CONT_MODIFY_TREE,
2350 &cursor, 0, file, line, mtr);2351 &cursor, 0, file, line, mtr);
23512352
2352 err = btr_cur_pessimistic_insert(BTR_NO_LOCKING_FLAG2353 ut_ad(cursor.flag == BTR_CUR_BINARY);
2353 | BTR_KEEP_SYS_FLAG2354
2354 | BTR_NO_UNDO_LOG_FLAG,2355 err = btr_cur_optimistic_insert(
2355 &cursor, tuple, &rec,2356 BTR_NO_LOCKING_FLAG | BTR_KEEP_SYS_FLAG
2356 &dummy_big_rec, 0, NULL, mtr);2357 | BTR_NO_UNDO_LOG_FLAG, &cursor, tuple, &rec,
2357 ut_a(err == DB_SUCCESS);2358 &dummy_big_rec, 0, NULL, mtr);
2359
2360 if (err == DB_FAIL) {
2361 err = btr_cur_pessimistic_insert(
2362 BTR_NO_LOCKING_FLAG | BTR_KEEP_SYS_FLAG
2363 | BTR_NO_UNDO_LOG_FLAG,
2364 &cursor, tuple, &rec, &dummy_big_rec, 0, NULL, mtr);
2365 ut_a(err == DB_SUCCESS);
2366 }
2358}2367}
23592368
2360/**************************************************************//**2369/**************************************************************//**
@@ -3279,6 +3288,7 @@
32793288
3280 if (adjust) {3289 if (adjust) {
3281 nth_rec = page_rec_get_n_recs_before(btr_cur_get_rec(cursor));3290 nth_rec = page_rec_get_n_recs_before(btr_cur_get_rec(cursor));
3291 ut_ad(nth_rec > 0);
3282 }3292 }
32833293
3284 /* Decide the page to which we try to merge and which will inherit3294 /* Decide the page to which we try to merge and which will inherit
@@ -3514,6 +3524,7 @@
3514 mem_heap_free(heap);3524 mem_heap_free(heap);
35153525
3516 if (adjust) {3526 if (adjust) {
3527 ut_ad(nth_rec > 0);
3517 btr_cur_position(3528 btr_cur_position(
3518 index,3529 index,
3519 page_rec_get_nth(merge_block->frame, nth_rec),3530 page_rec_get_nth(merge_block->frame, nth_rec),
@@ -4026,8 +4037,22 @@
4026{4037{
4027 page_cur_t cur;4038 page_cur_t cur;
4028 ibool ret = TRUE;4039 ibool ret = TRUE;
4040#ifndef DBUG_OFF
4041 ulint nth = 1;
4042#endif /* !DBUG_OFF */
40294043
4030 page_cur_set_before_first(block, &cur);4044 page_cur_set_before_first(block, &cur);
4045
4046 /* Directory slot 0 should only contain the infimum record. */
4047 DBUG_EXECUTE_IF("check_table_rec_next",
4048 ut_a(page_rec_get_nth_const(
4049 page_cur_get_page(&cur), 0)
4050 == cur.rec);
4051 ut_a(page_dir_slot_get_n_owned(
4052 page_dir_get_nth_slot(
4053 page_cur_get_page(&cur), 0))
4054 == 1););
4055
4031 page_cur_move_to_next(&cur);4056 page_cur_move_to_next(&cur);
40324057
4033 for (;;) {4058 for (;;) {
@@ -4041,6 +4066,16 @@
4041 return(FALSE);4066 return(FALSE);
4042 }4067 }
40434068
4069 /* Verify that page_rec_get_nth_const() is correctly
4070 retrieving each record. */
4071 DBUG_EXECUTE_IF("check_table_rec_next",
4072 ut_a(cur.rec == page_rec_get_nth_const(
4073 page_cur_get_page(&cur),
4074 page_rec_get_n_recs_before(
4075 cur.rec)));
4076 ut_a(nth++ == page_rec_get_n_recs_before(
4077 cur.rec)););
4078
4044 page_cur_move_to_next(&cur);4079 page_cur_move_to_next(&cur);
4045 }4080 }
40464081
40474082
=== modified file 'Percona-Server/storage/innodb_plugin/btr/btr0cur.c'
--- Percona-Server/storage/innodb_plugin/btr/btr0cur.c 2012-08-20 03:14:02 +0000
+++ Percona-Server/storage/innodb_plugin/btr/btr0cur.c 2012-11-08 17:45:27 +0000
@@ -1307,7 +1307,12 @@
13071307
1308 if (UNIV_UNLIKELY(reorg)) {1308 if (UNIV_UNLIKELY(reorg)) {
1309 ut_a(zip_size);1309 ut_a(zip_size);
1310 ut_a(*rec);1310 /* It's possible for rec to be NULL if the
1311 page is compressed. This is because a
1312 reorganized page may become incompressible. */
1313 if (!*rec) {
1314 goto fail;
1315 }
1311 }1316 }
1312 }1317 }
13131318
@@ -1443,20 +1448,9 @@
1443 ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, btr_cur_get_block(cursor),1448 ut_ad((thr && thr_get_trx(thr)->fake_changes) || mtr_memo_contains(mtr, btr_cur_get_block(cursor),
1444 MTR_MEMO_PAGE_X_FIX));1449 MTR_MEMO_PAGE_X_FIX));
14451450
1446 /* Try first an optimistic insert; reset the cursor flag: we do not
1447 assume anything of how it was positioned */
1448
1449 cursor->flag = BTR_CUR_BINARY;1451 cursor->flag = BTR_CUR_BINARY;
14501452
1451 err = btr_cur_optimistic_insert(flags, cursor, entry, rec,1453 /* Check locks and write to undo log, if specified */
1452 big_rec, n_ext, thr, mtr);
1453 if (err != DB_FAIL) {
1454
1455 return(err);
1456 }
1457
1458 /* Retry with a pessimistic insert. Check locks and write to undo log,
1459 if specified */
14601454
1461 err = btr_cur_ins_lock_and_undo(flags, cursor, entry,1455 err = btr_cur_ins_lock_and_undo(flags, cursor, entry,
1462 thr, mtr, &dummy_inh);1456 thr, mtr, &dummy_inh);
@@ -2083,8 +2077,12 @@
2083 goto err_exit;2077 goto err_exit;
2084 }2078 }
20852079
2086 max_size = old_rec_size2080 /* We do not attempt to reorganize if the page is compressed.
2087 + page_get_max_insert_size_after_reorganize(page, 1);2081 This is because the page may fail to compress after reorganization. */
2082 max_size = page_zip
2083 ? page_get_max_insert_size(page, 1)
2084 : (old_rec_size
2085 + page_get_max_insert_size_after_reorganize(page, 1));
20882086
2089 if (!(((max_size >= BTR_CUR_PAGE_REORGANIZE_LIMIT)2087 if (!(((max_size >= BTR_CUR_PAGE_REORGANIZE_LIMIT)
2090 && (max_size >= new_rec_size))2088 && (max_size >= new_rec_size))
@@ -2452,7 +2450,12 @@
2452 err = DB_SUCCESS;2450 err = DB_SUCCESS;
2453 goto return_after_reservations;2451 goto return_after_reservations;
2454 } else {2452 } else {
2455 ut_a(optim_err != DB_UNDERFLOW);2453 /* If the page is compressed and it initially
2454 compresses very well, and there is a subsequent insert
2455 of a badly-compressing record, it is possible for
2456 btr_cur_optimistic_update() to return DB_UNDERFLOW and
2457 btr_cur_insert_if_possible() to return FALSE. */
2458 ut_a(page_zip || optim_err != DB_UNDERFLOW);
24562459
2457 /* Out of space: reset the free bits. */2460 /* Out of space: reset the free bits. */
2458 if (!dict_index_is_clust(index)2461 if (!dict_index_is_clust(index)
@@ -2480,8 +2483,10 @@
2480 record on its page? */2483 record on its page? */
2481 was_first = page_cur_is_before_first(page_cursor);2484 was_first = page_cur_is_before_first(page_cursor);
24822485
2483 /* The first parameter means that no lock checking and undo logging2486 /* Lock checks and undo logging were already performed by
2484 is made in the insert */2487 btr_cur_upd_lock_and_undo(). We do not try
2488 btr_cur_optimistic_insert() because
2489 btr_cur_insert_if_possible() already failed above. */
24852490
2486 err = btr_cur_pessimistic_insert(BTR_NO_UNDO_LOG_FLAG2491 err = btr_cur_pessimistic_insert(BTR_NO_UNDO_LOG_FLAG
2487 | BTR_NO_LOCKING_FLAG2492 | BTR_NO_LOCKING_FLAG
24882493
=== modified file 'Percona-Server/storage/innodb_plugin/btr/btr0pcur.c'
--- Percona-Server/storage/innodb_plugin/btr/btr0pcur.c 2012-05-09 04:14:12 +0000
+++ Percona-Server/storage/innodb_plugin/btr/btr0pcur.c 2012-11-08 17:45:27 +0000
@@ -342,44 +342,39 @@
342 /* Restore the old search mode */342 /* Restore the old search mode */
343 cursor->search_mode = old_mode;343 cursor->search_mode = old_mode;
344344
345 if (btr_pcur_is_on_user_rec(cursor)) {345 switch (cursor->rel_pos) {
346 switch (cursor->rel_pos) {346 case BTR_PCUR_ON:
347 case BTR_PCUR_ON:347 if (btr_pcur_is_on_user_rec(cursor)
348 if (!cmp_dtuple_rec(348 && !cmp_dtuple_rec(
349 tuple, btr_pcur_get_rec(cursor),349 tuple, btr_pcur_get_rec(cursor),
350 rec_get_offsets(btr_pcur_get_rec(cursor),350 rec_get_offsets(btr_pcur_get_rec(cursor),
351 index, NULL,351 index, NULL,
352 ULINT_UNDEFINED, &heap))) {352 ULINT_UNDEFINED, &heap))) {
353353
354 /* We have to store the NEW value for354 /* We have to store the NEW value for
355 the modify clock, since the cursor can355 the modify clock, since the cursor can
356 now be on a different page! But we can356 now be on a different page! But we can
357 retain the value of old_rec */357 retain the value of old_rec */
358358
359 cursor->block_when_stored =359 cursor->block_when_stored =
360 btr_pcur_get_block(cursor);360 btr_pcur_get_block(cursor);
361 cursor->modify_clock =361 cursor->modify_clock =
362 buf_block_get_modify_clock(362 buf_block_get_modify_clock(
363 cursor->block_when_stored);363 cursor->block_when_stored);
364 cursor->old_stored = BTR_PCUR_OLD_STORED;364 cursor->old_stored = BTR_PCUR_OLD_STORED;
365365
366 mem_heap_free(heap);366 mem_heap_free(heap);
367367
368 return(TRUE);368 return(TRUE);
369 }369 }
370
371 break;
372 case BTR_PCUR_BEFORE:
373 page_cur_move_to_next(btr_pcur_get_page_cur(cursor));
374 break;
375 case BTR_PCUR_AFTER:
376 page_cur_move_to_prev(btr_pcur_get_page_cur(cursor));
377 break;
378#ifdef UNIV_DEBUG370#ifdef UNIV_DEBUG
379 default:371 /* fall through */
380 ut_error;372 case BTR_PCUR_BEFORE:
373 case BTR_PCUR_AFTER:
374 break;
375 default:
376 ut_error;
381#endif /* UNIV_DEBUG */377#endif /* UNIV_DEBUG */
382 }
383 }378 }
384379
385 mem_heap_free(heap);380 mem_heap_free(heap);
386381
=== modified file 'Percona-Server/storage/innodb_plugin/buf/buf0buf.c'
--- Percona-Server/storage/innodb_plugin/buf/buf0buf.c 2012-10-12 01:13:44 +0000
+++ Percona-Server/storage/innodb_plugin/buf/buf0buf.c 2012-11-08 17:45:27 +0000
@@ -4092,6 +4092,133 @@
40924092
4093 return(len);4093 return(len);
4094}4094}
4095
4096/*******************************************************************//**
4097Collect buffer pool stats information for a buffer pool. Also
4098record aggregated stats if there are more than one buffer pool
4099in the server */
4100UNIV_INTERN
4101void
4102buf_stats_get_pool_info(
4103/*====================*/
4104 buf_pool_info_t* pool_info) /*!< in/out: buffer pool info
4105 to fill */
4106{
4107 time_t current_time;
4108 double time_elapsed;
4109
4110 buf_pool_mutex_enter();
4111
4112 pool_info->pool_size = buf_pool->curr_size;
4113
4114 pool_info->lru_len = UT_LIST_GET_LEN(buf_pool->LRU);
4115
4116 pool_info->old_lru_len = buf_pool->LRU_old_len;
4117
4118 pool_info->free_list_len = UT_LIST_GET_LEN(buf_pool->free);
4119
4120 pool_info->flush_list_len = UT_LIST_GET_LEN(buf_pool->flush_list);
4121
4122 pool_info->n_pend_unzip = UT_LIST_GET_LEN(buf_pool->unzip_LRU);
4123
4124 pool_info->n_pend_reads = buf_pool->n_pend_reads;
4125
4126 pool_info->n_pending_flush_lru =
4127 (buf_pool->n_flush[BUF_FLUSH_LRU]
4128 + buf_pool->init_flush[BUF_FLUSH_LRU]);
4129
4130 pool_info->n_pending_flush_list =
4131 (buf_pool->n_flush[BUF_FLUSH_LIST]
4132 + buf_pool->init_flush[BUF_FLUSH_LIST]);
4133
4134 pool_info->n_pending_flush_single_page =
4135 (buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]
4136 + buf_pool->init_flush[BUF_FLUSH_SINGLE_PAGE]);
4137
4138 current_time = time(NULL);
4139 time_elapsed = 0.001 + difftime(current_time,
4140 buf_pool->last_printout_time);
4141
4142 pool_info->n_pages_made_young = buf_pool->stat.n_pages_made_young;
4143
4144 pool_info->n_pages_not_made_young =
4145 buf_pool->stat.n_pages_not_made_young;
4146
4147 pool_info->n_pages_read = buf_pool->stat.n_pages_read;
4148
4149 pool_info->n_pages_created = buf_pool->stat.n_pages_created;
4150
4151 pool_info->n_pages_written = buf_pool->stat.n_pages_written;
4152
4153 pool_info->n_page_gets = buf_pool->stat.n_page_gets;
4154
4155 pool_info->n_ra_pages_read_rnd = buf_pool->stat.n_ra_pages_read_rnd;
4156 pool_info->n_ra_pages_read = buf_pool->stat.n_ra_pages_read;
4157
4158 pool_info->n_ra_pages_evicted = buf_pool->stat.n_ra_pages_evicted;
4159
4160 pool_info->page_made_young_rate =
4161 (buf_pool->stat.n_pages_made_young
4162 - buf_pool->old_stat.n_pages_made_young) / time_elapsed;
4163
4164 pool_info->page_not_made_young_rate =
4165 (buf_pool->stat.n_pages_not_made_young
4166 - buf_pool->old_stat.n_pages_not_made_young) / time_elapsed;
4167
4168 pool_info->pages_read_rate =
4169 (buf_pool->stat.n_pages_read
4170 - buf_pool->old_stat.n_pages_read) / time_elapsed;
4171
4172 pool_info->pages_created_rate =
4173 (buf_pool->stat.n_pages_created
4174 - buf_pool->old_stat.n_pages_created) / time_elapsed;
4175
4176 pool_info->pages_written_rate =
4177 (buf_pool->stat.n_pages_written
4178 - buf_pool->old_stat.n_pages_written) / time_elapsed;
4179
4180 pool_info->n_page_get_delta = buf_pool->stat.n_page_gets
4181 - buf_pool->old_stat.n_page_gets;
4182
4183 if (pool_info->n_page_get_delta) {
4184 pool_info->page_read_delta = buf_pool->stat.n_pages_read
4185 - buf_pool->old_stat.n_pages_read;
4186
4187 pool_info->young_making_delta =
4188 buf_pool->stat.n_pages_made_young
4189 - buf_pool->old_stat.n_pages_made_young;
4190
4191 pool_info->not_young_making_delta =
4192 buf_pool->stat.n_pages_not_made_young
4193 - buf_pool->old_stat.n_pages_not_made_young;
4194 }
4195 pool_info->pages_readahead_rnd_rate =
4196 (buf_pool->stat.n_ra_pages_read_rnd
4197 - buf_pool->old_stat.n_ra_pages_read_rnd) / time_elapsed;
4198
4199
4200 pool_info->pages_readahead_rate =
4201 (buf_pool->stat.n_ra_pages_read
4202 - buf_pool->old_stat.n_ra_pages_read) / time_elapsed;
4203
4204 pool_info->pages_evicted_rate =
4205 (buf_pool->stat.n_ra_pages_evicted
4206 - buf_pool->old_stat.n_ra_pages_evicted) / time_elapsed;
4207
4208 pool_info->unzip_lru_len = UT_LIST_GET_LEN(buf_pool->unzip_LRU);
4209
4210 pool_info->io_sum = buf_LRU_stat_sum.io;
4211
4212 pool_info->io_cur = buf_LRU_stat_cur.io;
4213
4214 pool_info->unzip_sum = buf_LRU_stat_sum.unzip;
4215
4216 pool_info->unzip_cur = buf_LRU_stat_cur.unzip;
4217
4218 buf_refresh_io_stats();
4219 buf_pool_mutex_exit();
4220}
4221
4095#else /* !UNIV_HOTBACKUP */4222#else /* !UNIV_HOTBACKUP */
4096/********************************************************************//**4223/********************************************************************//**
4097Inits a page to the buffer buf_pool, for use in ibbackup --restore. */4224Inits a page to the buffer buf_pool, for use in ibbackup --restore. */
@@ -4122,3 +4249,5 @@
4122 }4249 }
4123}4250}
4124#endif /* !UNIV_HOTBACKUP */4251#endif /* !UNIV_HOTBACKUP */
4252
4253
41254254
=== modified file 'Percona-Server/storage/innodb_plugin/handler/ha_innodb.cc'
--- Percona-Server/storage/innodb_plugin/handler/ha_innodb.cc 2012-09-14 12:19:29 +0000
+++ Percona-Server/storage/innodb_plugin/handler/ha_innodb.cc 2012-11-08 17:45:27 +0000
@@ -959,11 +959,23 @@
959 case DB_TABLE_NOT_FOUND:959 case DB_TABLE_NOT_FOUND:
960 return(HA_ERR_NO_SUCH_TABLE);960 return(HA_ERR_NO_SUCH_TABLE);
961961
962 case DB_TOO_BIG_RECORD:962 case DB_TOO_BIG_RECORD: {
963 my_error(ER_TOO_BIG_ROWSIZE, MYF(0),963 /* If prefix is true then a 768-byte prefix is stored
964 page_get_free_space_of_empty(flags964 locally for BLOB fields. Refer to dict_table_get_format() */
965 & DICT_TF_COMPACT) / 2);965 bool prefix = ((flags & DICT_TF_FORMAT_MASK)
966 >> DICT_TF_FORMAT_SHIFT) < UNIV_FORMAT_B;
967 my_printf_error(ER_TOO_BIG_ROWSIZE,
968 "Row size too large (> %lu). Changing some columns "
969 "to TEXT or BLOB %smay help. In current row "
970 "format, BLOB prefix of %d bytes is stored inline.",
971 MYF(0),
972 page_get_free_space_of_empty(flags &
973 DICT_TF_COMPACT) / 2,
974 prefix ? "or using ROW_FORMAT=DYNAMIC "
975 "or ROW_FORMAT=COMPRESSED ": "",
976 prefix ? DICT_MAX_INDEX_COL_LEN : 0);
966 return(HA_ERR_TO_BIG_ROW);977 return(HA_ERR_TO_BIG_ROW);
978 }
967979
968 case DB_NO_SAVEPOINT:980 case DB_NO_SAVEPOINT:
969 return(HA_ERR_NO_SAVEPOINT);981 return(HA_ERR_NO_SAVEPOINT);
@@ -7943,7 +7955,6 @@
7943 mem_heap_t* heap;7955 mem_heap_t* heap;
79447956
7945 DBUG_ENTER("records_in_range");7957 DBUG_ENTER("records_in_range");
7946 DBUG_ASSERT(min_key || max_key);
79477958
7948 ut_a(prebuilt->trx == thd_to_trx(ha_thd()));7959 ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
79497960
@@ -12277,7 +12288,10 @@
12277i_s_innodb_sys_tables,12288i_s_innodb_sys_tables,
12278i_s_innodb_sys_indexes,12289i_s_innodb_sys_indexes,
12279i_s_innodb_sys_stats,12290i_s_innodb_sys_stats,
12280i_s_innodb_changed_pages12291i_s_innodb_changed_pages,
12292i_s_innodb_buffer_page,
12293i_s_innodb_buffer_page_lru,
12294i_s_innodb_buffer_stats
12281mysql_declare_plugin_end;12295mysql_declare_plugin_end;
1228212296
12283/** @brief Initialize the default value of innodb_commit_concurrency.12297/** @brief Initialize the default value of innodb_commit_concurrency.
1228412298
=== modified file 'Percona-Server/storage/innodb_plugin/handler/i_s.cc'
--- Percona-Server/storage/innodb_plugin/handler/i_s.cc 2012-08-23 08:19:20 +0000
+++ Percona-Server/storage/innodb_plugin/handler/i_s.cc 2012-11-08 17:45:27 +0000
@@ -56,10 +56,90 @@
56#include "btr0pcur.h"56#include "btr0pcur.h"
57#include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */57#include "buf0lru.h" /* for XTRA_LRU_[DUMP/RESTORE] */
58#include "log0online.h"58#include "log0online.h"
59#include "btr0btr.h"
60#include "log0log.h"
59}61}
6062
61static const char plugin_author[] = "Innobase Oy";63static const char plugin_author[] = "Innobase Oy";
6264
65/** structure associates a name string with a file page type and/or buffer
66page state. */
67struct buffer_page_desc_str_struct{
68 const char* type_str; /*!< String explain the page
69 type/state */
70 ulint type_value; /*!< Page type or page state */
71};
72
73typedef struct buffer_page_desc_str_struct buf_page_desc_str_t;
74
75/** Any states greater than FIL_PAGE_TYPE_LAST would be treated as unknown. */
76#define I_S_PAGE_TYPE_UNKNOWN (FIL_PAGE_TYPE_LAST + 1)
77
78/** We also define I_S_PAGE_TYPE_INDEX as the Index Page's position
79in i_s_page_type[] array */
80#define I_S_PAGE_TYPE_INDEX 1
81
82/** Name string for File Page Types */
83static buf_page_desc_str_t i_s_page_type[] = {
84 {"ALLOCATED", FIL_PAGE_TYPE_ALLOCATED},
85 {"INDEX", FIL_PAGE_INDEX},
86 {"UNDO_LOG", FIL_PAGE_UNDO_LOG},
87 {"INODE", FIL_PAGE_INODE},
88 {"IBUF_FREE_LIST", FIL_PAGE_IBUF_FREE_LIST},
89 {"IBUF_BITMAP", FIL_PAGE_IBUF_BITMAP},
90 {"SYSTEM", FIL_PAGE_TYPE_SYS},
91 {"TRX_SYSTEM", FIL_PAGE_TYPE_TRX_SYS},
92 {"FILE_SPACE_HEADER", FIL_PAGE_TYPE_FSP_HDR},
93 {"EXTENT_DESCRIPTOR", FIL_PAGE_TYPE_XDES},
94 {"BLOB", FIL_PAGE_TYPE_BLOB},
95 {"COMPRESSED_BLOB", FIL_PAGE_TYPE_ZBLOB},
96 {"COMPRESSED_BLOB2", FIL_PAGE_TYPE_ZBLOB2},
97 {"UNKNOWN", I_S_PAGE_TYPE_UNKNOWN}
98};
99
100/* Check if we can hold all page type in a 4 bit value */
101#if I_S_PAGE_TYPE_UNKNOWN > 1<<4
102# error "i_s_page_type[] is too large"
103#endif
104
105/** This structure defines information we will fetch from pages
106currently cached in the buffer pool. It will be used to populate
107table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE */
108struct buffer_page_info_struct{
109 ulint block_id; /*!< Buffer Pool block ID */
110 unsigned space_id:32; /*!< Tablespace ID */
111 unsigned page_num:32; /*!< Page number/offset */
112 unsigned access_time:32; /*!< Time of first access */
113 unsigned flush_type:2; /*!< Flush type */
114 unsigned io_fix:2; /*!< type of pending I/O operation */
115 unsigned fix_count:19; /*!< Count of how manyfold this block
116 is bufferfixed */
117 unsigned hashed:1; /*!< Whether hash index has been
118 built on this page */
119 unsigned is_old:1; /*!< TRUE if the block is in the old
120 blocks in buf_pool->LRU_old */
121 unsigned freed_page_clock:31; /*!< the value of
122 buf_pool->freed_page_clock */
123 unsigned zip_ssize:PAGE_ZIP_SSIZE_BITS;
124 /*!< Compressed page size */
125 unsigned page_state:BUF_PAGE_STATE_BITS; /*!< Page state */
126 unsigned page_type:4; /*!< Page type */
127 unsigned num_recs;
128 /*!< Number of records on Page */
129 unsigned data_size;
130 /*!< Sum of the sizes of the records */
131 lsn_t newest_mod; /*!< Log sequence number of
132 the youngest modification */
133 lsn_t oldest_mod; /*!< Log sequence number of
134 the oldest modification */
135 dulint index_id; /*!< Index ID if a index page */
136};
137
138typedef struct buffer_page_info_struct buf_page_info_t;
139
140/** maximum number of buffer page info we would cache. */
141#define MAX_BUF_INFO_CACHED 10000
142
63#define OK(expr) \143#define OK(expr) \
64 if ((expr) != 0) { \144 if ((expr) != 0) { \
65 DBUG_RETURN(1); \145 DBUG_RETURN(1); \
@@ -3933,3 +4013,1680 @@
3933 STRUCT_FLD(system_vars, NULL),4013 STRUCT_FLD(system_vars, NULL),
3934 STRUCT_FLD(__reserved1, NULL)4014 STRUCT_FLD(__reserved1, NULL)
3935};4015};
4016
4017/* Fields of the dynamic table INNODB_BUFFER_POOL_STATS. */
4018static ST_FIELD_INFO i_s_innodb_buffer_stats_fields_info[] =
4019{
4020#define IDX_BUF_STATS_POOL_SIZE 0
4021 {STRUCT_FLD(field_name, "POOL_SIZE"),
4022 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4023 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4024 STRUCT_FLD(value, 0),
4025 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4026 STRUCT_FLD(old_name, ""),
4027 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4028
4029#define IDX_BUF_STATS_FREE_BUFFERS 1
4030 {STRUCT_FLD(field_name, "FREE_BUFFERS"),
4031 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4032 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4033 STRUCT_FLD(value, 0),
4034 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4035 STRUCT_FLD(old_name, ""),
4036 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4037
4038#define IDX_BUF_STATS_LRU_LEN 2
4039 {STRUCT_FLD(field_name, "DATABASE_PAGES"),
4040 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4041 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4042 STRUCT_FLD(value, 0),
4043 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4044 STRUCT_FLD(old_name, ""),
4045 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4046
4047#define IDX_BUF_STATS_OLD_LRU_LEN 3
4048 {STRUCT_FLD(field_name, "OLD_DATABASE_PAGES"),
4049 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4050 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4051 STRUCT_FLD(value, 0),
4052 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4053 STRUCT_FLD(old_name, ""),
4054 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4055
4056#define IDX_BUF_STATS_FLUSH_LIST_LEN 4
4057 {STRUCT_FLD(field_name, "MODIFIED_DATABASE_PAGES"),
4058 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4059 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4060 STRUCT_FLD(value, 0),
4061 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4062 STRUCT_FLD(old_name, ""),
4063 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4064
4065#define IDX_BUF_STATS_PENDING_ZIP 5
4066 {STRUCT_FLD(field_name, "PENDING_DECOMPRESS"),
4067 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4068 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4069 STRUCT_FLD(value, 0),
4070 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4071 STRUCT_FLD(old_name, ""),
4072 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4073
4074#define IDX_BUF_STATS_PENDING_READ 6
4075 {STRUCT_FLD(field_name, "PENDING_READS"),
4076 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4077 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4078 STRUCT_FLD(value, 0),
4079 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4080 STRUCT_FLD(old_name, ""),
4081 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4082
4083#define IDX_BUF_STATS_FLUSH_LRU 7
4084 {STRUCT_FLD(field_name, "PENDING_FLUSH_LRU"),
4085 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4086 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4087 STRUCT_FLD(value, 0),
4088 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4089 STRUCT_FLD(old_name, ""),
4090 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4091
4092#define IDX_BUF_STATS_FLUSH_LIST 8
4093 {STRUCT_FLD(field_name, "PENDING_FLUSH_LIST"),
4094 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4095 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4096 STRUCT_FLD(value, 0),
4097 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4098 STRUCT_FLD(old_name, ""),
4099 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4100
4101#define IDX_BUF_STATS_PAGE_YOUNG 9
4102 {STRUCT_FLD(field_name, "PAGES_MADE_YOUNG"),
4103 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4104 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4105 STRUCT_FLD(value, 0),
4106 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4107 STRUCT_FLD(old_name, ""),
4108 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4109
4110#define IDX_BUF_STATS_PAGE_NOT_YOUNG 10
4111 {STRUCT_FLD(field_name, "PAGES_NOT_MADE_YOUNG"),
4112 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4113 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4114 STRUCT_FLD(value, 0),
4115 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4116 STRUCT_FLD(old_name, ""),
4117 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4118
4119#define IDX_BUF_STATS_PAGE_YOUNG_RATE 11
4120 {STRUCT_FLD(field_name, "PAGES_MADE_YOUNG_RATE"),
4121 STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
4122 STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
4123 STRUCT_FLD(value, 0),
4124 STRUCT_FLD(field_flags, 0),
4125 STRUCT_FLD(old_name, ""),
4126 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4127
4128#define IDX_BUF_STATS_PAGE_NOT_YOUNG_RATE 12
4129 {STRUCT_FLD(field_name, "PAGES_MADE_NOT_YOUNG_RATE"),
4130 STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
4131 STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
4132 STRUCT_FLD(value, 0),
4133 STRUCT_FLD(field_flags, 0),
4134 STRUCT_FLD(old_name, ""),
4135 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4136
4137#define IDX_BUF_STATS_PAGE_READ 13
4138 {STRUCT_FLD(field_name, "NUMBER_PAGES_READ"),
4139 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4140 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4141 STRUCT_FLD(value, 0),
4142 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4143 STRUCT_FLD(old_name, ""),
4144 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4145
4146#define IDX_BUF_STATS_PAGE_CREATED 14
4147 {STRUCT_FLD(field_name, "NUMBER_PAGES_CREATED"),
4148 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4149 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4150 STRUCT_FLD(value, 0),
4151 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4152 STRUCT_FLD(old_name, ""),
4153 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4154
4155#define IDX_BUF_STATS_PAGE_WRITTEN 15
4156 {STRUCT_FLD(field_name, "NUMBER_PAGES_WRITTEN"),
4157 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4158 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4159 STRUCT_FLD(value, 0),
4160 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4161 STRUCT_FLD(old_name, ""),
4162 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4163
4164#define IDX_BUF_STATS_PAGE_READ_RATE 16
4165 {STRUCT_FLD(field_name, "PAGES_READ_RATE"),
4166 STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
4167 STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
4168 STRUCT_FLD(value, 0),
4169 STRUCT_FLD(field_flags, 0),
4170 STRUCT_FLD(old_name, ""),
4171 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4172
4173#define IDX_BUF_STATS_PAGE_CREATE_RATE 17
4174 {STRUCT_FLD(field_name, "PAGES_CREATE_RATE"),
4175 STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
4176 STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
4177 STRUCT_FLD(value, 0),
4178 STRUCT_FLD(field_flags, 0),
4179 STRUCT_FLD(old_name, ""),
4180 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4181
4182#define IDX_BUF_STATS_PAGE_WRITTEN_RATE 18
4183 {STRUCT_FLD(field_name, "PAGES_WRITTEN_RATE"),
4184 STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
4185 STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
4186 STRUCT_FLD(value, 0),
4187 STRUCT_FLD(field_flags, 0),
4188 STRUCT_FLD(old_name, ""),
4189 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4190
4191#define IDX_BUF_STATS_GET 19
4192 {STRUCT_FLD(field_name, "NUMBER_PAGES_GET"),
4193 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4194 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4195 STRUCT_FLD(value, 0),
4196 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4197 STRUCT_FLD(old_name, ""),
4198 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4199
4200#define IDX_BUF_STATS_HIT_RATE 20
4201 {STRUCT_FLD(field_name, "HIT_RATE"),
4202 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4203 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4204 STRUCT_FLD(value, 0),
4205 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4206 STRUCT_FLD(old_name, ""),
4207 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4208
4209#define IDX_BUF_STATS_MADE_YOUNG_PCT 21
4210 {STRUCT_FLD(field_name, "YOUNG_MAKE_PER_THOUSAND_GETS"),
4211 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4212 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4213 STRUCT_FLD(value, 0),
4214 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4215 STRUCT_FLD(old_name, ""),
4216 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4217
4218#define IDX_BUF_STATS_NOT_MADE_YOUNG_PCT 22
4219 {STRUCT_FLD(field_name, "NOT_YOUNG_MAKE_PER_THOUSAND_GETS"),
4220 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4221 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4222 STRUCT_FLD(value, 0),
4223 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4224 STRUCT_FLD(old_name, ""),
4225 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4226
4227#define IDX_BUF_STATS_READ_AHREAD 23
4228 {STRUCT_FLD(field_name, "NUMBER_PAGES_READ_AHEAD"),
4229 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4230 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4231 STRUCT_FLD(value, 0),
4232 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4233 STRUCT_FLD(old_name, ""),
4234 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4235
4236#define IDX_BUF_STATS_READ_AHEAD_EVICTED 24
4237 {STRUCT_FLD(field_name, "NUMBER_READ_AHEAD_EVICTED"),
4238 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4239 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4240 STRUCT_FLD(value, 0),
4241 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4242 STRUCT_FLD(old_name, ""),
4243 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4244
4245#define IDX_BUF_STATS_READ_AHEAD_RATE 25
4246 {STRUCT_FLD(field_name, "READ_AHEAD_RATE"),
4247 STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
4248 STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
4249 STRUCT_FLD(value, 0),
4250 STRUCT_FLD(field_flags, 0),
4251 STRUCT_FLD(old_name, ""),
4252 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4253
4254#define IDX_BUF_STATS_READ_AHEAD_EVICT_RATE 26
4255 {STRUCT_FLD(field_name, "READ_AHEAD_EVICTED_RATE"),
4256 STRUCT_FLD(field_length, MAX_FLOAT_STR_LENGTH),
4257 STRUCT_FLD(field_type, MYSQL_TYPE_FLOAT),
4258 STRUCT_FLD(value, 0),
4259 STRUCT_FLD(field_flags, 0),
4260 STRUCT_FLD(old_name, ""),
4261 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4262
4263#define IDX_BUF_STATS_LRU_IO_SUM 27
4264 {STRUCT_FLD(field_name, "LRU_IO_TOTAL"),
4265 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4266 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4267 STRUCT_FLD(value, 0),
4268 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4269 STRUCT_FLD(old_name, ""),
4270 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4271
4272#define IDX_BUF_STATS_LRU_IO_CUR 28
4273 {STRUCT_FLD(field_name, "LRU_IO_CURRENT"),
4274 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4275 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4276 STRUCT_FLD(value, 0),
4277 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4278 STRUCT_FLD(old_name, ""),
4279 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4280
4281#define IDX_BUF_STATS_UNZIP_SUM 29
4282 {STRUCT_FLD(field_name, "UNCOMPRESS_TOTAL"),
4283 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4284 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4285 STRUCT_FLD(value, 0),
4286 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4287 STRUCT_FLD(old_name, ""),
4288 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4289
4290#define IDX_BUF_STATS_UNZIP_CUR 30
4291 {STRUCT_FLD(field_name, "UNCOMPRESS_CURRENT"),
4292 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4293 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4294 STRUCT_FLD(value, 0),
4295 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4296 STRUCT_FLD(old_name, ""),
4297 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4298
4299 END_OF_ST_FIELD_INFO
4300};
4301
4302/*******************************************************************//**
4303Fill Information Schema table INNODB_BUFFER_POOL_STATS for a particular
4304buffer pool
4305@return 0 on success, 1 on failure */
4306static
4307int
4308i_s_innodb_stats_fill(
4309/*==================*/
4310 THD* thd, /*!< in: thread */
4311 TABLE_LIST* tables, /*!< in/out: tables to fill */
4312 const buf_pool_info_t* info) /*!< in: buffer pool
4313 information */
4314{
4315 TABLE* table;
4316 Field** fields;
4317
4318 DBUG_ENTER("i_s_innodb_stats_fill");
4319
4320 table = tables->table;
4321
4322 fields = table->field;
4323
4324 OK(fields[IDX_BUF_STATS_POOL_SIZE]->store(info->pool_size));
4325
4326 OK(fields[IDX_BUF_STATS_LRU_LEN]->store(info->lru_len));
4327
4328 OK(fields[IDX_BUF_STATS_OLD_LRU_LEN]->store(info->old_lru_len));
4329
4330 OK(fields[IDX_BUF_STATS_FREE_BUFFERS]->store(info->free_list_len));
4331
4332 OK(fields[IDX_BUF_STATS_FLUSH_LIST_LEN]->store(
4333 info->flush_list_len));
4334
4335 OK(fields[IDX_BUF_STATS_PENDING_ZIP]->store(info->n_pend_unzip));
4336
4337 OK(fields[IDX_BUF_STATS_PENDING_READ]->store(info->n_pend_reads));
4338
4339 OK(fields[IDX_BUF_STATS_FLUSH_LRU]->store(info->n_pending_flush_lru));
4340
4341 OK(fields[IDX_BUF_STATS_FLUSH_LIST]->store(info->n_pending_flush_list));
4342
4343 OK(fields[IDX_BUF_STATS_PAGE_YOUNG]->store(info->n_pages_made_young));
4344
4345 OK(fields[IDX_BUF_STATS_PAGE_NOT_YOUNG]->store(
4346 info->n_pages_not_made_young));
4347
4348 OK(fields[IDX_BUF_STATS_PAGE_YOUNG_RATE]->store(
4349 info->page_made_young_rate));
4350
4351 OK(fields[IDX_BUF_STATS_PAGE_NOT_YOUNG_RATE]->store(
4352 info->page_not_made_young_rate));
4353
4354 OK(fields[IDX_BUF_STATS_PAGE_READ]->store(info->n_pages_read));
4355
4356 OK(fields[IDX_BUF_STATS_PAGE_CREATED]->store(info->n_pages_created));
4357
4358 OK(fields[IDX_BUF_STATS_PAGE_WRITTEN]->store(info->n_pages_written));
4359
4360 OK(fields[IDX_BUF_STATS_GET]->store(info->n_page_gets));
4361
4362 OK(fields[IDX_BUF_STATS_PAGE_READ_RATE]->store(info->pages_read_rate));
4363
4364 OK(fields[IDX_BUF_STATS_PAGE_CREATE_RATE]->store(info->pages_created_rate));
4365
4366 OK(fields[IDX_BUF_STATS_PAGE_WRITTEN_RATE]->store(info->pages_written_rate));
4367
4368 if (info->n_page_get_delta) {
4369 OK(fields[IDX_BUF_STATS_HIT_RATE]->store(
4370 1000 - (1000 * info->page_read_delta
4371 / info->n_page_get_delta)));
4372
4373 OK(fields[IDX_BUF_STATS_MADE_YOUNG_PCT]->store(
4374 1000 * info->young_making_delta
4375 / info->n_page_get_delta));
4376
4377 OK(fields[IDX_BUF_STATS_NOT_MADE_YOUNG_PCT]->store(
4378 1000 * info->not_young_making_delta
4379 / info->n_page_get_delta));
4380 } else {
4381 OK(fields[IDX_BUF_STATS_HIT_RATE]->store(0));
4382 OK(fields[IDX_BUF_STATS_MADE_YOUNG_PCT]->store(0));
4383 OK(fields[IDX_BUF_STATS_NOT_MADE_YOUNG_PCT]->store(0));
4384 }
4385
4386 OK(fields[IDX_BUF_STATS_READ_AHREAD]->store(info->n_ra_pages_read));
4387
4388 OK(fields[IDX_BUF_STATS_READ_AHEAD_EVICTED]->store(
4389 info->n_ra_pages_evicted));
4390
4391 OK(fields[IDX_BUF_STATS_READ_AHEAD_RATE]->store(
4392 info->pages_readahead_rate));
4393
4394 OK(fields[IDX_BUF_STATS_READ_AHEAD_EVICT_RATE]->store(
4395 info->pages_evicted_rate));
4396
4397 OK(fields[IDX_BUF_STATS_LRU_IO_SUM]->store(info->io_sum));
4398
4399 OK(fields[IDX_BUF_STATS_LRU_IO_CUR]->store(info->io_cur));
4400
4401 OK(fields[IDX_BUF_STATS_UNZIP_SUM]->store(info->unzip_sum));
4402
4403 OK(fields[IDX_BUF_STATS_UNZIP_CUR]->store( info->unzip_cur));
4404
4405 DBUG_RETURN(schema_table_store_record(thd, table));
4406}
4407
4408/*******************************************************************//**
4409This is the function that loops through each buffer pool and fetch buffer
4410pool stats to information schema table: I_S_INNODB_BUFFER_POOL_STATS
4411@return 0 on success, 1 on failure */
4412static
4413int
4414i_s_innodb_buffer_stats_fill_table(
4415/*===============================*/
4416 THD* thd, /*!< in: thread */
4417 TABLE_LIST* tables, /*!< in/out: tables to fill */
4418 Item* ) /*!< in: condition (ignored) */
4419{
4420 int status = 0;
4421 buf_pool_info_t* pool_info;
4422
4423 DBUG_ENTER("i_s_innodb_buffer_fill_general");
4424
4425 /* Only allow the PROCESS privilege holder to access the stats */
4426 if (check_global_access(thd, PROCESS_ACL)) {
4427 DBUG_RETURN(0);
4428 }
4429
4430 pool_info = (buf_pool_info_t*) mem_zalloc(sizeof *pool_info);
4431
4432 /* Fetch individual buffer pool info */
4433 buf_stats_get_pool_info(pool_info);
4434 status = i_s_innodb_stats_fill(thd, tables, pool_info);
4435
4436 mem_free(pool_info);
4437
4438 DBUG_RETURN(status);
4439}
4440
4441/*******************************************************************//**
4442Bind the dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS.
4443@return 0 on success, 1 on failure */
4444static
4445int
4446i_s_innodb_buffer_pool_stats_init(
4447/*==============================*/
4448 void* p) /*!< in/out: table schema object */
4449{
4450 ST_SCHEMA_TABLE* schema;
4451
4452 DBUG_ENTER("i_s_innodb_buffer_pool_stats_init");
4453
4454 schema = reinterpret_cast<ST_SCHEMA_TABLE*>(p);
4455
4456 schema->fields_info = i_s_innodb_buffer_stats_fields_info;
4457 schema->fill_table = i_s_innodb_buffer_stats_fill_table;
4458
4459 DBUG_RETURN(0);
4460}
4461
4462UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_stats =
4463{
4464 /* the plugin type (a MYSQL_XXX_PLUGIN value) */
4465 /* int */
4466 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
4467
4468 /* pointer to type-specific plugin descriptor */
4469 /* void* */
4470 STRUCT_FLD(info, &i_s_info),
4471
4472 /* plugin name */
4473 /* const char* */
4474 STRUCT_FLD(name, "INNODB_BUFFER_POOL_STATS"),
4475
4476 /* plugin author (for SHOW PLUGINS) */
4477 /* const char* */
4478 STRUCT_FLD(author, plugin_author),
4479
4480 /* general descriptive text (for SHOW PLUGINS) */
4481 /* const char* */
4482 STRUCT_FLD(descr, "InnoDB Buffer Pool Statistics Information "),
4483
4484 /* the plugin license (PLUGIN_LICENSE_XXX) */
4485 /* int */
4486 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
4487
4488 /* the function to invoke when plugin is loaded */
4489 /* int (*)(void*); */
4490 STRUCT_FLD(init, i_s_innodb_buffer_pool_stats_init),
4491
4492 /* the function to invoke when plugin is unloaded */
4493 /* int (*)(void*); */
4494 STRUCT_FLD(deinit, i_s_common_deinit),
4495
4496 /* plugin version (for SHOW PLUGINS) */
4497 /* unsigned int */
4498 STRUCT_FLD(version, INNODB_VERSION_SHORT),
4499
4500 /* struct st_mysql_show_var* */
4501 STRUCT_FLD(status_vars, NULL),
4502
4503 /* struct st_mysql_sys_var** */
4504 STRUCT_FLD(system_vars, NULL),
4505
4506 /* reserved for dependency checking */
4507 /* void* */
4508 STRUCT_FLD(__reserved1, NULL),
4509};
4510
4511/* Fields of the dynamic table INNODB_BUFFER_POOL_PAGE. */
4512static ST_FIELD_INFO i_s_innodb_buffer_page_fields_info[] =
4513{
4514#define IDX_BUFFER_BLOCK_ID 0
4515 {STRUCT_FLD(field_name, "BLOCK_ID"),
4516 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4517 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4518 STRUCT_FLD(value, 0),
4519 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4520 STRUCT_FLD(old_name, ""),
4521 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4522
4523#define IDX_BUFFER_PAGE_SPACE 1
4524 {STRUCT_FLD(field_name, "SPACE"),
4525 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4526 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4527 STRUCT_FLD(value, 0),
4528 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4529 STRUCT_FLD(old_name, ""),
4530 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4531
4532#define IDX_BUFFER_PAGE_NUM 2
4533 {STRUCT_FLD(field_name, "PAGE_NUMBER"),
4534 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4535 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4536 STRUCT_FLD(value, 0),
4537 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4538 STRUCT_FLD(old_name, ""),
4539 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4540
4541#define IDX_BUFFER_PAGE_TYPE 3
4542 {STRUCT_FLD(field_name, "PAGE_TYPE"),
4543 STRUCT_FLD(field_length, 64),
4544 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4545 STRUCT_FLD(value, 0),
4546 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
4547 STRUCT_FLD(old_name, ""),
4548 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4549
4550#define IDX_BUFFER_PAGE_FLUSH_TYPE 4
4551 {STRUCT_FLD(field_name, "FLUSH_TYPE"),
4552 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4553 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4554 STRUCT_FLD(value, 0),
4555 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4556 STRUCT_FLD(old_name, ""),
4557 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4558
4559#define IDX_BUFFER_PAGE_FIX_COUNT 5
4560 {STRUCT_FLD(field_name, "FIX_COUNT"),
4561 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4562 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4563 STRUCT_FLD(value, 0),
4564 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4565 STRUCT_FLD(old_name, ""),
4566 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4567
4568#define IDX_BUFFER_PAGE_HASHED 6
4569 {STRUCT_FLD(field_name, "IS_HASHED"),
4570 STRUCT_FLD(field_length, 3),
4571 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4572 STRUCT_FLD(value, 0),
4573 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
4574 STRUCT_FLD(old_name, ""),
4575 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4576
4577#define IDX_BUFFER_PAGE_NEWEST_MOD 7
4578 {STRUCT_FLD(field_name, "NEWEST_MODIFICATION"),
4579 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4580 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4581 STRUCT_FLD(value, 0),
4582 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4583 STRUCT_FLD(old_name, ""),
4584 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4585
4586#define IDX_BUFFER_PAGE_OLDEST_MOD 8
4587 {STRUCT_FLD(field_name, "OLDEST_MODIFICATION"),
4588 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4589 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4590 STRUCT_FLD(value, 0),
4591 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4592 STRUCT_FLD(old_name, ""),
4593 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4594
4595#define IDX_BUFFER_PAGE_ACCESS_TIME 9
4596 {STRUCT_FLD(field_name, "ACCESS_TIME"),
4597 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4598 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4599 STRUCT_FLD(value, 0),
4600 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4601 STRUCT_FLD(old_name, ""),
4602 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4603
4604#define IDX_BUFFER_PAGE_TABLE_NAME 10
4605 {STRUCT_FLD(field_name, "TABLE_NAME"),
4606 STRUCT_FLD(field_length, 1024),
4607 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4608 STRUCT_FLD(value, 0),
4609 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
4610 STRUCT_FLD(old_name, ""),
4611 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4612
4613#define IDX_BUFFER_PAGE_INDEX_NAME 11
4614 {STRUCT_FLD(field_name, "INDEX_NAME"),
4615 STRUCT_FLD(field_length, 1024),
4616 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4617 STRUCT_FLD(value, 0),
4618 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
4619 STRUCT_FLD(old_name, ""),
4620 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4621
4622#define IDX_BUFFER_PAGE_NUM_RECS 12
4623 {STRUCT_FLD(field_name, "NUMBER_RECORDS"),
4624 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4625 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4626 STRUCT_FLD(value, 0),
4627 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4628 STRUCT_FLD(old_name, ""),
4629 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4630
4631#define IDX_BUFFER_PAGE_DATA_SIZE 13
4632 {STRUCT_FLD(field_name, "DATA_SIZE"),
4633 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4634 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4635 STRUCT_FLD(value, 0),
4636 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4637 STRUCT_FLD(old_name, ""),
4638 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4639
4640#define IDX_BUFFER_PAGE_ZIP_SIZE 14
4641 {STRUCT_FLD(field_name, "COMPRESSED_SIZE"),
4642 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4643 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4644 STRUCT_FLD(value, 0),
4645 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4646 STRUCT_FLD(old_name, ""),
4647 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4648
4649#define IDX_BUFFER_PAGE_STATE 15
4650 {STRUCT_FLD(field_name, "PAGE_STATE"),
4651 STRUCT_FLD(field_length, 64),
4652 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4653 STRUCT_FLD(value, 0),
4654 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
4655 STRUCT_FLD(old_name, ""),
4656 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4657
4658#define IDX_BUFFER_PAGE_IO_FIX 16
4659 {STRUCT_FLD(field_name, "IO_FIX"),
4660 STRUCT_FLD(field_length, 64),
4661 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4662 STRUCT_FLD(value, 0),
4663 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
4664 STRUCT_FLD(old_name, ""),
4665 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4666
4667#define IDX_BUFFER_PAGE_IS_OLD 17
4668 {STRUCT_FLD(field_name, "IS_OLD"),
4669 STRUCT_FLD(field_length, 3),
4670 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
4671 STRUCT_FLD(value, 0),
4672 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
4673 STRUCT_FLD(old_name, ""),
4674 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4675
4676#define IDX_BUFFER_PAGE_FREE_CLOCK 18
4677 {STRUCT_FLD(field_name, "FREE_PAGE_CLOCK"),
4678 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
4679 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
4680 STRUCT_FLD(value, 0),
4681 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
4682 STRUCT_FLD(old_name, ""),
4683 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
4684
4685 END_OF_ST_FIELD_INFO
4686};
4687
4688/*******************************************************************//**
4689Fill Information Schema table INNODB_BUFFER_PAGE with information
4690cached in the buf_page_info_t array
4691@return 0 on success, 1 on failure */
4692static
4693int
4694i_s_innodb_buffer_page_fill(
4695/*========================*/
4696 THD* thd, /*!< in: thread */
4697 TABLE_LIST* tables, /*!< in/out: tables to fill */
4698 const buf_page_info_t* info_array, /*!< in: array cached page
4699 info */
4700 ulint num_page, /*!< in: number of page info
4701 cached */
4702 mem_heap_t* heap) /*!< in: temp heap memory */
4703{
4704 TABLE* table;
4705 Field** fields;
4706
4707 DBUG_ENTER("i_s_innodb_buffer_page_fill");
4708
4709 table = tables->table;
4710
4711 fields = table->field;
4712
4713 /* Iterate through the cached array and fill the I_S table rows */
4714 for (ulint i = 0; i < num_page; i++) {
4715 const buf_page_info_t* page_info;
4716 const char* table_name;
4717 const char* index_name;
4718 const char* state_str;
4719 enum buf_page_state state;
4720
4721 page_info = info_array + i;
4722
4723 table_name = NULL;
4724 index_name = NULL;
4725 state_str = NULL;
4726
4727 OK(fields[IDX_BUFFER_BLOCK_ID]->store(page_info->block_id));
4728
4729 OK(fields[IDX_BUFFER_PAGE_SPACE]->store(page_info->space_id));
4730
4731 OK(fields[IDX_BUFFER_PAGE_NUM]->store(page_info->page_num));
4732
4733 OK(field_store_string(
4734 fields[IDX_BUFFER_PAGE_TYPE],
4735 i_s_page_type[page_info->page_type].type_str));
4736
4737 OK(fields[IDX_BUFFER_PAGE_FLUSH_TYPE]->store(
4738 page_info->flush_type));
4739
4740 OK(fields[IDX_BUFFER_PAGE_FIX_COUNT]->store(
4741 page_info->fix_count));
4742
4743 if (page_info->hashed) {
4744 OK(field_store_string(
4745 fields[IDX_BUFFER_PAGE_HASHED], "YES"));
4746 } else {
4747 OK(field_store_string(
4748 fields[IDX_BUFFER_PAGE_HASHED], "NO"));
4749 }
4750
4751 OK(fields[IDX_BUFFER_PAGE_NEWEST_MOD]->store(
4752 (longlong) page_info->newest_mod, true));
4753
4754 OK(fields[IDX_BUFFER_PAGE_OLDEST_MOD]->store(
4755 (longlong) page_info->oldest_mod, true));
4756
4757 OK(fields[IDX_BUFFER_PAGE_ACCESS_TIME]->store(
4758 page_info->access_time));
4759
4760 /* If this is an index page, fetch the index name
4761 and table name */
4762 if (page_info->page_type == I_S_PAGE_TYPE_INDEX) {
4763 const dict_index_t* index;
4764
4765 mutex_enter(&dict_sys->mutex);
4766 index = dict_index_get_if_in_cache_low(
4767 page_info->index_id);
4768
4769 /* Copy the index/table name under mutex. We
4770 do not want to hold the InnoDB mutex while
4771 filling the IS table */
4772 if (index) {
4773 const char* name_ptr = index->name;
4774
4775 if (name_ptr[0] == TEMP_INDEX_PREFIX) {
4776 name_ptr++;
4777 }
4778
4779 index_name = mem_heap_strdup(heap, name_ptr);
4780
4781 table_name = mem_heap_strdup(heap,
4782 index->table_name);
4783
4784 }
4785
4786 mutex_exit(&dict_sys->mutex);
4787 }
4788
4789 OK(field_store_string(
4790 fields[IDX_BUFFER_PAGE_TABLE_NAME], table_name));
4791
4792 OK(field_store_string(
4793 fields[IDX_BUFFER_PAGE_INDEX_NAME], index_name));
4794
4795 OK(fields[IDX_BUFFER_PAGE_NUM_RECS]->store(
4796 page_info->num_recs));
4797
4798 OK(fields[IDX_BUFFER_PAGE_DATA_SIZE]->store(
4799 page_info->data_size));
4800
4801 OK(fields[IDX_BUFFER_PAGE_ZIP_SIZE]->store(
4802 page_info->zip_ssize
4803 ? (PAGE_ZIP_MIN_SIZE >> 1) << page_info->zip_ssize
4804 : 0));
4805
4806#if BUF_PAGE_STATE_BITS > 3
4807# error "BUF_PAGE_STATE_BITS > 3, please ensure that all 1<<BUF_PAGE_STATE_BITS values are checked for"
4808#endif
4809 state = static_cast<enum buf_page_state>(page_info->page_state);
4810
4811 switch (state) {
4812 /* First three states are for compression pages and
4813 are not states we would get as we scan pages through
4814 buffer blocks */
4815 case BUF_BLOCK_ZIP_FREE:
4816 case BUF_BLOCK_ZIP_PAGE:
4817 case BUF_BLOCK_ZIP_DIRTY:
4818 state_str = NULL;
4819 break;
4820 case BUF_BLOCK_NOT_USED:
4821 state_str = "NOT_USED";
4822 break;
4823 case BUF_BLOCK_READY_FOR_USE:
4824 state_str = "READY_FOR_USE";
4825 break;
4826 case BUF_BLOCK_FILE_PAGE:
4827 state_str = "FILE_PAGE";
4828 break;
4829 case BUF_BLOCK_MEMORY:
4830 state_str = "MEMORY";
4831 break;
4832 case BUF_BLOCK_REMOVE_HASH:
4833 state_str = "REMOVE_HASH";
4834 break;
4835 };
4836
4837 OK(field_store_string(fields[IDX_BUFFER_PAGE_STATE],
4838 state_str));
4839
4840 switch (page_info->io_fix) {
4841 case BUF_IO_NONE:
4842 OK(field_store_string(fields[IDX_BUFFER_PAGE_IO_FIX],
4843 "IO_NONE"));
4844 break;
4845 case BUF_IO_READ:
4846 OK(field_store_string(fields[IDX_BUFFER_PAGE_IO_FIX],
4847 "IO_READ"));
4848 break;
4849 case BUF_IO_WRITE:
4850 OK(field_store_string(fields[IDX_BUFFER_PAGE_IO_FIX],
4851 "IO_WRITE"));
4852 break;
4853 }
4854
4855 OK(field_store_string(fields[IDX_BUFFER_PAGE_IS_OLD],
4856 (page_info->is_old) ? "YES" : "NO"));
4857
4858 OK(fields[IDX_BUFFER_PAGE_FREE_CLOCK]->store(
4859 page_info->freed_page_clock));
4860
4861 if (schema_table_store_record(thd, table)) {
4862 DBUG_RETURN(1);
4863 }
4864 }
4865
4866 DBUG_RETURN(0);
4867}
4868
4869/*******************************************************************//**
4870Set appropriate page type to a buf_page_info_t structure */
4871static
4872void
4873i_s_innodb_set_page_type(
4874/*=====================*/
4875 buf_page_info_t*page_info, /*!< in/out: structure to fill with
4876 scanned info */
4877 ulint page_type, /*!< in: page type */
4878 const byte* frame) /*!< in: buffer frame */
4879{
4880 if (page_type == FIL_PAGE_INDEX) {
4881 const page_t* page = (const page_t*) frame;
4882
4883 /* FIL_PAGE_INDEX is a bit special, its value
4884 is defined as 17855, so we cannot use FIL_PAGE_INDEX
4885 to index into i_s_page_type[] array, its array index
4886 in the i_s_page_type[] array is I_S_PAGE_TYPE_INDEX
4887 (1) */
4888 page_info->page_type = I_S_PAGE_TYPE_INDEX;
4889
4890 page_info->index_id = btr_page_get_index_id(page);
4891
4892 page_info->data_size = (ulint)(page_header_get_field(
4893 page, PAGE_HEAP_TOP) - (page_is_comp(page)
4894 ? PAGE_NEW_SUPREMUM_END
4895 : PAGE_OLD_SUPREMUM_END)
4896 - page_header_get_field(page, PAGE_GARBAGE));
4897
4898 page_info->num_recs = page_get_n_recs(page);
4899 } else if (page_type >= I_S_PAGE_TYPE_UNKNOWN) {
4900 /* Encountered an unknown page type */
4901 page_info->page_type = I_S_PAGE_TYPE_UNKNOWN;
4902 } else {
4903 /* Make sure we get the right index into the
4904 i_s_page_type[] array */
4905 ut_a(page_type == i_s_page_type[page_type].type_value);
4906
4907 page_info->page_type = page_type;
4908 }
4909
4910 if (page_info->page_type == FIL_PAGE_TYPE_ZBLOB
4911 || page_info->page_type == FIL_PAGE_TYPE_ZBLOB2) {
4912 page_info->page_num = mach_read_from_4(
4913 frame + FIL_PAGE_OFFSET);
4914 page_info->space_id = mach_read_from_4(
4915 frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
4916 }
4917}
4918
4919/*******************************************************************//**
4920Scans pages in the buffer cache, and collect their general information
4921into the buf_page_info_t array which is zero-filled. So any fields
4922that are not initialized in the function will default to 0 */
4923static
4924void
4925i_s_innodb_buffer_page_get_info(
4926/*============================*/
4927 const buf_page_t*bpage, /*!< in: buffer pool page to scan */
4928 ulint pos, /*!< in: buffer block position in
4929 buffer pool or in the LRU list */
4930 buf_page_info_t*page_info) /*!< in: zero filled info structure;
4931 out: structure filled with scanned
4932 info */
4933{
4934 page_info->block_id = pos;
4935
4936 page_info->page_state = buf_page_get_state(bpage);
4937
4938 /* Only fetch information for buffers that map to a tablespace,
4939 that is, buffer page with state BUF_BLOCK_ZIP_PAGE,
4940 BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_FILE_PAGE */
4941 if (buf_page_in_file(bpage)) {
4942 const byte* frame;
4943 ulint page_type;
4944
4945 page_info->space_id = buf_page_get_space(bpage);
4946
4947 page_info->page_num = buf_page_get_page_no(bpage);
4948
4949 page_info->flush_type = bpage->flush_type;
4950
4951 page_info->fix_count = bpage->buf_fix_count;
4952
4953 page_info->newest_mod = bpage->newest_modification;
4954
4955 page_info->oldest_mod = bpage->oldest_modification;
4956
4957 page_info->access_time = bpage->access_time;
4958
4959 page_info->zip_ssize = bpage->zip.ssize;
4960
4961 page_info->io_fix = bpage->io_fix;
4962
4963 page_info->is_old = bpage->old;
4964
4965 page_info->freed_page_clock = bpage->freed_page_clock;
4966
4967 if (page_info->page_state == BUF_BLOCK_FILE_PAGE) {
4968 const buf_block_t*block;
4969
4970 block = reinterpret_cast<const buf_block_t*>(bpage);
4971 frame = block->frame;
4972 page_info->hashed = (block->index != NULL);
4973 } else {
4974 ut_ad(page_info->zip_ssize);
4975 frame = bpage->zip.data;
4976 }
4977
4978 page_type = fil_page_get_type(frame);
4979
4980 i_s_innodb_set_page_type(page_info, page_type, frame);
4981 } else {
4982 page_info->page_type = I_S_PAGE_TYPE_UNKNOWN;
4983 }
4984}
4985
4986/*******************************************************************//**
4987This is the function that goes through each block of the buffer pool
4988and fetch information to information schema tables: INNODB_BUFFER_PAGE.
4989@return 0 on success, 1 on failure */
4990static
4991int
4992i_s_innodb_fill_buffer_pool(
4993/*========================*/
4994 THD* thd, /*!< in: thread */
4995 TABLE_LIST* tables) /*!< in/out: tables to fill */
4996{
4997 int status = 0;
4998 mem_heap_t* heap;
4999
5000 DBUG_ENTER("i_s_innodb_fill_buffer_pool");
5001
5002 heap = mem_heap_create(10000);
5003
5004 /* Go through each chunk of buffer pool. Currently, we only
5005 have one single chunk for each buffer pool */
5006 for (ulint n = 0; n < buf_pool->n_chunks; n++) {
5007 const buf_block_t* block;
5008 ulint n_blocks;
5009 buf_page_info_t* info_buffer;
5010 ulint num_page;
5011 ulint mem_size;
5012 ulint chunk_size;
5013 ulint num_to_process = 0;
5014 ulint block_id = 0;
5015 mutex_t* block_mutex;
5016
5017 /* Get buffer block of the nth chunk */
5018 block = buf_get_nth_chunk_block(buf_pool, n, &chunk_size);
5019 num_page = 0;
5020
5021 while (chunk_size > 0) {
5022 /* we cache maximum MAX_BUF_INFO_CACHED number of
5023 buffer page info */
5024 num_to_process = ut_min(chunk_size,
5025 MAX_BUF_INFO_CACHED);
5026
5027 mem_size = num_to_process * sizeof(buf_page_info_t);
5028
5029 /* For each chunk, we'll pre-allocate information
5030 structures to cache the page information read from
5031 the buffer pool. Doing so before obtain any mutex */
5032 info_buffer = (buf_page_info_t*) mem_heap_zalloc(
5033 heap, mem_size);
5034
5035 /* Obtain appropriate mutexes. Since this is diagnostic
5036 buffer pool info printout, we are not required to
5037 preserve the overall consistency, so we can
5038 release mutex periodically */
5039 buf_pool_mutex_enter();
5040
5041 /* GO through each block in the chunk */
5042 for (n_blocks = num_to_process; n_blocks--; block++) {
5043 block_mutex = buf_page_get_mutex_enter(&block->page);
5044 i_s_innodb_buffer_page_get_info(
5045 &block->page, block_id,
5046 info_buffer + num_page);
5047 mutex_exit(block_mutex);
5048 block_id++;
5049 num_page++;
5050 }
5051
5052 buf_pool_mutex_exit();
5053
5054 /* Fill in information schema table with information
5055 just collected from the buffer chunk scan */
5056 status = i_s_innodb_buffer_page_fill(
5057 thd, tables, info_buffer,
5058 num_page, heap);
5059
5060 /* If something goes wrong, break and return */
5061 if (status) {
5062 break;
5063 }
5064
5065 mem_heap_empty(heap);
5066 chunk_size -= num_to_process;
5067 num_page = 0;
5068 }
5069 }
5070
5071 mem_heap_free(heap);
5072
5073 DBUG_RETURN(status);
5074}
5075
5076/*******************************************************************//**
5077Fill page information for pages in InnoDB buffer pool to the
5078dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
5079@return 0 on success, 1 on failure */
5080static
5081int
5082i_s_innodb_buffer_page_fill_table(
5083/*==============================*/
5084 THD* thd, /*!< in: thread */
5085 TABLE_LIST* tables, /*!< in/out: tables to fill */
5086 Item* ) /*!< in: condition (ignored) */
5087{
5088 int status = 0;
5089
5090 DBUG_ENTER("i_s_innodb_buffer_page_fill_table");
5091
5092 /* deny access to user without PROCESS privilege */
5093 if (check_global_access(thd, PROCESS_ACL)) {
5094 DBUG_RETURN(0);
5095 }
5096
5097 /* Fetch information from pages in this buffer pool,
5098 and fill the corresponding I_S table */
5099 status = i_s_innodb_fill_buffer_pool(thd, tables);
5100
5101 DBUG_RETURN(status);
5102}
5103
5104/*******************************************************************//**
5105Bind the dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.
5106@return 0 on success, 1 on failure */
5107static
5108int
5109i_s_innodb_buffer_page_init(
5110/*========================*/
5111 void* p) /*!< in/out: table schema object */
5112{
5113 ST_SCHEMA_TABLE* schema;
5114
5115 DBUG_ENTER("i_s_innodb_buffer_page_init");
5116
5117 schema = reinterpret_cast<ST_SCHEMA_TABLE*>(p);
5118
5119 schema->fields_info = i_s_innodb_buffer_page_fields_info;
5120 schema->fill_table = i_s_innodb_buffer_page_fill_table;
5121
5122 DBUG_RETURN(0);
5123}
5124
5125UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_page =
5126{
5127 /* the plugin type (a MYSQL_XXX_PLUGIN value) */
5128 /* int */
5129 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
5130
5131 /* pointer to type-specific plugin descriptor */
5132 /* void* */
5133 STRUCT_FLD(info, &i_s_info),
5134
5135 /* plugin name */
5136 /* const char* */
5137 STRUCT_FLD(name, "INNODB_BUFFER_PAGE"),
5138
5139 /* plugin author (for SHOW PLUGINS) */
5140 /* const char* */
5141 STRUCT_FLD(author, plugin_author),
5142
5143 /* general descriptive text (for SHOW PLUGINS) */
5144 /* const char* */
5145 STRUCT_FLD(descr, "InnoDB Buffer Page Information"),
5146
5147 /* the plugin license (PLUGIN_LICENSE_XXX) */
5148 /* int */
5149 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
5150
5151 /* the function to invoke when plugin is loaded */
5152 /* int (*)(void*); */
5153 STRUCT_FLD(init, i_s_innodb_buffer_page_init),
5154
5155 /* the function to invoke when plugin is unloaded */
5156 /* int (*)(void*); */
5157 STRUCT_FLD(deinit, i_s_common_deinit),
5158
5159 /* plugin version (for SHOW PLUGINS) */
5160 /* unsigned int */
5161 STRUCT_FLD(version, INNODB_VERSION_SHORT),
5162
5163 /* struct st_mysql_show_var* */
5164 STRUCT_FLD(status_vars, NULL),
5165
5166 /* struct st_mysql_sys_var** */
5167 STRUCT_FLD(system_vars, NULL),
5168
5169 /* reserved for dependency checking */
5170 /* void* */
5171 STRUCT_FLD(__reserved1, NULL),
5172};
5173
5174static ST_FIELD_INFO i_s_innodb_buf_page_lru_fields_info[] =
5175{
5176#define IDX_BUF_LRU_POS 0
5177 {STRUCT_FLD(field_name, "LRU_POSITION"),
5178 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5179 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5180 STRUCT_FLD(value, 0),
5181 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5182 STRUCT_FLD(old_name, ""),
5183 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5184
5185#define IDX_BUF_LRU_PAGE_SPACE 1
5186 {STRUCT_FLD(field_name, "SPACE"),
5187 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5188 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5189 STRUCT_FLD(value, 0),
5190 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5191 STRUCT_FLD(old_name, ""),
5192 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5193
5194#define IDX_BUF_LRU_PAGE_NUM 2
5195 {STRUCT_FLD(field_name, "PAGE_NUMBER"),
5196 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5197 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5198 STRUCT_FLD(value, 0),
5199 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5200 STRUCT_FLD(old_name, ""),
5201 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5202
5203#define IDX_BUF_LRU_PAGE_TYPE 3
5204 {STRUCT_FLD(field_name, "PAGE_TYPE"),
5205 STRUCT_FLD(field_length, 64),
5206 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
5207 STRUCT_FLD(value, 0),
5208 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
5209 STRUCT_FLD(old_name, ""),
5210 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5211
5212#define IDX_BUF_LRU_PAGE_FLUSH_TYPE 4
5213 {STRUCT_FLD(field_name, "FLUSH_TYPE"),
5214 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5215 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5216 STRUCT_FLD(value, 0),
5217 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5218 STRUCT_FLD(old_name, ""),
5219 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5220
5221#define IDX_BUF_LRU_PAGE_FIX_COUNT 5
5222 {STRUCT_FLD(field_name, "FIX_COUNT"),
5223 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5224 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5225 STRUCT_FLD(value, 0),
5226 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5227 STRUCT_FLD(old_name, ""),
5228 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5229
5230#define IDX_BUF_LRU_PAGE_HASHED 6
5231 {STRUCT_FLD(field_name, "IS_HASHED"),
5232 STRUCT_FLD(field_length, 3),
5233 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
5234 STRUCT_FLD(value, 0),
5235 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
5236 STRUCT_FLD(old_name, ""),
5237 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5238
5239#define IDX_BUF_LRU_PAGE_NEWEST_MOD 7
5240 {STRUCT_FLD(field_name, "NEWEST_MODIFICATION"),
5241 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5242 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5243 STRUCT_FLD(value, 0),
5244 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5245 STRUCT_FLD(old_name, ""),
5246 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5247
5248#define IDX_BUF_LRU_PAGE_OLDEST_MOD 8
5249 {STRUCT_FLD(field_name, "OLDEST_MODIFICATION"),
5250 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5251 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5252 STRUCT_FLD(value, 0),
5253 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5254 STRUCT_FLD(old_name, ""),
5255 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5256
5257#define IDX_BUF_LRU_PAGE_ACCESS_TIME 9
5258 {STRUCT_FLD(field_name, "ACCESS_TIME"),
5259 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5260 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5261 STRUCT_FLD(value, 0),
5262 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5263 STRUCT_FLD(old_name, ""),
5264 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5265
5266#define IDX_BUF_LRU_PAGE_TABLE_NAME 10
5267 {STRUCT_FLD(field_name, "TABLE_NAME"),
5268 STRUCT_FLD(field_length, 1024),
5269 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
5270 STRUCT_FLD(value, 0),
5271 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
5272 STRUCT_FLD(old_name, ""),
5273 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5274
5275#define IDX_BUF_LRU_PAGE_INDEX_NAME 11
5276 {STRUCT_FLD(field_name, "INDEX_NAME"),
5277 STRUCT_FLD(field_length, 1024),
5278 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
5279 STRUCT_FLD(value, 0),
5280 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
5281 STRUCT_FLD(old_name, ""),
5282 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5283
5284#define IDX_BUF_LRU_PAGE_NUM_RECS 12
5285 {STRUCT_FLD(field_name, "NUMBER_RECORDS"),
5286 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5287 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5288 STRUCT_FLD(value, 0),
5289 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5290 STRUCT_FLD(old_name, ""),
5291 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5292
5293#define IDX_BUF_LRU_PAGE_DATA_SIZE 13
5294 {STRUCT_FLD(field_name, "DATA_SIZE"),
5295 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5296 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5297 STRUCT_FLD(value, 0),
5298 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5299 STRUCT_FLD(old_name, ""),
5300 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5301
5302#define IDX_BUF_LRU_PAGE_ZIP_SIZE 14
5303 {STRUCT_FLD(field_name, "COMPRESSED_SIZE"),
5304 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5305 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5306 STRUCT_FLD(value, 0),
5307 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5308 STRUCT_FLD(old_name, ""),
5309 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5310
5311#define IDX_BUF_LRU_PAGE_STATE 15
5312 {STRUCT_FLD(field_name, "COMPRESSED"),
5313 STRUCT_FLD(field_length, 3),
5314 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
5315 STRUCT_FLD(value, 0),
5316 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
5317 STRUCT_FLD(old_name, ""),
5318 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5319
5320#define IDX_BUF_LRU_PAGE_IO_FIX 16
5321 {STRUCT_FLD(field_name, "IO_FIX"),
5322 STRUCT_FLD(field_length, 64),
5323 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
5324 STRUCT_FLD(value, 0),
5325 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
5326 STRUCT_FLD(old_name, ""),
5327 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5328
5329#define IDX_BUF_LRU_PAGE_IS_OLD 17
5330 {STRUCT_FLD(field_name, "IS_OLD"),
5331 STRUCT_FLD(field_length, 3),
5332 STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
5333 STRUCT_FLD(value, 0),
5334 STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
5335 STRUCT_FLD(old_name, ""),
5336 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5337
5338#define IDX_BUF_LRU_PAGE_FREE_CLOCK 18
5339 {STRUCT_FLD(field_name, "FREE_PAGE_CLOCK"),
5340 STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
5341 STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
5342 STRUCT_FLD(value, 0),
5343 STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
5344 STRUCT_FLD(old_name, ""),
5345 STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
5346
5347 END_OF_ST_FIELD_INFO
5348};
5349
5350/*******************************************************************//**
5351Fill Information Schema table INNODB_BUFFER_PAGE_LRU with information
5352cached in the buf_page_info_t array
5353@return 0 on success, 1 on failure */
5354static
5355int
5356i_s_innodb_buf_page_lru_fill(
5357/*=========================*/
5358 THD* thd, /*!< in: thread */
5359 TABLE_LIST* tables, /*!< in/out: tables to fill */
5360 const buf_page_info_t* info_array, /*!< in: array cached page
5361 info */
5362 ulint num_page) /*!< in: number of page info
5363 cached */
5364{
5365 TABLE* table;
5366 Field** fields;
5367 mem_heap_t* heap;
5368
5369 DBUG_ENTER("i_s_innodb_buf_page_lru_fill");
5370
5371 table = tables->table;
5372
5373 fields = table->field;
5374
5375 heap = mem_heap_create(1000);
5376
5377 /* Iterate through the cached array and fill the I_S table rows */
5378 for (ulint i = 0; i < num_page; i++) {
5379 const buf_page_info_t* page_info;
5380 const char* table_name;
5381 const char* index_name;
5382 const char* state_str;
5383 enum buf_page_state state;
5384
5385 table_name = NULL;
5386 index_name = NULL;
5387 state_str = NULL;
5388
5389 page_info = info_array + i;
5390
5391 OK(fields[IDX_BUF_LRU_POS]->store(page_info->block_id));
5392
5393 OK(fields[IDX_BUF_LRU_PAGE_SPACE]->store(page_info->space_id));
5394
5395 OK(fields[IDX_BUF_LRU_PAGE_NUM]->store(page_info->page_num));
5396
5397 OK(field_store_string(
5398 fields[IDX_BUF_LRU_PAGE_TYPE],
5399 i_s_page_type[page_info->page_type].type_str));
5400
5401 OK(fields[IDX_BUF_LRU_PAGE_FLUSH_TYPE]->store(
5402 page_info->flush_type));
5403
5404 OK(fields[IDX_BUF_LRU_PAGE_FIX_COUNT]->store(
5405 page_info->fix_count));
5406
5407 if (page_info->hashed) {
5408 OK(field_store_string(
5409 fields[IDX_BUF_LRU_PAGE_HASHED], "YES"));
5410 } else {
5411 OK(field_store_string(
5412 fields[IDX_BUF_LRU_PAGE_HASHED], "NO"));
5413 }
5414
5415 OK(fields[IDX_BUF_LRU_PAGE_NEWEST_MOD]->store(
5416 page_info->newest_mod, true));
5417
5418 OK(fields[IDX_BUF_LRU_PAGE_OLDEST_MOD]->store(
5419 page_info->oldest_mod, true));
5420
5421 OK(fields[IDX_BUF_LRU_PAGE_ACCESS_TIME]->store(
5422 page_info->access_time));
5423
5424 /* If this is an index page, fetch the index name
5425 and table name */
5426 if (page_info->page_type == I_S_PAGE_TYPE_INDEX) {
5427 const dict_index_t* index;
5428
5429 mutex_enter(&dict_sys->mutex);
5430 index = dict_index_get_if_in_cache_low(
5431 page_info->index_id);
5432
5433 /* Copy the index/table name under mutex. We
5434 do not want to hold the InnoDB mutex while
5435 filling the IS table */
5436 if (index) {
5437 const char* name_ptr = index->name;
5438
5439 if (name_ptr[0] == TEMP_INDEX_PREFIX) {
5440 name_ptr++;
5441 }
5442
5443 index_name = mem_heap_strdup(heap, name_ptr);
5444
5445 table_name = mem_heap_strdup(heap,
5446 index->table_name);
5447 }
5448
5449 mutex_exit(&dict_sys->mutex);
5450 }
5451
5452 OK(field_store_string(
5453 fields[IDX_BUF_LRU_PAGE_TABLE_NAME], table_name));
5454
5455 OK(field_store_string(
5456 fields[IDX_BUF_LRU_PAGE_INDEX_NAME], index_name));
5457 OK(fields[IDX_BUF_LRU_PAGE_NUM_RECS]->store(
5458 page_info->num_recs));
5459
5460 OK(fields[IDX_BUF_LRU_PAGE_DATA_SIZE]->store(
5461 page_info->data_size));
5462
5463 OK(fields[IDX_BUF_LRU_PAGE_ZIP_SIZE]->store(
5464 page_info->zip_ssize ?
5465 512 << page_info->zip_ssize : 0));
5466
5467 state = static_cast<enum buf_page_state>(page_info->page_state);
5468
5469 switch (state) {
5470 /* Compressed page */
5471 case BUF_BLOCK_ZIP_PAGE:
5472 case BUF_BLOCK_ZIP_DIRTY:
5473 state_str = "YES";
5474 break;
5475 /* Uncompressed page */
5476 case BUF_BLOCK_FILE_PAGE:
5477 state_str = "NO";
5478 break;
5479 /* We should not see following states */
5480 case BUF_BLOCK_ZIP_FREE:
5481 case BUF_BLOCK_READY_FOR_USE:
5482 case BUF_BLOCK_NOT_USED:
5483 case BUF_BLOCK_MEMORY:
5484 case BUF_BLOCK_REMOVE_HASH:
5485 state_str = NULL;
5486 break;
5487 };
5488
5489 OK(field_store_string(fields[IDX_BUF_LRU_PAGE_STATE],
5490 state_str));
5491
5492 switch (page_info->io_fix) {
5493 case BUF_IO_NONE:
5494 OK(field_store_string(fields[IDX_BUF_LRU_PAGE_IO_FIX],
5495 "IO_NONE"));
5496 break;
5497 case BUF_IO_READ:
5498 OK(field_store_string(fields[IDX_BUF_LRU_PAGE_IO_FIX],
5499 "IO_READ"));
5500 break;
5501 case BUF_IO_WRITE:
5502 OK(field_store_string(fields[IDX_BUF_LRU_PAGE_IO_FIX],
5503 "IO_WRITE"));
5504 break;
5505 }
5506
5507 OK(field_store_string(fields[IDX_BUF_LRU_PAGE_IS_OLD],
5508 (page_info->is_old) ? "YES" : "NO"));
5509
5510 OK(fields[IDX_BUF_LRU_PAGE_FREE_CLOCK]->store(
5511 page_info->freed_page_clock));
5512
5513 if (schema_table_store_record(thd, table)) {
5514 mem_heap_free(heap);
5515 DBUG_RETURN(1);
5516 }
5517
5518 mem_heap_empty(heap);
5519 }
5520
5521 mem_heap_free(heap);
5522
5523 DBUG_RETURN(0);
5524}
5525
5526/*******************************************************************//**
5527This is the function that goes through buffer pool's LRU list
5528and fetch information to INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU.
5529@return 0 on success, 1 on failure */
5530static
5531int
5532i_s_innodb_fill_buffer_lru(
5533/*=======================*/
5534 THD* thd, /*!< in: thread */
5535 TABLE_LIST* tables) /*!< in/out: tables to fill */
5536{
5537 int status = 0;
5538 buf_page_info_t* info_buffer;
5539 ulint lru_pos = 0;
5540 const buf_page_t* bpage;
5541 ulint lru_len;
5542 mutex_t* block_mutex;
5543
5544 DBUG_ENTER("i_s_innodb_fill_buffer_lru");
5545
5546 /* Obtain buf_pool mutex before allocate info_buffer, since
5547 UT_LIST_GET_LEN(buf_pool->LRU) could change */
5548 mutex_enter(&LRU_list_mutex);
5549
5550 lru_len = UT_LIST_GET_LEN(buf_pool->LRU);
5551
5552 /* Print error message if malloc fail */
5553 info_buffer = (buf_page_info_t*) my_malloc(
5554 lru_len * sizeof *info_buffer, MYF(MY_WME));
5555
5556 if (!info_buffer) {
5557 status = 1;
5558 goto exit;
5559 }
5560
5561 memset(info_buffer, 0, lru_len * sizeof *info_buffer);
5562
5563 /* Walk through Pool's LRU list and print the buffer page
5564 information */
5565 bpage = UT_LIST_GET_LAST(buf_pool->LRU);
5566
5567 while (bpage != NULL) {
5568 block_mutex = buf_page_get_mutex_enter(bpage);
5569 /* Use the same function that collect buffer info for
5570 INNODB_BUFFER_PAGE to get buffer page info */
5571 i_s_innodb_buffer_page_get_info(bpage, lru_pos,
5572 (info_buffer + lru_pos));
5573
5574 bpage = UT_LIST_GET_PREV(LRU, bpage);
5575 mutex_exit(block_mutex);
5576
5577 lru_pos++;
5578 }
5579
5580 ut_ad(lru_pos == lru_len);
5581 ut_ad(lru_pos == UT_LIST_GET_LEN(buf_pool->LRU));
5582
5583exit:
5584 mutex_exit(&LRU_list_mutex);
5585
5586 if (info_buffer) {
5587 status = i_s_innodb_buf_page_lru_fill(
5588 thd, tables, info_buffer, lru_len);
5589
5590 my_free(info_buffer, MYF(MY_ALLOW_ZERO_PTR));
5591 }
5592
5593 DBUG_RETURN(status);
5594}
5595
5596/*******************************************************************//**
5597Fill page information for pages in InnoDB buffer pool to the
5598dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU
5599@return 0 on success, 1 on failure */
5600static
5601int
5602i_s_innodb_buf_page_lru_fill_table(
5603/*===============================*/
5604 THD* thd, /*!< in: thread */
5605 TABLE_LIST* tables, /*!< in/out: tables to fill */
5606 Item* ) /*!< in: condition (ignored) */
5607{
5608 int status = 0;
5609
5610 DBUG_ENTER("i_s_innodb_buf_page_lru_fill_table");
5611
5612 /* deny access to any users that do not hold PROCESS_ACL */
5613 if (check_global_access(thd, PROCESS_ACL)) {
5614 DBUG_RETURN(0);
5615 }
5616
5617 /* Fetch information from pages in this buffer pool's LRU list,
5618 and fill the corresponding I_S table */
5619 status = i_s_innodb_fill_buffer_lru(thd, tables);
5620
5621 DBUG_RETURN(status);
5622}
5623
5624/*******************************************************************//**
5625Bind the dynamic table INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU.
5626@return 0 on success, 1 on failure */
5627static
5628int
5629i_s_innodb_buffer_page_lru_init(
5630/*============================*/
5631 void* p) /*!< in/out: table schema object */
5632{
5633 ST_SCHEMA_TABLE* schema;
5634
5635 DBUG_ENTER("i_s_innodb_buffer_page_lru_init");
5636
5637 schema = reinterpret_cast<ST_SCHEMA_TABLE*>(p);
5638
5639 schema->fields_info = i_s_innodb_buf_page_lru_fields_info;
5640 schema->fill_table = i_s_innodb_buf_page_lru_fill_table;
5641
5642 DBUG_RETURN(0);
5643}
5644
5645UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_page_lru =
5646{
5647 /* the plugin type (a MYSQL_XXX_PLUGIN value) */
5648 /* int */
5649 STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
5650
5651 /* pointer to type-specific plugin descriptor */
5652 /* void* */
5653 STRUCT_FLD(info, &i_s_info),
5654
5655 /* plugin name */
5656 /* const char* */
5657 STRUCT_FLD(name, "INNODB_BUFFER_PAGE_LRU"),
5658
5659 /* plugin author (for SHOW PLUGINS) */
5660 /* const char* */
5661 STRUCT_FLD(author, plugin_author),
5662
5663 /* general descriptive text (for SHOW PLUGINS) */
5664 /* const char* */
5665 STRUCT_FLD(descr, "InnoDB Buffer Page in LRU"),
5666
5667 /* the plugin license (PLUGIN_LICENSE_XXX) */
5668 /* int */
5669 STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
5670
5671 /* the function to invoke when plugin is loaded */
5672 /* int (*)(void*); */
5673 STRUCT_FLD(init, i_s_innodb_buffer_page_lru_init),
5674
5675 /* the function to invoke when plugin is unloaded */
5676 /* int (*)(void*); */
5677 STRUCT_FLD(deinit, i_s_common_deinit),
5678
5679 /* plugin version (for SHOW PLUGINS) */
5680 /* unsigned int */
5681 STRUCT_FLD(version, INNODB_VERSION_SHORT),
5682
5683 /* struct st_mysql_show_var* */
5684 STRUCT_FLD(status_vars, NULL),
5685
5686 /* struct st_mysql_sys_var** */
5687 STRUCT_FLD(system_vars, NULL),
5688
5689 /* reserved for dependency checking */
5690 /* void* */
5691 STRUCT_FLD(__reserved1, NULL),
5692};
39365693
=== modified file 'Percona-Server/storage/innodb_plugin/handler/i_s.h'
--- Percona-Server/storage/innodb_plugin/handler/i_s.h 2012-08-15 14:05:13 +0000
+++ Percona-Server/storage/innodb_plugin/handler/i_s.h 2012-11-08 17:45:27 +0000
@@ -44,5 +44,8 @@
44extern struct st_mysql_plugin i_s_innodb_sys_indexes;44extern struct st_mysql_plugin i_s_innodb_sys_indexes;
45extern struct st_mysql_plugin i_s_innodb_sys_stats;45extern struct st_mysql_plugin i_s_innodb_sys_stats;
46extern struct st_mysql_plugin i_s_innodb_changed_pages;46extern struct st_mysql_plugin i_s_innodb_changed_pages;
47extern struct st_mysql_plugin i_s_innodb_buffer_page;
48extern struct st_mysql_plugin i_s_innodb_buffer_page_lru;
49extern struct st_mysql_plugin i_s_innodb_buffer_stats;
4750
48#endif /* i_s_h */51#endif /* i_s_h */
4952
=== modified file 'Percona-Server/storage/innodb_plugin/ibuf/ibuf0ibuf.c'
--- Percona-Server/storage/innodb_plugin/ibuf/ibuf0ibuf.c 2012-05-09 04:14:12 +0000
+++ Percona-Server/storage/innodb_plugin/ibuf/ibuf0ibuf.c 2012-11-08 17:45:27 +0000
@@ -2759,11 +2759,19 @@
27592759
2760 root = ibuf_tree_root_get(&mtr);2760 root = ibuf_tree_root_get(&mtr);
27612761
2762 err = btr_cur_pessimistic_insert(BTR_NO_LOCKING_FLAG2762 err = btr_cur_optimistic_insert(
2763 | BTR_NO_UNDO_LOG_FLAG,2763 BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG,
2764 cursor,2764 cursor, ibuf_entry, &ins_rec,
2765 ibuf_entry, &ins_rec,2765 &dummy_big_rec, 0, thr, &mtr);
2766 &dummy_big_rec, 0, thr, &mtr);2766
2767 if (err == DB_FAIL) {
2768 err = btr_cur_pessimistic_insert(
2769 BTR_NO_LOCKING_FLAG
2770 | BTR_NO_UNDO_LOG_FLAG,
2771 cursor, ibuf_entry, &ins_rec,
2772 &dummy_big_rec, 0, thr, &mtr);
2773 }
2774
2767 if (err == DB_SUCCESS) {2775 if (err == DB_SUCCESS) {
2768 /* Update the page max trx id field */2776 /* Update the page max trx id field */
2769 page_update_max_trx_id(btr_cur_get_block(cursor), NULL,2777 page_update_max_trx_id(btr_cur_get_block(cursor), NULL,
27702778
=== modified file 'Percona-Server/storage/innodb_plugin/include/buf0buf.h'
--- Percona-Server/storage/innodb_plugin/include/buf0buf.h 2012-04-02 02:09:15 +0000
+++ Percona-Server/storage/innodb_plugin/include/buf0buf.h 2012-11-08 17:45:27 +0000
@@ -103,6 +103,81 @@
103 before putting to the free list */103 before putting to the free list */
104};104};
105105
106/** This structure defines information we will fetch from each buffer pool. It
107will be used to print table IO stats */
108struct buf_pool_info_struct{
109 /* General buffer pool info */
110 ulint pool_size; /*!< Buffer Pool size in pages */
111 ulint lru_len; /*!< Length of buf_pool->LRU */
112 ulint old_lru_len; /*!< buf_pool->LRU_old_len */
113 ulint free_list_len; /*!< Length of buf_pool->free list */
114 ulint flush_list_len; /*!< Length of buf_pool->flush_list */
115 ulint n_pend_unzip; /*!< buf_pool->n_pend_unzip, pages
116 pending decompress */
117 ulint n_pend_reads; /*!< buf_pool->n_pend_reads, pages
118 pending read */
119 ulint n_pending_flush_lru; /*!< Pages pending flush in LRU */
120 ulint n_pending_flush_single_page;/*!< Pages pending to be
121 flushed as part of single page
122 flushes issued by various user
123 threads */
124 ulint n_pending_flush_list; /*!< Pages pending flush in FLUSH
125 LIST */
126 ulint n_pages_made_young; /*!< number of pages made young */
127 ulint n_pages_not_made_young; /*!< number of pages not made young */
128 ulint n_pages_read; /*!< buf_pool->n_pages_read */
129 ulint n_pages_created; /*!< buf_pool->n_pages_created */
130 ulint n_pages_written; /*!< buf_pool->n_pages_written */
131 ulint n_page_gets; /*!< buf_pool->n_page_gets */
132 ulint n_ra_pages_read_rnd; /*!< buf_pool->n_ra_pages_read_rnd,
133 number of pages readahead */
134 ulint n_ra_pages_read; /*!< buf_pool->n_ra_pages_read, number
135 of pages readahead */
136 ulint n_ra_pages_evicted; /*!< buf_pool->n_ra_pages_evicted,
137 number of readahead pages evicted
138 without access */
139 ulint n_page_get_delta; /*!< num of buffer pool page gets since
140 last printout */
141
142 /* Buffer pool access stats */
143 double page_made_young_rate; /*!< page made young rate in pages
144 per second */
145 double page_not_made_young_rate;/*!< page not made young rate
146 in pages per second */
147 double pages_read_rate; /*!< num of pages read per second */
148 double pages_created_rate; /*!< num of pages create per second */
149 double pages_written_rate; /*!< num of pages written per second */
150 ulint page_read_delta; /*!< num of pages read since last
151 printout */
152 ulint young_making_delta; /*!< num of pages made young since
153 last printout */
154 ulint not_young_making_delta; /*!< num of pages not make young since
155 last printout */
156
157 /* Statistics about read ahead algorithm. */
158 double pages_readahead_rnd_rate;/*!< random readahead rate in pages per
159 second */
160 double pages_readahead_rate; /*!< readahead rate in pages per
161 second */
162 double pages_evicted_rate; /*!< rate of readahead page evicted
163 without access, in pages per second */
164
165 /* Stats about LRU eviction */
166 ulint unzip_lru_len; /*!< length of buf_pool->unzip_LRU
167 list */
168 /* Counters for LRU policy */
169 ulint io_sum; /*!< buf_LRU_stat_sum.io */
170 ulint io_cur; /*!< buf_LRU_stat_cur.io, num of IO
171 for current interval */
172 ulint unzip_sum; /*!< buf_LRU_stat_sum.unzip */
173 ulint unzip_cur; /*!< buf_LRU_stat_cur.unzip, num
174 pages decompressed in current
175 interval */
176};
177
178typedef struct buf_pool_info_struct buf_pool_info_t;
179
180
106#ifndef UNIV_HOTBACKUP181#ifndef UNIV_HOTBACKUP
107/********************************************************************//**182/********************************************************************//**
108Creates the buffer pool.183Creates the buffer pool.
@@ -623,6 +698,16 @@
623buf_print_io(698buf_print_io(
624/*=========*/699/*=========*/
625 FILE* file); /*!< in: file where to print */700 FILE* file); /*!< in: file where to print */
701/*******************************************************************//**
702Collect buffer pool stats information for a buffer pool. Also
703record aggregated stats if there are more than one buffer pool
704in the server */
705UNIV_INTERN
706void
707buf_stats_get_pool_info(
708/*====================*/
709 buf_pool_info_t* pool_info); /*!< in/out: buffer pool info
710 to fill */
626/*********************************************************************//**711/*********************************************************************//**
627Returns the ratio in percents of modified pages in the buffer pool /712Returns the ratio in percents of modified pages in the buffer pool /
628database pages in the buffer pool.713database pages in the buffer pool.
@@ -1051,12 +1136,27 @@
1051ulint1136ulint
1052buf_get_free_list_len(void);1137buf_get_free_list_len(void);
1053/*=======================*/1138/*=======================*/
1139
1140/*********************************************************************//**
1141Get the nth chunk's buffer block in the specified buffer pool.
1142@return the nth chunk's buffer block. */
1143UNIV_INLINE
1144buf_block_t*
1145buf_get_nth_chunk_block(
1146/*====================*/
1147 const buf_pool_t* buf_pool, /*!< in: buffer pool instance */
1148 ulint n, /*!< in: nth chunk in the buffer pool */
1149 ulint* chunk_size); /*!< in: chunk size */
1150
1054#endif /* !UNIV_HOTBACKUP */1151#endif /* !UNIV_HOTBACKUP */
10551152
10561153
1057/** The common buffer control block structure1154/** The common buffer control block structure
1058for compressed and uncompressed frames */1155for compressed and uncompressed frames */
10591156
1157/** Number of bits used for buffer page states. */
1158#define BUF_PAGE_STATE_BITS 3
1159
1060struct buf_page_struct{1160struct buf_page_struct{
1061 /** @name General fields1161 /** @name General fields
1062 None of these bit-fields must be modified without holding1162 None of these bit-fields must be modified without holding
@@ -1071,7 +1171,8 @@
1071 unsigned offset:32; /*!< page number; also protected1171 unsigned offset:32; /*!< page number; also protected
1072 by buf_pool_mutex. */1172 by buf_pool_mutex. */
10731173
1074 unsigned state:3; /*!< state of the control block; also1174 unsigned state:BUF_PAGE_STATE_BITS;
1175 /*!< state of the control block; also
1075 protected by buf_pool_mutex.1176 protected by buf_pool_mutex.
1076 State transitions from1177 State transitions from
1077 BUF_BLOCK_READY_FOR_USE to1178 BUF_BLOCK_READY_FOR_USE to
10781179
=== modified file 'Percona-Server/storage/innodb_plugin/include/buf0buf.ic'
--- Percona-Server/storage/innodb_plugin/include/buf0buf.ic 2012-04-02 02:09:15 +0000
+++ Percona-Server/storage/innodb_plugin/include/buf0buf.ic 2012-11-08 17:45:27 +0000
@@ -36,6 +36,7 @@
36#include "buf0lru.h"36#include "buf0lru.h"
37#include "buf0rea.h"37#include "buf0rea.h"
38#include "srv0srv.h"38#include "srv0srv.h"
39
39/********************************************************************//**40/********************************************************************//**
40Reads the freed_page_clock of a buffer block.41Reads the freed_page_clock of a buffer block.
41@return freed_page_clock */42@return freed_page_clock */
@@ -1154,4 +1155,23 @@
1154 sync_thread_add_level(&block->lock, level, FALSE);1155 sync_thread_add_level(&block->lock, level, FALSE);
1155}1156}
1156#endif /* UNIV_SYNC_DEBUG */1157#endif /* UNIV_SYNC_DEBUG */
1158
1159/*********************************************************************//**
1160Get the nth chunk's buffer block in the specified buffer pool.
1161@return the nth chunk's buffer block. */
1162UNIV_INLINE
1163buf_block_t*
1164buf_get_nth_chunk_block(
1165/*====================*/
1166 const buf_pool_t* buf_pool, /*!< in: buffer pool instance */
1167 ulint n, /*!< in: nth chunk in the buffer pool */
1168 ulint* chunk_size) /*!< in: chunk size */
1169{
1170 const buf_chunk_t* chunk;
1171
1172 chunk = buf_pool->chunks + n;
1173 *chunk_size = chunk->size;
1174 return(chunk->blocks);
1175}
1157#endif /* !UNIV_HOTBACKUP */1176#endif /* !UNIV_HOTBACKUP */
1177
11581178
=== modified file 'Percona-Server/storage/innodb_plugin/include/fil0fil.h'
--- Percona-Server/storage/innodb_plugin/include/fil0fil.h 2012-05-09 04:14:12 +0000
+++ Percona-Server/storage/innodb_plugin/include/fil0fil.h 2012-11-08 17:45:27 +0000
@@ -142,6 +142,8 @@
142#define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */142#define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */
143#define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */143#define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */
144#define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */144#define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */
145#define FIL_PAGE_TYPE_LAST FIL_PAGE_TYPE_ZBLOB2
146 /*!< Last page type */
145/* @} */147/* @} */
146148
147/** Space types @{ */149/** Space types @{ */
148150
=== modified file 'Percona-Server/storage/innodb_plugin/include/log0log.h'
--- Percona-Server/storage/innodb_plugin/include/log0log.h 2012-06-14 09:16:03 +0000
+++ Percona-Server/storage/innodb_plugin/include/log0log.h 2012-11-08 17:45:27 +0000
@@ -41,6 +41,9 @@
41#include "sync0rw.h"41#include "sync0rw.h"
42#endif /* !UNIV_HOTBACKUP */42#endif /* !UNIV_HOTBACKUP */
4343
44/* Type used for all log sequence number storage and arithmetics */
45typedef ib_uint64_t lsn_t;
46
44/** Redo log buffer */47/** Redo log buffer */
45typedef struct log_struct log_t;48typedef struct log_struct log_t;
46/** Redo log group */49/** Redo log group */
4750
=== modified file 'Percona-Server/storage/innodb_plugin/include/univ.i'
--- Percona-Server/storage/innodb_plugin/include/univ.i 2012-08-20 03:14:02 +0000
+++ Percona-Server/storage/innodb_plugin/include/univ.i 2012-11-08 17:45:27 +0000
@@ -274,6 +274,24 @@
274 ========================274 ========================
275*/275*/
276276
277/** There are currently two InnoDB file formats which are used to group
278features with similar restrictions and dependencies. Using an enum allows
279switch statements to give a compiler warning when a new one is introduced. */
280enum innodb_file_formats_enum {
281 /** Antelope File Format: InnoDB/MySQL up to 5.1.
282 This format includes REDUNDANT and COMPACT row formats */
283 UNIV_FORMAT_A = 0,
284
285 /** Barracuda File Format: Introduced in InnoDB plugin for 5.1:
286 This format includes COMPRESSED and DYNAMIC row formats. It
287 includes the ability to create secondary indexes from data that
288 is not on the clustered index page and the ability to store more
289 data off the clustered index page. */
290 UNIV_FORMAT_B = 1
291};
292
293typedef enum innodb_file_formats_enum innodb_file_formats_t;
294
277/* The 2-logarithm of UNIV_PAGE_SIZE: */295/* The 2-logarithm of UNIV_PAGE_SIZE: */
278/* #define UNIV_PAGE_SIZE_SHIFT 14 */296/* #define UNIV_PAGE_SIZE_SHIFT 14 */
279#define UNIV_PAGE_SIZE_SHIFT_MAX 14297#define UNIV_PAGE_SIZE_SHIFT_MAX 14
280298
=== modified file 'Percona-Server/storage/innodb_plugin/page/page0cur.c'
--- Percona-Server/storage/innodb_plugin/page/page0cur.c 2012-02-17 09:42:04 +0000
+++ Percona-Server/storage/innodb_plugin/page/page0cur.c 2012-11-08 17:45:27 +0000
@@ -1902,6 +1902,7 @@
19021902
1903 /* Save to local variables some data associated with current_rec */1903 /* Save to local variables some data associated with current_rec */
1904 cur_slot_no = page_dir_find_owner_slot(current_rec);1904 cur_slot_no = page_dir_find_owner_slot(current_rec);
1905 ut_ad(cur_slot_no > 0);
1905 cur_dir_slot = page_dir_get_nth_slot(page, cur_slot_no);1906 cur_dir_slot = page_dir_get_nth_slot(page, cur_slot_no);
1906 cur_n_owned = page_dir_slot_get_n_owned(cur_dir_slot);1907 cur_n_owned = page_dir_slot_get_n_owned(cur_dir_slot);
19071908
19081909
=== modified file 'Percona-Server/storage/innodb_plugin/page/page0page.c'
--- Percona-Server/storage/innodb_plugin/page/page0page.c 2012-10-12 01:13:44 +0000
+++ Percona-Server/storage/innodb_plugin/page/page0page.c 2012-11-08 17:45:27 +0000
@@ -780,17 +780,23 @@
780 if (UNIV_LIKELY_NULL(new_page_zip)) {780 if (UNIV_LIKELY_NULL(new_page_zip)) {
781 mtr_set_log_mode(mtr, log_mode);781 mtr_set_log_mode(mtr, log_mode);
782782
783 DBUG_EXECUTE_IF("page_copy_rec_list_start_compress_fail",
784 goto zip_reorganize;);
785
783 if (UNIV_UNLIKELY786 if (UNIV_UNLIKELY
784 (!page_zip_compress(new_page_zip, new_page, index, mtr))) {787 (!page_zip_compress(new_page_zip, new_page, index, mtr))) {
788 ulint ret_pos;
789#ifndef DBUG_OFF
790zip_reorganize:
791#endif /* DBUG_OFF */
785 /* Before trying to reorganize the page,792 /* Before trying to reorganize the page,
786 store the number of preceding records on the page. */793 store the number of preceding records on the page. */
787 ulint ret_pos794 ret_pos = page_rec_get_n_recs_before(ret);
788 = page_rec_get_n_recs_before(ret);
789 /* Before copying, "ret" was the predecessor795 /* Before copying, "ret" was the predecessor
790 of the predefined supremum record. If it was796 of the predefined supremum record. If it was
791 the predefined infimum record, then it would797 the predefined infimum record, then it would
792 still be the infimum. Thus, the assertion798 still be the infimum, and we would have
793 ut_a(ret_pos > 0) would fail here. */799 ret_pos == 0. */
794800
795 if (UNIV_UNLIKELY801 if (UNIV_UNLIKELY
796 (!page_zip_reorganize(new_block, index, mtr))) {802 (!page_zip_reorganize(new_block, index, mtr))) {
@@ -806,15 +812,10 @@
806 btr_blob_dbg_add(new_page, index,812 btr_blob_dbg_add(new_page, index,
807 "copy_start_reorg_fail");813 "copy_start_reorg_fail");
808 return(NULL);814 return(NULL);
809 } else {
810 /* The page was reorganized:
811 Seek to ret_pos. */
812 ret = new_page + PAGE_NEW_INFIMUM;
813
814 do {
815 ret = rec_get_next_ptr(ret, TRUE);
816 } while (--ret_pos);
817 }815 }
816
817 /* The page was reorganized: Seek to ret_pos. */
818 ret = page_rec_get_nth(new_page, ret_pos);
818 }819 }
819 }820 }
820821
@@ -1050,6 +1051,7 @@
10501051
1051 n_owned = rec_get_n_owned_new(rec2) - count;1052 n_owned = rec_get_n_owned_new(rec2) - count;
1052 slot_index = page_dir_find_owner_slot(rec2);1053 slot_index = page_dir_find_owner_slot(rec2);
1054 ut_ad(slot_index > 0);
1053 slot = page_dir_get_nth_slot(page, slot_index);1055 slot = page_dir_get_nth_slot(page, slot_index);
1054 } else {1056 } else {
1055 rec_t* rec2 = rec;1057 rec_t* rec2 = rec;
@@ -1065,6 +1067,7 @@
10651067
1066 n_owned = rec_get_n_owned_old(rec2) - count;1068 n_owned = rec_get_n_owned_old(rec2) - count;
1067 slot_index = page_dir_find_owner_slot(rec2);1069 slot_index = page_dir_find_owner_slot(rec2);
1070 ut_ad(slot_index > 0);
1068 slot = page_dir_get_nth_slot(page, slot_index);1071 slot = page_dir_get_nth_slot(page, slot_index);
1069 }1072 }
10701073
@@ -1491,6 +1494,10 @@
1491 ulint n_owned;1494 ulint n_owned;
1492 const rec_t* rec;1495 const rec_t* rec;
14931496
1497 if (nth == 0) {
1498 return(page_get_infimum_rec(page));
1499 }
1500
1494 ut_ad(nth < UNIV_PAGE_SIZE / (REC_N_NEW_EXTRA_BYTES + 1));1501 ut_ad(nth < UNIV_PAGE_SIZE / (REC_N_NEW_EXTRA_BYTES + 1));
14951502
1496 for (i = 0;; i++) {1503 for (i = 0;; i++) {
14971504
=== modified file 'Percona-Server/storage/innodb_plugin/row/row0ins.c'
--- Percona-Server/storage/innodb_plugin/row/row0ins.c 2012-08-20 03:14:02 +0000
+++ Percona-Server/storage/innodb_plugin/row/row0ins.c 2012-11-08 17:45:27 +0000
@@ -2192,9 +2192,16 @@
21922192
2193 goto function_exit;2193 goto function_exit;
2194 }2194 }
2195 err = btr_cur_pessimistic_insert(2195
2196 err = btr_cur_optimistic_insert(
2196 0, &cursor, entry, &insert_rec, &big_rec,2197 0, &cursor, entry, &insert_rec, &big_rec,
2197 n_ext, thr, &mtr);2198 n_ext, thr, &mtr);
2199
2200 if (err == DB_FAIL) {
2201 err = btr_cur_pessimistic_insert(
2202 0, &cursor, entry, &insert_rec,
2203 &big_rec, n_ext, thr, &mtr);
2204 }
2198 }2205 }
2199 }2206 }
22002207
22012208
=== modified file 'Percona-Server/storage/innodb_plugin/row/row0merge.c'
--- Percona-Server/storage/innodb_plugin/row/row0merge.c 2012-04-02 02:09:15 +0000
+++ Percona-Server/storage/innodb_plugin/row/row0merge.c 2012-11-08 17:45:27 +0000
@@ -1215,11 +1215,25 @@
1215 goto err_exit;1215 goto err_exit;
1216 }1216 }
12171217
1218 /* Store the cursor position on the last user
1219 record on the page. */
1220 btr_pcur_move_to_prev_on_page(&pcur);
1221 /* Leaf pages must never be empty, unless
1222 this is the only page in the index tree. */
1223 ut_ad(btr_pcur_is_on_user_rec(&pcur)
1224 || buf_block_get_page_no(
1225 btr_pcur_get_block(&pcur))
1226 == clust_index->page);
1227
1218 btr_pcur_store_position(&pcur, &mtr);1228 btr_pcur_store_position(&pcur, &mtr);
1219 mtr_commit(&mtr);1229 mtr_commit(&mtr);
1220 mtr_start(&mtr);1230 mtr_start(&mtr);
1231 /* Restore position on the record, or its
1232 predecessor if the record was purged
1233 meanwhile. */
1221 btr_pcur_restore_position(BTR_SEARCH_LEAF,1234 btr_pcur_restore_position(BTR_SEARCH_LEAF,
1222 &pcur, &mtr);1235 &pcur, &mtr);
1236 /* Move to the successor of the original record. */
1223 has_next = btr_pcur_move_to_next_user_rec(&pcur, &mtr);1237 has_next = btr_pcur_move_to_next_user_rec(&pcur, &mtr);
1224 }1238 }
12251239
12261240
=== modified file 'Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins.sql'
--- Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins.sql 2008-10-30 10:38:18 +0000
+++ Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins.sql 2012-11-08 17:45:27 +0000
@@ -7,3 +7,6 @@
7INSTALL PLUGIN innodb_cmp_reset SONAME 'ha_innodb.so';7INSTALL PLUGIN innodb_cmp_reset SONAME 'ha_innodb.so';
8INSTALL PLUGIN innodb_cmpmem SONAME 'ha_innodb.so';8INSTALL PLUGIN innodb_cmpmem SONAME 'ha_innodb.so';
9INSTALL PLUGIN innodb_cmpmem_reset SONAME 'ha_innodb.so';9INSTALL PLUGIN innodb_cmpmem_reset SONAME 'ha_innodb.so';
10INSTALL PLUGIN innodb_buffer_pool_stats SONAME 'ha_innodb.so';
11INSTALL PLUGIN innodb_buffer_page SONAME 'ha_innodb.so';
12INSTALL PLUGIN innodb_buffer_page_lru SONAME 'ha_innodb.so';
1013
=== modified file 'Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins_win.sql'
--- Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins_win.sql 2008-10-31 12:21:43 +0000
+++ Percona-Server/storage/innodb_plugin/scripts/install_innodb_plugins_win.sql 2012-11-08 17:45:27 +0000
@@ -7,3 +7,6 @@
7INSTALL PLUGIN innodb_cmp_reset SONAME 'ha_innodb.dll';7INSTALL PLUGIN innodb_cmp_reset SONAME 'ha_innodb.dll';
8INSTALL PLUGIN innodb_cmpmem SONAME 'ha_innodb.dll';8INSTALL PLUGIN innodb_cmpmem SONAME 'ha_innodb.dll';
9INSTALL PLUGIN innodb_cmpmem_reset SONAME 'ha_innodb.dll';9INSTALL PLUGIN innodb_cmpmem_reset SONAME 'ha_innodb.dll';
10INSTALL PLUGIN innodb_buffer_pool_stats SONAME 'ha_innodb.dll';
11INSTALL PLUGIN innodb_buffer_page SONAME 'ha_innodb.dll';
12INSTALL PLUGIN innodb_buffer_page_lru SONAME 'ha_innodb.dll';
1013
=== modified file 'Percona-Server/support-files/mysql.spec.sh'
--- Percona-Server/support-files/mysql.spec.sh 2011-10-04 13:58:19 +0000
+++ Percona-Server/support-files/mysql.spec.sh 2012-11-08 17:45:27 +0000
@@ -374,7 +374,7 @@
374# Evaluate current setting of $DEBUG374# Evaluate current setting of $DEBUG
375if [ $DEBUG -gt 0 ] ; then375if [ $DEBUG -gt 0 ] ; then
376 OPT_COMMENT='--with-comment="%{debug_comment}"'376 OPT_COMMENT='--with-comment="%{debug_comment}"'
377 OPT_DEBUG='--with-debug'377 OPT_DEBUG='--with-debug --enable-mysql-maintainer-mode=no'
378 CFLAGS=`echo " $CFLAGS " | \378 CFLAGS=`echo " $CFLAGS " | \
379 sed -e 's/ -O[0-9]* / /' -e 's/ -unroll2 / /' -e 's/ -ip / /' \379 sed -e 's/ -O[0-9]* / /' -e 's/ -unroll2 / /' -e 's/ -ip / /' \
380 -e 's/^ //' -e 's/ $//'`380 -e 's/^ //' -e 's/ $//'`
@@ -1191,6 +1191,11 @@
1191# merging BK trees)1191# merging BK trees)
1192##############################################################################1192##############################################################################
1193%changelog1193%changelog
1194* Tue Sep 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
1195
1196- Disable "maintainer mode" in debug builds, there is a cast ulonglong -> int
1197 in the sources (since 2007) that would cause builds to fail.
1198
1194* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>1199* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
11951200
1196- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace1201- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
11971202
=== modified file 'Percona-Server/vio/viosslfactories.c'
--- Percona-Server/vio/viosslfactories.c 2012-08-20 00:29:22 +0000
+++ Percona-Server/vio/viosslfactories.c 2012-11-08 17:45:27 +0000
@@ -101,47 +101,51 @@
101 DBUG_ENTER("vio_set_cert_stuff");101 DBUG_ENTER("vio_set_cert_stuff");
102 DBUG_PRINT("enter", ("ctx: 0x%lx cert_file: %s key_file: %s",102 DBUG_PRINT("enter", ("ctx: 0x%lx cert_file: %s key_file: %s",
103 (long) ctx, cert_file, key_file));103 (long) ctx, cert_file, key_file));
104 if (cert_file)104
105 {105 if (!cert_file && key_file)
106 if (SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)106 cert_file= key_file;
107 {107
108 *error= SSL_INITERR_CERT;108 if (!key_file && cert_file)
109 DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));109 key_file= cert_file;
110 DBUG_EXECUTE("error", ERR_print_errors_fp(DBUG_FILE););110
111 fprintf(stderr, "SSL error: %s from '%s'\n", sslGetErrString(*error),111 if (cert_file &&
112 cert_file);112 SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
113 fflush(stderr);113 {
114 DBUG_RETURN(1);114 *error= SSL_INITERR_CERT;
115 }
116
117 if (!key_file)
118 key_file= cert_file;
119
120 if (SSL_CTX_use_PrivateKey_file(ctx, key_file, SSL_FILETYPE_PEM) <= 0)
121 {
122 *error= SSL_INITERR_KEY;
123 DBUG_PRINT("error", ("%s from file '%s'", sslGetErrString(*error), key_file));
124 DBUG_EXECUTE("error", ERR_print_errors_fp(DBUG_FILE););
125 fprintf(stderr, "SSL error: %s from '%s'\n", sslGetErrString(*error),
126 key_file);
127 fflush(stderr);
128 DBUG_RETURN(1);
129 }
130
131 /*
132 If we are using DSA, we can copy the parameters from the private key
133 Now we know that a key and cert have been set against the SSL context
134 */
135 if (!SSL_CTX_check_private_key(ctx))
136 {
137 *error= SSL_INITERR_NOMATCH;
138 DBUG_PRINT("error", ("%s",sslGetErrString(*error)));
139 DBUG_EXECUTE("error", ERR_print_errors_fp(DBUG_FILE););
140 fprintf(stderr, "SSL error: %s\n", sslGetErrString(*error));
141 fflush(stderr);
142 DBUG_RETURN(1);
143 }
144 }
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches