From: Marc Alff Date: May 31 2012 11:15am Subject: bzr push into mysql-trunk-wl6135 branch (marc.alff:3795 to 3797) WL#6135 List-Archive: http://lists.mysql.com/commits/144046 Message-Id: <201205311115.q4VBFqjY030790@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3797 Marc Alff 2012-05-31 WL#6135 PERFORMANCE_SCHEMA ENABLED BY DEFAULT Removed --table-cache, improved tests. modified: mysql-test/r/mysqld--help-notwin.result mysql-test/r/mysqld--help-win.result sql/mysqld.cc sql/mysqld.h storage/perfschema/pfs_autosize.cc 3796 Marc Alff 2012-05-31 [merge] Merge mysql-trunk --> mysql-trunk-wl6135 added: mysql-test/include/wl6301.inc mysql-test/r/wl6301_1_not_windows.result mysql-test/r/wl6301_2_not_windows.result mysql-test/r/wl6301_3.result mysql-test/t/wl6301_1_not_windows-master.opt mysql-test/t/wl6301_1_not_windows.test mysql-test/t/wl6301_2_not_windows-master.opt mysql-test/t/wl6301_2_not_windows.test mysql-test/t/wl6301_3-master.opt mysql-test/t/wl6301_3.test modified: mysql-test/r/alter_table.result mysql-test/r/ipv6.result mysql-test/r/mysqld--help-notwin.result mysql-test/r/mysqld--help-win.result mysql-test/t/alter_table.test mysql-test/t/ipv6.test sql/mysqld.cc sql/sys_vars.cc storage/innobase/btr/btr0cur.cc storage/innobase/buf/buf0flu.cc storage/innobase/include/dict0dict.h storage/innobase/include/dict0dict.ic storage/innobase/include/row0mysql.h storage/innobase/row/row0ins.cc storage/innobase/row/row0mysql.cc 3795 Marc Alff 2012-05-31 Test cleanup, test using platforms with PFS_ALIGN only added: mysql-test/suite/perfschema/include/have_aligned_memory.inc modified: mysql-test/suite/perfschema/t/sizing_default.test mysql-test/suite/perfschema/t/sizing_high.test mysql-test/suite/perfschema/t/sizing_low.test mysql-test/suite/perfschema/t/sizing_med.test === added file 'mysql-test/include/wl6301.inc' --- a/mysql-test/include/wl6301.inc 1970-01-01 00:00:00 +0000 +++ b/mysql-test/include/wl6301.inc 2012-05-31 08:58:12 +0000 @@ -0,0 +1,128 @@ +--source include/not_windows.inc + +--perl +my $MYSQL = $ENV{'MYSQL'}; +my $MYSQLADMIN = $ENV{'MYSQLADMIN'}; +my $MASTER_MYPORT = $ENV{'MASTER_MYPORT'}; +my $MYSQLTEST_VARDIR = $ENV{'MYSQLTEST_VARDIR'}; +my $LOG_FILE = $ENV{'WL6301_LOG_FILE'}; + +my @ipv4_addresses = split (/\n/, `ifconfig | grep 'inet addr' | sed 's/^.*inet addr://' | sed 's/ .*\$//'`); +my @ipv6_addresses = split (/\n/, `ifconfig | grep 'inet6 addr.*Scope:Global' | sed 's/^.*inet6 addr: //' | sed 's/ .*\$//' | sed 's|/.*\$||'`); + +push (@ipv6_addresses, '::1'); + +open (LOGFH, ">$LOG_FILE") or + die "Can not open '$LOG_FILE': $!\n"; + +my $ipv4_failed = 0; + +foreach my $ip (@ipv4_addresses) +{ + print LOGFH "- ipv4: '$ip'\n"; + + my $rc = + system( + "$MYSQL " . + "--host=127.0.0.1 " . + "--port=$MASTER_MYPORT " . + "--user=root " . + "test " . + "-e 'GRANT ALL PRIVILEGES ON test.* TO u1@$ip;'"); + + print LOGFH " GRANT status: $rc\n"; + + $ipv4_failed |= $rc; + + $rc = + system( + "$MYSQLADMIN " . + "--host=$ip " . + "--port=$MASTER_MYPORT " . + "--user=u1 " . + "ping > /dev/null 2>&1"); + + print LOGFH " Connect u1@$ip status: $rc\n"; + + $ipv4_failed |= $rc; + + $rc = + system( + "$MYSQL " . + "--host=127.0.0.1 " . + "--port=$MASTER_MYPORT " . + "--user=root " . + "test " . + "-e 'DROP USER u1@$ip;'"); + + print LOGFH " DROP USER status: $rc\n"; + + $ipv4_failed |= $rc; +} + +my $ipv6_failed = 0; + +foreach my $ip (@ipv6_addresses) +{ + print LOGFH "- ipv6: '$ip'\n"; + + my $rc = + system( + "$MYSQL " . + "--host=127.0.0.1 " . + "--port=$MASTER_MYPORT " . + "--user=root " . + "test " . + "-e 'GRANT ALL PRIVILEGES ON test.* TO u1@$ip;'"); + + print LOGFH " GRANT status: $rc\n"; + + $ipv6_failed |= $rc; + + $rc = + system( + "$MYSQLADMIN " . + "--host=$ip " . + "--port=$MASTER_MYPORT " . + "--user=u1 " . + "ping > /dev/null 2>&1"); + + print LOGFH " Connect u1@$ip status: $rc\n"; + + $ipv6_failed |= $rc; + + $rc = + system( + "$MYSQL " . + "--host=127.0.0.1 " . + "--port=$MASTER_MYPORT " . + "--user=root " . + "test " . + "-e 'DROP USER u1@$ip;'"); + + print LOGFH " DROP USER status: $rc\n"; + + $ipv6_failed |= $rc; +} + +close LOGFH; + +unless ($ipv4_failed) +{ + print "IPv4 connectivity: OK\n"; +} +else +{ + print "IPv4 connectivity: FAIL\n"; +} + +unless ($ipv6_failed) +{ + print "IPv6 connectivity: OK\n"; +} +else +{ + print "IPv6 connectivity: FAIL\n"; +} + +EOF === modified file 'mysql-test/r/alter_table.result' --- a/mysql-test/r/alter_table.result 2012-05-18 11:06:00 +0000 +++ b/mysql-test/r/alter_table.result 2012-05-31 08:18:44 +0000 @@ -1651,6 +1651,12 @@ info: Records: 2 Duplicates: 0 Warning ALTER TABLE tm1 ADD COLUMN d VARCHAR(200); affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE ti1 ADD COLUMN d2 VARCHAR(200); +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE tm1 ADD COLUMN d2 VARCHAR(200); +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 ADD COLUMN e ENUM('a', 'b') FIRST; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 @@ -1669,12 +1675,6 @@ info: Records: 0 Duplicates: 0 Warning ALTER TABLE tm1 ADD INDEX im1(b); affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 -ALTER TABLE ti1 ADD PRIMARY KEY (a); -affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 -ALTER TABLE tm1 ADD PRIMARY KEY (a); -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 ADD UNIQUE INDEX ii2 (c); affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 @@ -1689,6 +1689,26 @@ Warning 124 InnoDB rebuilding table to a ALTER TABLE tm1 ADD FULLTEXT INDEX im3 (d); affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE ti1 ADD FULLTEXT INDEX ii4 (d2); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE tm1 ADD FULLTEXT INDEX im4 (d2); +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE ti1 ADD PRIMARY KEY(a); +ERROR HY000: InnoDB presently supports one FULLTEXT index creation at a time +ALTER TABLE ti1 ADD PRIMARY KEY(a), ALGORITHM=COPY; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE tm1 ADD PRIMARY KEY(a); +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE ti1 DROP COLUMN d2; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE tm1 DROP COLUMN d2; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 ADD CONSTRAINT fi1 FOREIGN KEY (b) REFERENCES ti2(a); affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 === modified file 'mysql-test/r/ipv6.result' --- a/mysql-test/r/ipv6.result 2011-05-03 13:04:00 +0000 +++ b/mysql-test/r/ipv6.result 2012-05-31 08:58:12 +0000 @@ -108,6 +108,120 @@ DROP TABLE IF EXISTS t1; SELECT inet6_ntoa(@nip6); inet6_ntoa(@nip6) ::1 +=============Test of '127.0.0.1' (IPv4) =========================== +mysqld is alive +CREATE USER testuser@'127.0.0.1' identified by '1234'; +GRANT ALL ON test.* TO testuser@'127.0.0.1'; +SHOW GRANTS FOR testuser@'127.0.0.1'; +Grants for testuser@stripped +GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' +GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1' +SELECT USER(); +USER() +root@localhost +SELECT current_user(); +current_user() +root@localhost +SHOW PROCESSLIST; +REVOKE ALL ON test.* FROM testuser@'127.0.0.1'; +RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1'; +SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876'); +SELECT USER(); +USER() +root@localhost +DROP USER testuser1@'127.0.0.1'; +SET @nip= inet_aton('127.0.0.1'); +CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int); +INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip); +SELECT inet_ntoa(c1) FROM t1; +inet_ntoa(c1) +127.0.0.1 +SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1; +inet_ntoa(CAST(c1 AS UNSIGNED)) +127.0.0.1 +SELECT inet_ntoa(c2) FROM t1; +inet_ntoa(c2) +127.0.0.1 +SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1; +inet_ntoa(CAST(c2 AS UNSIGNED)) +127.0.0.1 +SELECT inet_ntoa(c3) FROM t1; +inet_ntoa(c3) +127.0.0.1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '2130706433\x00\x00\x00\x00\x00\x00' +SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1; +inet_ntoa(CAST(c3 AS UNSIGNED)) +127.0.0.1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '2130706433\x00\x00\x00\x00\x00\x00' +SELECT inet_ntoa(c4) FROM t1; +inet_ntoa(c4) +127.0.0.1 +SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1; +inet_ntoa(CAST(c4 AS UNSIGNED)) +127.0.0.1 +SELECT inet_ntoa(c5) FROM t1; +inet_ntoa(c5) +127.0.0.1 +SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1; +inet_ntoa(CAST(c5 AS UNSIGNED)) +127.0.0.1 +SELECT inet_ntoa(c6) FROM t1; +inet_ntoa(c6) +127.0.0.1 +DROP TABLE IF EXISTS t1; +SELECT @nip; +@nip +2130706433 +SELECT inet_ntoa(@nip); +inet_ntoa(@nip) +127.0.0.1 +SET @nip6= inet6_aton('127.0.0.1'); +CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int); +INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6); +Warnings: +Warning 1366 Incorrect integer value: '\x7F\x00\x00\x01' for column 'c6' at row 1 +SELECT inet6_ntoa(c1) FROM t1; +inet6_ntoa(c1) +127.0.0.1 +SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1; +inet6_ntoa(CAST(c1 AS BINARY(16))) +7f00:1:: +SELECT inet6_ntoa(c2) FROM t1; +inet6_ntoa(c2) +NULL +SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1; +inet6_ntoa(CAST(c2 AS BINARY(16))) +7f00:1:: +SELECT inet6_ntoa(c3) FROM t1; +inet6_ntoa(c3) +7f00:1:: +SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1; +inet6_ntoa(CAST(c3 AS BINARY(16))) +7f00:1:: +SELECT inet6_ntoa(c4) FROM t1; +inet6_ntoa(c4) +NULL +SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1; +inet6_ntoa(CAST(c4 AS BINARY(16))) +7f00:1:: +SELECT inet6_ntoa(c5) FROM t1; +inet6_ntoa(c5) +NULL +SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1; +inet6_ntoa(CAST(c5 AS BINARY(16))) +7f00:1:: +SELECT inet6_ntoa(c6) FROM t1; +inet6_ntoa(c6) +NULL +SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1; +inet6_ntoa(CAST(c6 AS BINARY(16))) +3000:: +DROP TABLE IF EXISTS t1; +SELECT inet6_ntoa(@nip6); +inet6_ntoa(@nip6) +127.0.0.1 =============Test of '::1/128' ==================================== =============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ==== mysqld is alive === modified file 'mysql-test/r/mysqld--help-notwin.result' --- a/mysql-test/r/mysqld--help-notwin.result 2012-05-29 17:39:06 +0000 +++ b/mysql-test/r/mysqld--help-notwin.result 2012-05-31 11:14:10 +0000 @@ -890,7 +890,6 @@ The following options may be given as th safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement. - --table-cache=# Deprecated; use --table-open-cache instead. --table-definition-cache=# The number of cached table definitions --table-open-cache=# @@ -949,7 +948,7 @@ autocommit TRUE automatic-sp-privileges TRUE back-log 50 big-tables FALSE -bind-address 0.0.0.0 +bind-address :: binlog-cache-size 32768 binlog-checksum NONE binlog-direct-non-transactional-updates FALSE @@ -1201,7 +1200,6 @@ sync-master-info 0 sync-relay-log 0 sync-relay-log-info 0 sysdate-is-now FALSE -table-cache 400 table-definition-cache 400 table-open-cache 400 table-open-cache-instances 1 === modified file 'mysql-test/r/mysqld--help-win.result' --- a/mysql-test/r/mysqld--help-win.result 2012-05-29 23:35:24 +0000 +++ b/mysql-test/r/mysqld--help-win.result 2012-05-31 11:14:10 +0000 @@ -898,7 +898,6 @@ The following options may be given as th safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement. - --table-cache=# Deprecated; use --table-open-cache instead. --table-definition-cache=# The number of cached table definitions --table-open-cache=# @@ -957,7 +956,7 @@ autocommit TRUE automatic-sp-privileges TRUE back-log 50 big-tables FALSE -bind-address 0.0.0.0 +bind-address :: binlog-cache-size 32768 binlog-checksum NONE binlog-direct-non-transactional-updates FALSE @@ -1212,7 +1211,6 @@ sync-master-info 0 sync-relay-log 0 sync-relay-log-info 0 sysdate-is-now FALSE -table-cache 400 table-definition-cache 400 table-open-cache 400 table-open-cache-instances 1 === added file 'mysql-test/r/wl6301_1_not_windows.result' --- a/mysql-test/r/wl6301_1_not_windows.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/r/wl6301_1_not_windows.result 2012-05-31 08:58:12 +0000 @@ -0,0 +1,2 @@ +IPv4 connectivity: OK +IPv6 connectivity: OK === added file 'mysql-test/r/wl6301_2_not_windows.result' --- a/mysql-test/r/wl6301_2_not_windows.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/r/wl6301_2_not_windows.result 2012-05-31 08:58:12 +0000 @@ -0,0 +1,2 @@ +IPv4 connectivity: OK +IPv6 connectivity: FAIL === added file 'mysql-test/r/wl6301_3.result' --- a/mysql-test/r/wl6301_3.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/r/wl6301_3.result 2012-05-31 08:58:12 +0000 @@ -0,0 +1,4 @@ +# Checking ::ffff:127.0.0.1 ... +mysqld is alive +# Checking 127.0.0.1 ... +mysqld is alive === modified file 'mysql-test/t/alter_table.test' --- a/mysql-test/t/alter_table.test 2012-04-11 13:50:46 +0000 +++ b/mysql-test/t/alter_table.test 2012-05-31 08:18:44 +0000 @@ -1440,6 +1440,8 @@ ALTER TABLE tm1; ALTER TABLE ti1 ADD COLUMN d VARCHAR(200); ALTER TABLE tm1 ADD COLUMN d VARCHAR(200); +ALTER TABLE ti1 ADD COLUMN d2 VARCHAR(200); +ALTER TABLE tm1 ADD COLUMN d2 VARCHAR(200); ALTER TABLE ti1 ADD COLUMN e ENUM('a', 'b') FIRST; ALTER TABLE tm1 ADD COLUMN e ENUM('a', 'b') FIRST; ALTER TABLE ti1 ADD COLUMN f INT AFTER a; @@ -1447,12 +1449,21 @@ ALTER TABLE tm1 ADD COLUMN f INT AFTER a ALTER TABLE ti1 ADD INDEX ii1(b); ALTER TABLE tm1 ADD INDEX im1(b); -ALTER TABLE ti1 ADD PRIMARY KEY (a); -ALTER TABLE tm1 ADD PRIMARY KEY (a); ALTER TABLE ti1 ADD UNIQUE INDEX ii2 (c); ALTER TABLE tm1 ADD UNIQUE INDEX im2 (c); ALTER TABLE ti1 ADD FULLTEXT INDEX ii3 (d); ALTER TABLE tm1 ADD FULLTEXT INDEX im3 (d); +ALTER TABLE ti1 ADD FULLTEXT INDEX ii4 (d2); +ALTER TABLE tm1 ADD FULLTEXT INDEX im4 (d2); + +# Bug#14140038 INCONSISTENT HANDLING OF FULLTEXT INDEXES IN ALTER TABLE +--error ER_INNODB_FT_LIMIT +ALTER TABLE ti1 ADD PRIMARY KEY(a); +ALTER TABLE ti1 ADD PRIMARY KEY(a), ALGORITHM=COPY; +ALTER TABLE tm1 ADD PRIMARY KEY(a); + +ALTER TABLE ti1 DROP COLUMN d2; +ALTER TABLE tm1 DROP COLUMN d2; ALTER TABLE ti1 ADD CONSTRAINT fi1 FOREIGN KEY (b) REFERENCES ti2(a); ALTER TABLE tm1 ADD CONSTRAINT fm1 FOREIGN KEY (b) REFERENCES tm2(a); === modified file 'mysql-test/t/ipv6.test' --- a/mysql-test/t/ipv6.test 2011-10-19 21:49:22 +0000 +++ b/mysql-test/t/ipv6.test 2012-05-31 08:58:12 +0000 @@ -14,6 +14,12 @@ let $IPv6= ::1; --source include/ipv6.inc --source include/ipv6_func.inc +echo =============Test of '127.0.0.1' (IPv4) ===========================; +let $IPv6= 127.0.0.1; +--source include/ipv6_clients.inc +--source include/ipv6.inc +--source include/ipv6_func.inc + echo =============Test of '::1/128' ====================================; let $IPv6= ::1/128; #--source include/ipv6_clients.inc === added file 'mysql-test/t/wl6301_1_not_windows-master.opt' --- a/mysql-test/t/wl6301_1_not_windows-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/wl6301_1_not_windows-master.opt 2012-05-31 08:58:12 +0000 @@ -0,0 +1 @@ +--skip-name-resolve === added file 'mysql-test/t/wl6301_1_not_windows.test' --- a/mysql-test/t/wl6301_1_not_windows.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/wl6301_1_not_windows.test 2012-05-31 08:58:12 +0000 @@ -0,0 +1,16 @@ +# WL#6301: Change default value for the 'bind-address' option +# +# 1. Check that by default the server accepts client connections on all +# server host IPv4 and IPv6 interfaces. +# +# Options: --skip-name-resolve (see corresponding opt file). +# + +--source include/check_ipv6.inc + +# Can't be tested with embedded server +--source include/not_embedded.inc + +--let WL6301_LOG_FILE = $MYSQLTEST_VARDIR/log/wl6301_1_not_windows.debug.log + +--source include/wl6301.inc === added file 'mysql-test/t/wl6301_2_not_windows-master.opt' --- a/mysql-test/t/wl6301_2_not_windows-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/wl6301_2_not_windows-master.opt 2012-05-31 08:58:12 +0000 @@ -0,0 +1 @@ +--skip-name-resolve --bind-address=0.0.0.0 === added file 'mysql-test/t/wl6301_2_not_windows.test' --- a/mysql-test/t/wl6301_2_not_windows.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/wl6301_2_not_windows.test 2012-05-31 08:58:12 +0000 @@ -0,0 +1,15 @@ +# WL#6301: Change default value for the 'bind-address' option +# +# 2. Check that if the server is started with bind-address=0.0.0.0, +# the server accepts client connections on all server host IPv4, +# but not IPv6 interfaces. +# +# Options: --skip-name-resolve --bind-address=0.0.0.0 (see corresponding opt file). +# + +# Can't be tested with embedded server +--source include/not_embedded.inc + +--let WL6301_LOG_FILE = $MYSQLTEST_VARDIR/log/wl6301_2_not_windows.debug.log + +--source include/wl6301.inc === added file 'mysql-test/t/wl6301_3-master.opt' --- a/mysql-test/t/wl6301_3-master.opt 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/wl6301_3-master.opt 2012-05-31 08:58:12 +0000 @@ -0,0 +1 @@ +--skip-name-resolve --bind-address=::ffff:127.0.0.1 === added file 'mysql-test/t/wl6301_3.test' --- a/mysql-test/t/wl6301_3.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/t/wl6301_3.test 2012-05-31 08:58:12 +0000 @@ -0,0 +1,23 @@ +# WL#6301: Change default value for the 'bind-address' option +# +# 3. Check that if the server is bound to the IPv4-mapped IPv6-address, +# the server accepts client connections from both IPv4 and IPv6 worlds. +# +# Options: --skip-name-resolve, --bind-address=::ffff:127.0.0.1 +# (see corresponding opt file). +# + +# Can't be tested with embedded server +--source include/not_embedded.inc + +# The box should support IPv4-mapped addresses +--source include/have_ipv4_mapped.inc + +--echo # Checking ::ffff:127.0.0.1 ... +--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -h ::ffff:127.0.0.1 -P $MASTER_MYPORT -u root ping + +--echo # Checking 127.0.0.1 ... +--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -h 127.0.0.1 -P $MASTER_MYPORT -u root ping + +# NOTE: ::1 has nothing to do with ::ffff:127.0.0.1, so the server bound to +# ::ffff:127.0.0.1 will not accept connections from to ::1. === modified file 'sql/mysqld.cc' --- a/sql/mysqld.cc 2012-05-30 11:44:42 +0000 +++ b/sql/mysqld.cc 2012-05-31 11:14:10 +0000 @@ -493,7 +493,6 @@ ulong tc_heuristic_recover= 0; int32 thread_running; ulong thread_created; ulong back_log, connect_timeout, concurrency, server_id; -ulong deprecated_table_cache_size; ulong table_cache_size, table_def_size; ulong table_cache_instances; ulong table_cache_size_per_instance; @@ -2023,8 +2022,8 @@ static MYSQL_SOCKET create_socket(const char ip_addr[INET6_ADDRSTRLEN]; - if (vio_get_normalized_ip_string(cur_ai->ai_addr, cur_ai->ai_addrlen, - ip_addr, sizeof (ip_addr))) + if (vio_getnameinfo(cur_ai->ai_addr, ip_addr, sizeof (ip_addr), + NULL, 0, NI_NUMERICHOST)) { ip_addr[0]= 0; } @@ -2081,7 +2080,7 @@ static void network_init(void) if (mysqld_port != 0 && !opt_disable_networking && !opt_bootstrap) { - struct addrinfo *ai, *a; + struct addrinfo *ai; struct addrinfo hints; sql_print_information("Server hostname (bind-address): '%s'; port: %d", @@ -2106,8 +2105,8 @@ static void network_init(void) { char ip_addr[INET6_ADDRSTRLEN]; - if (vio_get_normalized_ip_string(cur_ai->ai_addr, cur_ai->ai_addrlen, - ip_addr, sizeof (ip_addr))) + if (vio_getnameinfo(cur_ai->ai_addr, ip_addr, sizeof (ip_addr), + NULL, 0, NI_NUMERICHOST)) { sql_print_error("Fails to print out IP-address."); continue; @@ -2126,6 +2125,7 @@ static void network_init(void) returned by getaddrinfo(); */ + struct addrinfo *a; ip_sock= create_socket(ai, AF_INET, &a); if (mysql_socket_getfd(ip_sock) == INVALID_SOCKET) @@ -2162,8 +2162,14 @@ static void network_init(void) if (a->ai_family == AF_INET6) { arg= 0; - (void) mysql_socket_setsockopt(ip_sock, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&arg, - sizeof(arg)); + + if (mysql_socket_setsockopt(ip_sock, IPPROTO_IPV6, IPV6_V6ONLY, + (char *) &arg, sizeof (arg))) + { + sql_print_warning("Failed to reset IPV6_V6ONLY flag (error: %d). " + "The server will listen to IPv6 addresses only.", + (int) socket_errno); + } } #endif /* @@ -6469,16 +6475,6 @@ void adjust_related_options() /* In bootstrap, disable grant tables (we are about to create them) */ if (opt_bootstrap) opt_noacl= 1; - - /* - For handle_options(), --table-cache and --table-open-cache - are distinct configuration parameters, and should not point to - the same global variable table_cache_size. - Use deprecated --table-cache if no value was given in --table-open-cache. - */ - if ((table_cache_size == TABLE_OPEN_CACHE_DEFAULT) && - (deprecated_table_cache_size != TABLE_OPEN_CACHE_DEFAULT)) - table_cache_size= deprecated_table_cache_size; } vector all_options; @@ -6502,9 +6498,6 @@ struct my_option my_long_early_options[] &opt_verbose, &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"table_cache", 0, "Deprecated; use --table-open-cache instead.", - &deprecated_table_cache_size, &deprecated_table_cache_size, 0, GET_ULONG, - REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; === modified file 'sql/mysqld.h' --- a/sql/mysqld.h 2012-05-30 11:44:42 +0000 +++ b/sql/mysqld.h 2012-05-31 11:14:10 +0000 @@ -183,7 +183,6 @@ extern ulong delayed_rows_in_use,delayed extern int32 slave_open_temp_tables; extern ulong query_cache_size, query_cache_min_res_unit; extern ulong slow_launch_threads, slow_launch_time; -extern ulong deprecated_table_cache_size; extern ulong table_cache_size, table_def_size; extern ulong table_cache_size_per_instance, table_cache_instances; extern MYSQL_PLUGIN_IMPORT ulong max_connections; === modified file 'sql/sys_vars.cc' --- a/sql/sys_vars.cc 2012-05-30 11:44:42 +0000 +++ b/sql/sys_vars.cc 2012-05-31 10:30:16 +0000 @@ -557,7 +557,7 @@ static Sys_var_charptr Sys_basedir( static Sys_var_charptr Sys_my_bind_addr( "bind_address", "IP address to bind to.", READ_ONLY GLOBAL_VAR(my_bind_addr_str), CMD_LINE(REQUIRED_ARG), - IN_FS_CHARSET, DEFAULT("0.0.0.0")); + IN_FS_CHARSET, DEFAULT("::")); static bool fix_binlog_cache_size(sys_var *self, THD *thd, enum_var_type type) { === modified file 'storage/innobase/btr/btr0cur.cc' --- a/storage/innobase/btr/btr0cur.cc 2012-05-14 21:43:25 +0000 +++ b/storage/innobase/btr/btr0cur.cc 2012-05-31 01:16:59 +0000 @@ -482,7 +482,7 @@ btr_cur_search_to_nth_level( #else switch (latch_mode) { default: - if (level == 0) { + if (level == 0 || !dict_index_is_online_ddl(index)) { break; } /* fall through */ === modified file 'storage/innobase/buf/buf0flu.cc' --- a/storage/innobase/buf/buf0flu.cc 2012-05-30 03:28:41 +0000 +++ b/storage/innobase/buf/buf0flu.cc 2012-05-31 09:09:30 +0000 @@ -2576,6 +2576,7 @@ buf_pool_get_dirty_pages_count( { ulint count = 0; + buf_pool_mutex_enter(buf_pool); buf_flush_list_mutex_enter(buf_pool); buf_page_t* bpage; @@ -2594,6 +2595,7 @@ buf_pool_get_dirty_pages_count( } buf_flush_list_mutex_exit(buf_pool); + buf_pool_mutex_exit(buf_pool); return(count); } === modified file 'storage/innobase/include/dict0dict.h' --- a/storage/innobase/include/dict0dict.h 2012-05-29 09:49:15 +0000 +++ b/storage/innobase/include/dict0dict.h 2012-05-31 01:16:59 +0000 @@ -666,6 +666,15 @@ dict_table_get_first_index( const dict_table_t* table) /*!< in: table */ __attribute__((nonnull, warn_unused_result)); /********************************************************************//** +Gets the last index on the table. +@return index, NULL if none exists */ +UNIV_INLINE +dict_index_t* +dict_table_get_last_index( +/*=======================*/ + const dict_table_t* table) /*!< in: table */ + __attribute__((nonnull, warn_unused_result)); +/********************************************************************//** Gets the next index on the table. @return index, NULL if none left */ UNIV_INLINE @@ -676,6 +685,7 @@ dict_table_get_next_index( __attribute__((nonnull, warn_unused_result)); #else /* UNIV_DEBUG */ # define dict_table_get_first_index(table) UT_LIST_GET_FIRST((table)->indexes) +# define dict_table_get_last_index(table) UT_LIST_GET_LAST((table)->indexes) # define dict_table_get_next_index(index) UT_LIST_GET_NEXT(indexes, index) #endif /* UNIV_DEBUG */ #endif /* !UNIV_HOTBACKUP */ === modified file 'storage/innobase/include/dict0dict.ic' --- a/storage/innobase/include/dict0dict.ic 2012-05-03 07:57:31 +0000 +++ b/storage/innobase/include/dict0dict.ic 2012-05-31 01:16:59 +0000 @@ -224,6 +224,22 @@ dict_table_get_first_index( } /********************************************************************//** +Gets the last index on the table. +@return index, NULL if none exists */ +UNIV_INLINE +dict_index_t* +dict_table_get_last_index( +/*=======================*/ + const dict_table_t* table) /*!< in: table */ +{ + ut_ad(table); + ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); + + return(UT_LIST_GET_LAST((const_cast(table)) + ->indexes)); +} + +/********************************************************************//** Gets the next index on the table. @return index, NULL if none left */ UNIV_INLINE === modified file 'storage/innobase/include/row0mysql.h' --- a/storage/innobase/include/row0mysql.h 2012-04-12 12:34:18 +0000 +++ b/storage/innobase/include/row0mysql.h 2012-05-31 01:16:59 +0000 @@ -724,6 +724,11 @@ struct row_prebuilt_struct { columns in the table */ upd_node_t* upd_node; /*!< Innobase SQL update node used to perform updates and deletes */ + trx_id_t trx_id; /*!< The transaction id of the last + index of the table, when the insert + query graph was built. We use it for + checking whether the insert query + graphs needs to be rebuilt */ que_fork_t* ins_graph; /*!< Innobase SQL query graph used in inserts */ que_fork_t* upd_graph; /*!< Innobase SQL query graph used === modified file 'storage/innobase/row/row0ins.cc' --- a/storage/innobase/row/row0ins.cc 2012-05-15 12:17:11 +0000 +++ b/storage/innobase/row/row0ins.cc 2012-05-31 01:16:59 +0000 @@ -111,7 +111,6 @@ ins_node_create_entry_list( dict_index_t* index; dtuple_t* entry; - ut_ad(node->ins_type != INS_DIRECT); ut_ad(node->entry_sys_heap); UT_LIST_INIT(node->entry_list); @@ -207,9 +206,7 @@ ins_node_set_new_row( /* Create templates for index entries */ - if (node->ins_type != INS_DIRECT) { - ins_node_create_entry_list(node); - } + ins_node_create_entry_list(node); /* Allocate from entry_sys_heap buffers for sys fields */ @@ -2460,7 +2457,7 @@ row_ins_index_entry( /***********************************************************//** Sets the values of the dtuple fields in entry from the values of appropriate columns in row. */ -static +static __attribute__((nonnull)) void row_ins_index_entry_set_vals( /*=========================*/ @@ -2471,9 +2468,6 @@ row_ins_index_entry_set_vals( ulint n_fields; ulint i; - ut_ad(row); - ut_ad(entry); - n_fields = dtuple_get_n_fields(entry); for (i = 0; i < n_fields; i++) { @@ -2637,24 +2631,22 @@ row_ins( ins_node_t* node, /*!< in: row insert node */ que_thr_t* thr) /*!< in: query thread */ { + dberr_t err; + if (node->state == INS_NODE_ALLOC_ROW_ID) { row_ins_alloc_row_id_step(node); node->index = dict_table_get_first_index(node->table); + node->entry = UT_LIST_GET_FIRST(node->entry_list); + + if (node->ins_type == INS_SEARCHED) { - switch (node->ins_type) { - case INS_DIRECT: - node->entry = NULL; - break; - case INS_SEARCHED: - node->entry = UT_LIST_GET_FIRST(node->entry_list); row_ins_get_row_from_select(node); - break; - case INS_VALUES: - node->entry = UT_LIST_GET_FIRST(node->entry_list); + + } else if (node->ins_type == INS_VALUES) { + row_ins_get_row_from_values(node); - break; } node->state = INS_NODE_INSERT_ENTRIES; @@ -2663,42 +2655,23 @@ row_ins( ut_ad(node->state == INS_NODE_INSERT_ENTRIES); while (node->index != NULL) { - dberr_t err; + if (node->index->type != DICT_FTS) { + err = row_ins_index_entry_step(node, thr); - if (node->index->type & DICT_FTS) { - goto next_index; - } - - if (node->ins_type == INS_DIRECT) { - /* node->entry == NULL here, except when - row_ins_index_entry_step() returned - DB_LOCK_WAIT on the previous call and - row_insert_for_mysql() retried the insert. */ - node->entry = row_build_index_entry( - node->row, NULL, node->index, - node->entry_sys_heap); - } - - err = row_ins_index_entry_step(node, thr); - - if (err != DB_SUCCESS) { + if (err != DB_SUCCESS) { - return(err); + return(err); + } } -next_index: node->index = dict_table_get_next_index(node->index); - node->entry = (node->ins_type != INS_DIRECT) - ? UT_LIST_GET_NEXT(tuple_list, node->entry) - : NULL; + node->entry = UT_LIST_GET_NEXT(tuple_list, node->entry); /* Skip corrupted secondary index and its entry */ while (node->index && dict_index_is_corrupted(node->index)) { node->index = dict_table_get_next_index(node->index); - node->entry = (node->ins_type != INS_DIRECT) - ? UT_LIST_GET_NEXT(tuple_list, node->entry) - : NULL; + node->entry = UT_LIST_GET_NEXT(tuple_list, node->entry); } } === modified file 'storage/innobase/row/row0mysql.cc' --- a/storage/innobase/row/row0mysql.cc 2012-05-18 11:21:55 +0000 +++ b/storage/innobase/row/row0mysql.cc 2012-05-31 01:16:59 +0000 @@ -957,44 +957,60 @@ row_get_prebuilt_insert_row( row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL handle */ { - ins_node_t* node; - dtuple_t* row; - dict_table_t* table = prebuilt->table; + dict_table_t* table = prebuilt->table; + const dict_index_t* last_index = dict_table_get_last_index(table); ut_ad(prebuilt && table && prebuilt->trx); - if (prebuilt->ins_node == NULL) { + /* Check if a new index has been added that prebuilt doesn't know + about. We need to rebuild the query graph. */ - /* Not called before for this handle: create an insert node - and query graph to the prebuilt struct */ + if (prebuilt->ins_node != 0) { - node = ins_node_create(INS_DIRECT, table, prebuilt->heap); + if (prebuilt->trx_id >= last_index->trx_id) { + return(prebuilt->ins_node->row); + } - prebuilt->ins_node = node; + que_graph_free_recursive(prebuilt->ins_graph); - if (prebuilt->ins_upd_rec_buff == NULL) { - prebuilt->ins_upd_rec_buff = static_cast( - mem_heap_alloc( - prebuilt->heap, - prebuilt->mysql_row_len)); - } + prebuilt->ins_graph = 0; + } - row = dtuple_create(prebuilt->heap, - dict_table_get_n_cols(table)); + /* Create an insert node and query graph to the prebuilt struct */ - dict_table_copy_types(row, table); + ins_node_t* node; - ins_node_set_new_row(node, row); + node = ins_node_create(INS_DIRECT, table, prebuilt->heap); - prebuilt->ins_graph = static_cast( - que_node_get_parent( - pars_complete_graph_for_exec( - node, - prebuilt->trx, prebuilt->heap))); + prebuilt->ins_node = node; - prebuilt->ins_graph->state = QUE_FORK_ACTIVE; + if (prebuilt->ins_upd_rec_buff == 0) { + prebuilt->ins_upd_rec_buff = static_cast( + mem_heap_alloc( + prebuilt->heap, + prebuilt->mysql_row_len)); } + dtuple_t* row; + + row = dtuple_create(prebuilt->heap, dict_table_get_n_cols(table)); + + dict_table_copy_types(row, table); + + ins_node_set_new_row(node, row); + + prebuilt->ins_graph = static_cast( + que_node_get_parent( + pars_complete_graph_for_exec( + node, + prebuilt->trx, prebuilt->heap))); + + prebuilt->ins_graph->state = QUE_FORK_ACTIVE; + + ut_ad(prebuilt->trx_id == 0 || prebuilt->trx_id <= last_index->trx_id); + + prebuilt->trx_id = last_index->trx_id; + return(prebuilt->ins_node->row); } @@ -1073,10 +1089,8 @@ row_lock_table_autoinc_for_mysql( trx->op_info = "setting auto-inc lock"; - if (node == NULL) { - row_get_prebuilt_insert_row(prebuilt); - node = prebuilt->ins_node; - } + row_get_prebuilt_insert_row(prebuilt); + node = prebuilt->ins_node; /* We use the insert query graph as the dummy graph needed in the lock module call */ @@ -1266,10 +1280,8 @@ row_insert_for_mysql( trx_start_if_not_started_xa(trx); - if (node == NULL) { - row_get_prebuilt_insert_row(prebuilt); - node = prebuilt->ins_node; - } + row_get_prebuilt_insert_row(prebuilt); + node = prebuilt->ins_node; row_mysql_convert_row_to_innobase(node->row, prebuilt, mysql_rec); === modified file 'storage/perfschema/pfs_autosize.cc' --- a/storage/perfschema/pfs_autosize.cc 2012-05-30 11:44:42 +0000 +++ b/storage/perfschema/pfs_autosize.cc 2012-05-31 11:14:10 +0000 @@ -56,7 +56,6 @@ static const ulong thread_per_share= 0; struct PFS_sizing_data { - const char* m_name; /** Default value for @c PFS_param.m_account_sizing. */ ulong m_account_sizing; /** Default value for @c PFS_param.m_user_sizing. */ @@ -117,9 +116,8 @@ struct PFS_sizing_data float m_load_factor_static; }; -PFS_sizing_data tiny_data= +PFS_sizing_data small_data= { - "HEURISTIC 1", /* Account / user / host */ 10, 5, 20, /* History sizes */ @@ -134,7 +132,6 @@ PFS_sizing_data tiny_data= PFS_sizing_data medium_data= { - "HEURISTIC 2", /* Account / user / host */ 100, 100, 100, /* History sizes */ @@ -147,9 +144,8 @@ PFS_sizing_data medium_data= 0.70, 0.80, 0.90 }; -PFS_sizing_data big_data= +PFS_sizing_data large_data= { - "HEURISTIC 3", /* Account / user / host */ 100, 100, 100, /* History sizes */ @@ -197,7 +193,7 @@ PFS_sizing_data *estimate_hints(PFS_glob (param->m_hints.m_table_open_cache <= TABLE_OPEN_CACHE_DEFAULT)) { /* The my.cnf used is either unchanged, or lower than factory defaults. */ - return & tiny_data; + return & small_data; } if ((param->m_hints.m_max_connections <= MAX_CONNECTIONS_DEFAULT * 2) && @@ -209,7 +205,7 @@ PFS_sizing_data *estimate_hints(PFS_glob } /* Looks like a server in production. */ - return & big_data; + return & large_data; } static void apply_heuristic(PFS_global_param *p, PFS_sizing_data *h) No bundle (reason: useless for push emails).