Commit e696da7b authored by Sergei Golubchik's avatar Sergei Golubchik

Removed check_license() function

parent 95cba104
......@@ -883,57 +883,6 @@ static my_bool is_NT(void)
}
#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.
@retval 0 success
@retval !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)
{
set_mysql_extended_error(mysql, CR_WRONG_LICENSE, unknown_sqlstate,
ER(CR_WRONG_LICENSE), 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))))
{
set_mysql_extended_error(mysql, CR_WRONG_LICENSE, unknown_sqlstate,
ER(CR_WRONG_LICENSE), required_license);
}
mysql_free_result(res);
return net->last_errno;
}
#endif /* CHECK_LICENSE */
/**************************************************************************
Shut down connection
**************************************************************************/
......@@ -2977,11 +2926,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
if (mysql->client_flag & CLIENT_COMPRESS) /* We will use compression */
net->compress=1;
#ifdef CHECK_LICENSE
if (check_license(mysql))
goto error;
#endif
if (db && !mysql->db && mysql_select_db(mysql, db))
{
if (mysql->net.last_errno == CR_SERVER_LOST)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment