List:MySQL++« Previous MessageNext Message »
From:Jan Hoeve Date:April 16 2002 6:50am
Subject:mysql_error() truncates?
View as plain text  
Hi all,

i have a little problem using mysql with the C API.
when i e.g. call the mysql_real_connect with a non-existing user, i would expect an error
like:
'"access denied for user testuser".
Instead, my MessageBox() shows this: "ss denied for user testuser".
this is very strange! The mysql_error() seems to shorten my string!

When calling mysql_errno(conn) for the error number, it returns the number 8192 sometimes.
What error is this? I can't find this in de mysql sources.

example code:

    MYSQL *conn = mysql_init(NULL);
    if (mysql_real_connect(
        conn,
        "localhost",
        "testuser",
        "pass",
        "testdb",
        0,
        NULL,
        0) != NULL)                  
        isConnected = true;
    else
    {
        MessageBox(NULL, mysql_error(conn), "error", NULL);
        Error();
    }


I am using Visual C++, win2k, mysql 3.22.xx (think xx = 29, not sure)

thanks,
Jan Hoeve
Thread
mysql_error() truncates?Jan Hoeve16 Apr
  • compiler mes examplesadelpfe29 Apr
    • Re: compiler mes examplesRitu Singla30 Apr