Store databases in the SQLite database
The databases are now also stored in the sqlite database. This allows the `resource` member of the USERS struct to be removed in the future.
This commit is contained in:
@ -128,7 +128,8 @@ static void* mysql_auth_init(char **options)
|
||||
|
||||
char *err;
|
||||
|
||||
if (sqlite3_exec(instance->handle, create_sql, NULL, NULL, &err) != SQLITE_OK)
|
||||
if (sqlite3_exec(instance->handle, users_create_sql, NULL, NULL, &err) != SQLITE_OK ||
|
||||
sqlite3_exec(instance->handle, databases_create_sql, NULL, NULL, &err) != SQLITE_OK)
|
||||
{
|
||||
MXS_ERROR("Failed to create database: %s", err);
|
||||
sqlite3_free(err);
|
||||
@ -264,9 +265,6 @@ mysql_auth_authenticate(DCB *dcb)
|
||||
MXS_DEBUG("Receiving connection from '%s' to database '%s'.",
|
||||
client_data->user, client_data->db);
|
||||
|
||||
auth_ret = combined_auth_check(dcb, client_data->auth_token, client_data->auth_token_len,
|
||||
protocol, client_data->user, client_data->client_sha1, client_data->db);
|
||||
|
||||
MYSQL_AUTH *instance = (MYSQL_AUTH*)dcb->listener->auth_instance;
|
||||
|
||||
bool is_ok = validate_mysql_user(instance->handle, dcb, client_data);
|
||||
|
Reference in New Issue
Block a user