diff options
author | unknown <monty@mysql.com> | 2004-06-03 01:55:47 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-06-03 01:55:47 +0300 |
commit | f112903ca7c2ee8724fa693115f1fc860b414f36 (patch) | |
tree | d2a3208b05ca7d521f3d2a12bd025be67a70c62b /libmysql | |
parent | 911073ed99d8622b165c0ecd69bc1175431f829a (diff) | |
download | mariadb-git-f112903ca7c2ee8724fa693115f1fc860b414f36.tar.gz |
Added authentication code that was missed in merge
Added new windows configuration
VC++Files/client/mysqlclient.dsp:
Added new configuration
VC++Files/zlib/zlib.dsp:
Added new configuration
libmysql/libmysql.c:
Moved check function from libmysql.c to client.c
sql-common/client.c:
Moved check function from libmysql.c to client.c
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index a3922313a40..b12965a85e7 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -616,60 +616,10 @@ mysql_connect(MYSQL *mysql,const char *host, #endif -#ifdef CHECK_LICENSE -/* - Check server side variable 'license'. - If the variable does not exist or does not contain 'Commercial', - we're talking to non-commercial server from commercial client. - SYNOPSIS - check_license() - RETURN VALUE - 0 success - !0 network error or the server is not commercial. - Error code is saved in mysql->net.last_errno. -*/ - -static int check_license(MYSQL *mysql) -{ - MYSQL_ROW row; - MYSQL_RES *res; - NET *net= &mysql->net; - static const char query[]= "SELECT @@license"; - static const char required_license[]= STRINGIFY_ARG(LICENSE); - - if (mysql_real_query(mysql, query, sizeof(query)-1)) - { - if (net->last_errno == ER_UNKNOWN_SYSTEM_VARIABLE) - { - net->last_errno= CR_WRONG_LICENSE; - sprintf(net->last_error, ER(net->last_errno), required_license); - } - return 1; - } - if (!(res= mysql_use_result(mysql))) - return 1; - row= mysql_fetch_row(res); - /* - If no rows in result set, or column value is NULL (none of these - two is ever true for server variables now), or column value - mismatch, set wrong license error. - */ - if (!net->last_errno && - (!row || !row[0] || - strncmp(row[0], required_license, sizeof(required_license)))) - { - net->last_errno= CR_WRONG_LICENSE; - sprintf(net->last_error, ER(net->last_errno), required_license); - } - mysql_free_result(res); - return net->last_errno; -} -#endif /* CHECK_LICENSE */ - - /************************************************************************** Change user and database **************************************************************************/ + int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd) { NET *net= &mysql->net; |