!984 解决session退出时系统无权限访问gs_encrypted_table问题
Merge pull request !984 from Li Bingchen/master
This commit is contained in:
@ -6764,8 +6764,6 @@ void RemoveTempNamespace()
|
||||
{
|
||||
StringInfoData str;
|
||||
initStringInfo(&str);
|
||||
StringInfoData str_temp_table;
|
||||
initStringInfo(&str_temp_table);
|
||||
|
||||
if (u_sess->catalog_cxt.myTempNamespace) {
|
||||
ResourceOwner currentOwner = t_thrd.utils_cxt.CurrentResourceOwner;
|
||||
@ -6785,13 +6783,11 @@ void RemoveTempNamespace()
|
||||
if (nspname != NULL) {
|
||||
ereport(LOG, (errmsg("Session quiting, drop temp schema %s", nspname)));
|
||||
appendStringInfo(&str, "DROP SCHEMA %s, pg_toast_temp_%s CASCADE", nspname, &nspname[8]);
|
||||
appendStringInfo(&str_temp_table, "DELETE FROM gs_encrypted_columns WHERE rel_id in ( select pg_class.oid from pg_class join pg_namespace ON (pg_class.relnamespace = pg_namespace.oid ) where pg_namespace.nspname = \'%s\')", nspname);
|
||||
|
||||
pgstatCountSQL4SessionLevel();
|
||||
|
||||
t_thrd.postgres_cxt.whereToSendOutput = DestNone;
|
||||
exec_simple_query(str.data, QUERY_MESSAGE);
|
||||
exec_simple_query(str_temp_table.data, QUERY_MESSAGE);
|
||||
u_sess->catalog_cxt.myTempNamespace = InvalidOid;
|
||||
u_sess->catalog_cxt.myTempToastNamespace = InvalidOid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user