From 98e8418aa0ebd21584cdc8695d87cc2ac0f536df Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Fri, 6 Nov 2020 16:31:23 +0300 Subject: [PATCH] Postfix for CORE-6412, fixed non-ascii users support --- src/jrd/UserManagement.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jrd/UserManagement.cpp b/src/jrd/UserManagement.cpp index 09e4265f02..5fa011b09e 100644 --- a/src/jrd/UserManagement.cpp +++ b/src/jrd/UserManagement.cpp @@ -140,6 +140,14 @@ namespace string value; bool present; }; + + class ChangeCharset : public AutoSetRestore + { + public: + ChangeCharset(Attachment* att) + : AutoSetRestore(&att->att_charset, CS_NONE) + { } + }; } // anonymous namespace const Format* UsersTableScan::getFormat(thread_db* tdbb, jrd_rel* relation) const @@ -185,6 +193,7 @@ IManagement* UserManagement::registerManager(Auth::Get& getPlugin, const char* p CheckStatusWrapper statusWrapper(&status); UserIdInfo idInfo(att, tra); + ChangeCharset cc(att); manager->start(&statusWrapper, &idInfo); if (status.getState() & IStatus::STATE_ERRORS) { @@ -271,6 +280,7 @@ UserManagement::~UserManagement() LocalStatus status; CheckStatusWrapper statusWrapper(&status); + ChangeCharset cc(att); manager->rollback(&statusWrapper); PluginManagerInterfacePtr()->releasePlugin(manager); managers[i].second = NULL; @@ -293,6 +303,7 @@ void UserManagement::commit() LocalStatus status; CheckStatusWrapper statusWrapper(&status); + ChangeCharset cc(att); manager->commit(&statusWrapper); if (status.getState() & IStatus::STATE_ERRORS) status_exception::raise(&statusWrapper); @@ -363,6 +374,7 @@ void UserManagement::execute(USHORT id) LocalStatus status; CheckStatusWrapper statusWrapper(&status); + ChangeCharset cc(att); if (command->attr.entered() || command->op == Auth::ADDMOD_OPER) {