summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2016-04-15 20:40:25 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2016-08-31 17:17:46 +0200
commite7608a78ef45cc46f4e4d5abbda788ad54e80e71 (patch)
tree72d74018fbb72dcb417875399b2a3bd7bdbe7791 /sql/sql_db.cc
parent468a6ad722778768eb4ee5003dd818945b363261 (diff)
downloadmariadb-git-e7608a78ef45cc46f4e4d5abbda788ad54e80e71.tar.gz
MDEV-8931: (server part of) session state tracking
initial commit to test
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 1a0ee03ec34..128281c7686 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1035,7 +1035,10 @@ exit:
it to 0.
*/
if (thd->db && cmp_db_names(thd->db, db) && !error)
+ {
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
+ thd->session_tracker.mark_as_changed(thd, CURRENT_SCHEMA_TRACKER, NULL);
+ }
my_dirend(dirp);
DBUG_RETURN(error);
}
@@ -1459,7 +1462,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
- DBUG_RETURN(FALSE);
+ goto done;
}
else
{
@@ -1476,8 +1479,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
mysql_change_db_impl(thd, &INFORMATION_SCHEMA_NAME, SELECT_ACL,
system_charset_info);
-
- DBUG_RETURN(FALSE);
+ goto done;
}
/*
@@ -1564,8 +1566,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
/* The operation succeed. */
-
- DBUG_RETURN(FALSE);
+ goto done;
}
else
{
@@ -1589,6 +1590,9 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
mysql_change_db_impl(thd, &new_db_file_name, db_access, db_default_cl);
+done:
+ thd->session_tracker.mark_as_changed(thd, CURRENT_SCHEMA_TRACKER, NULL);
+ thd->session_tracker.mark_as_changed(thd, SESSION_STATE_CHANGE_TRACKER, NULL);
DBUG_RETURN(FALSE);
}