Bug #72536 MySQL error 1698 should be considered as authentication error
Submitted: 5 May 2014 12:40 Modified: 18 Jun 2014 4:42
Reporter: Sergei Glushchenko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.1 OS:Any
Assigned to: CPU Architecture:Any

[5 May 2014 12:40] Sergei Glushchenko
Description:
DriverManager::getConnection does SQLException based on error codes. Errors with codes 1045 and 1044 are thrown as AuthenticationError. So should be error 1698 (ER_ACCESS_DENIED_NO_PASSWORD_ERROR)

Here is relevant code:

  catch (sql::SQLException &exc)
  {
    // authentication error
    if (exc.getErrorCode() == 1045 || exc.getErrorCode() == 1044)
    {
      if (!force_ask_password)
      {
        if (authref)
        {
          authref->invalidate();
          throw AuthenticationError(exc.what(), authref);
        }
        else
        {          
          // ask for password again, this time disablig the password caching
          force_ask_password = true;
          goto retry;
        }
      }
    }

How to repeat:
Read the code

Suggested fix:
fix is obvious
[6 May 2014 12:19] MySQL Verification Team
Hello Sergei,

Thank you for the bug report.

Thanks,
Umesh
[6 May 2014 12:21] MySQL Verification Team
// 6.1.4 source - library\dbc\src\driver_manager.cpp

  catch (sql::SQLException &exc)
  {
    // authentication error
    if (exc.getErrorCode() == 1045 || exc.getErrorCode() == 1044)
    {
      if (!force_ask_password)
      {
        if (authref)
        {
          authref->invalidate();
          throw AuthenticationError(exc.what(), authref);
        }
        else
        {          
          // ask for password again, this time disablig the password caching
          force_ask_password = true;
          goto retry;
        }
      }
    }
[3 Jun 2014 22:02] Alfredo Kojima
Posted by developer:
 
Added handling of error 1698 as described in report
[18 Jun 2014 4:42] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.1.7 release, and here's the changelog entry:

MySQL error code 1698 (ER_ACCESS_DENIED_NO_PASSWORD_ERROR) is now
handled as an authentication error.

Thank you for the bug report.