List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 31 2012 10:29am
Subject:bzr push into mysql-trunk-wl6255 branch (marko.makela:3915 to 3916)
View as plain text  
 3916 Marko Mäkelä	2012-05-31 [merge]
      Merge mysql-trunk to mysql-trunk-wl6255.

    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/ipv6.result
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/t/ipv6.test
      sql/mysqld.cc
      sql/sys_vars.cc
      storage/innobase/buf/buf0flu.cc
 3915 Marko Mäkelä	2012-05-31
      WL#6255 latching order bug fix.
      
      row_ins_sec_index_entry_low(): Move the log_free_check() to the caller,
      row_ins_sec_index_entry(). In online rebuild log apply, we are holding
      an X-latch on the clustered index tree of the old table most of the time,
      and must do the log_free_check() when not holding the latch.

    modified:
      storage/innobase/row/row0ins.cc
=== 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	revid:marko.makela@oracle.com-20120531102447-4oeg3lbfe1rd819e
@@ -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/ipv6.result'
--- a/mysql-test/r/ipv6.result	revid:marko.makela@strippedi4xivk
+++ b/mysql-test/r/ipv6.result	revid:marko.makela@oracle.com-20120531102447-4oeg3lbfe1rd819e
@@ -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	revid:marko.makela@stripped120531100550-zy1ts2s6dmi4xivk
+++ b/mysql-test/r/mysqld--help-notwin.result	revid:marko.makela@stripped102447-4oeg3lbfe1rd819e
@@ -930,7 +930,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

=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result	revid:marko.makela@stripped-zy1ts2s6dmi4xivk
+++ b/mysql-test/r/mysqld--help-win.result	revid:marko.makela@strippede1rd819e
@@ -938,7 +938,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

=== 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	revid:marko.makela@stripped102447-4oeg3lbfe1rd819e
@@ -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	revid:marko.makela@oracle.com-20120531102447-4oeg3lbfe1rd819e
@@ -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	revid:marko.makela@stripped31102447-4oeg3lbfe1rd819e
@@ -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/ipv6.test'
--- a/mysql-test/t/ipv6.test	revid:marko.makela@oracle.com-20120531100550-zy1ts2s6dmi4xivk
+++ b/mysql-test/t/ipv6.test	revid:marko.makela@stripped7-4oeg3lbfe1rd819e
@@ -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	revid:marko.makela@strippedfe1rd819e
@@ -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	revid:marko.makela@stripped
@@ -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	revid:marko.makela@stripped
@@ -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	revid:marko.makela@stripped9e
@@ -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	revid:marko.makela@stripped19e
@@ -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	revid:marko.makela@oracle.com-20120531102447-4oeg3lbfe1rd819e
@@ -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	revid:marko.makela@stripped0-zy1ts2s6dmi4xivk
+++ b/sql/mysqld.cc	revid:marko.makela@oracle.com-20120531102447-4oeg3lbfe1rd819e
@@ -2031,8 +2031,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;
     }
@@ -2089,7 +2089,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",
@@ -2114,8 +2114,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;
@@ -2134,6 +2134,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)
@@ -2170,8 +2171,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
     /*

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	revid:marko.makela@oracle.com-20120531100550-zy1ts2s6dmi4xivk
+++ b/sql/sys_vars.cc	revid:marko.makela@strippedlbfe1rd819e
@@ -537,7 +537,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/buf/buf0flu.cc'
--- a/storage/innobase/buf/buf0flu.cc	revid:marko.makela@oracle.com-20120531100550-zy1ts2s6dmi4xivk
+++ b/storage/innobase/buf/buf0flu.cc	revid:marko.makela@stripped31102447-4oeg3lbfe1rd819e
@@ -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);
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl6255 branch (marko.makela:3915 to 3916) marko.makela31 May