Bug #43006 main.skip_name_resolve fails on Windows in PB2
Submitted: 19 Feb 2009 9:01 Modified: 6 Mar 2010 19:16
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:6.0-TRUNK, 5.4 OS:Windows
Assigned to: Alexander Nozdrin CPU Architecture:Any
Tags: disabled, pb2, test failure, tf54

[19 Feb 2009 9:01] Alexander Nozdrin
Description:
Symptoms:
--------------------------------------------------------------
CURRENT_TEST: main.skip_name_resolve

Could not execute 'check-testcase' before testcase 'main.skip_name_resolve' (res: 1):
mysqltest: Could not open connection 'default': 1130 Host '::1' is not allowed to connect to this MySQL server
not ok
--------------------------------------------------------------

Reported after a failure on 2009-02-17 in 6.0 main.

This failure is different from Bug#40702.

How to repeat:
XRef2: http://tinyurl.com/avgf4w
[19 Mar 2009 13:46] Guilhem Bichot
Same error on my Windows machine. So, not specific to pb2.
[9 Jun 2009 18:43] Lars Heill
Reassigning.
[16 Jun 2009 10:01] Alexander Nozdrin
Another symptom of Bug#38247 (Server does not resolve connecting ip's).
[5 Aug 2009 17:38] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/80194

2842 Alexander Nozdrin	2009-08-05
      Fix for Bug#43006 (main.skip_name_resolve fails on Windows in PB2).
      
      The problem consisted of two parts:
      
        - Windows resolves localhost to IPv6 '::1' address, instead of IPv4
          '127.0.0.1', which is supposed by the server configuration.
      
          To fix this issue a new grant to root@'::1' should be added into
          mysql.user at database initialization
          (mysql_system_tables_data.sql)
      
        - ACL module didn't take IPv6 addresses into account.
      
          When name resolving is off, the ACL module checks every hostname
          from mysql.user whether it requires name resolving or not. The
          code was written at IPv4 era, so it treated '::1' as a hostname.
      
          In order to fix this issue, the ACL code was improved. The code
          now supposes that:
      
            - if a string contains any symbol from the {':', '%', '_', '/'}
              set, it is an IPv6 address, or a patter, or a IPv4 network
              address. Thus the string should not be resolved.
      
            - if after that the string contains only digits and dots, it is
              an IPv4 address. Thus the string should not be resolved.
              Otherwise, it is a host name and should be resolved.
[10 Aug 2009 10:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/80430

2851 Alexander Nozdrin	2009-08-10
      Enable skip_name_resolve.test that was disabled due to Bug#43006
      (which is now fixed).
[11 Aug 2009 8:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/80536

2853 Alexander Nozdrin	2009-08-11
      Postfix for Bug#43006: fix a typo (":1" instead of "::1").
[11 Aug 2009 8:22] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/80539

2854 Alexander Nozdrin	2009-08-11
      Postfix for Bug#43006: if IPv6 is enabled on Windows, the server listens on ::1,
      but not on 127.0.0.1. Using the 'localhost' host name is more appropriate here.
      NOTE: this is a change only to MTR-script, it has nothing to do with
      the skip-name-resolve mode.
[24 Aug 2009 13:53] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090824135126-2rngffvth14a8bpj) (version source revid:vvaintroub@mysql.com-20090811124013-vud2ptaiavq90af7) (merge vers: 5.4.4-alpha) (pib:11)
[28 Aug 2009 12:14] Jon Stephens
Documented bugfix in the 5.4.4 and NDB-7.0.7 changelogs as follows:

        The IPv6 loopback address ::1 was interpeted as a hostname
        rather than a numeric IP address.

Closed.
[28 Aug 2009 12:18] Jon Stephens
Forgot to include in previous comment 2nd para of changelog entry, which reads:

        In addition, the IPv6-enabled server on Windows interpeted
        localhost as ::1 only, which failed to match the default
        root@127.0.0.1 entry in the myqsl.user privilege table.
[29 Sep 2009 11:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/84976

2884 Alexander Nozdrin	2009-09-29
      Backporting patch for Bug#43006 from 6.0.
      Revision in mysql-6.0-codebase:
      
        ------------------------------------------------------------
        revno: 2617.69.6
        committer: Alexander Nozdrin <alik@sun.com>
        branch nick: azalea-bf-bug45584
        timestamp: Wed 2009-08-05 21:38:11 +0400
        message:
          Fix for Bug#43006 (main.skip_name_resolve fails on Windows in PB2).
          
          The problem consisted of two parts:
          
            - Windows resolves localhost to IPv6 '::1' address, instead of IPv4
              '127.0.0.1', which is supposed by the server configuration.
          
              To fix this issue a new grant to root@'::1' should be added into
              mysql.user at database initialization
              (mysql_system_tables_data.sql)
          
            - ACL module didn't take IPv6 addresses into account.
          
              When name resolving is off, the ACL module checks every hostname
              from mysql.user whether it requires name resolving or not. The
              code was written at IPv4 era, so it treated '::1' as a hostname.
          
              In order to fix this issue, the ACL code was improved. The code
              now supposes that:
          
                - if a string contains any symbol from the {':', '%', '_', '/'}
                  set, it is an IPv6 address, or a patter, or a IPv4 network
                  address. Thus the string should not be resolved.
          
                - if after that the string contains only digits and dots, it is
                  an IPv4 address. Thus the string should not be resolved.
                  Otherwise, it is a host name and should be resolved.
        ------------------------------------------------------------
[9 Oct 2009 23:16] Paul DuBois
Noted in 6.0.14 changelog.
[3 Dec 2009 9:08] Bugs System
Pushed into 5.6.0-beta (revid:alik@sun.com-20091202160026-699xnqx8c6a6t2lk) (version source revid:alik@sun.com-20091125105323-j82ts9ns936i45vv) (merge vers: 5.6.0-beta) (pib:13)
[3 Dec 2009 9:10] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091202161413-u81nw1foglcu7nao) (version source revid:alik@sun.com-20091125105553-vvedtv1bpmugb1nj) (merge vers: 6.0.14-alpha) (pib:13)
[3 Dec 2009 20:42] Paul DuBois
Noted in 5.6.0 changelog.

Already fixed in 6.0.x.
[6 Mar 2010 11:03] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:wlad@sol-20091204200504-9d3d3b6ad75ijkqo) (merge vers: 5.6.0-beta) (pib:16)
[6 Mar 2010 19:16] Paul DuBois
Moved 5.6.0 changelog entry to 5.5.3.