From ced719d44f9fa5f873dc0685360d30a9f7ae7864 Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Thu, 23 Jun 2016 23:15:12 +0300 Subject: [PATCH] Bugfix for CORE-5154: Services API don't work with non-ascii database names (ported from aafemt/firebird). Also add some missing tags that might require transliteration. --- src/common/IntlParametersBlock.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/common/IntlParametersBlock.cpp b/src/common/IntlParametersBlock.cpp index 1a0039a29a..f9e78f5e95 100644 --- a/src/common/IntlParametersBlock.cpp +++ b/src/common/IntlParametersBlock.cpp @@ -233,14 +233,17 @@ IntlParametersBlock::TagType IntlSpb::checkTag(UCHAR tag, const char** tagName) IntlParametersBlock::TagType IntlSpbStart::checkTag(UCHAR tag, const char** tagName) { + switch (tag) + { + FB_IPB_TAG(isc_spb_dbname); + return TAG_STRING; + } + switch (mode) { case 0: switch (tag) { - FB_IPB_TAG(isc_spb_dbname); - return TAG_STRING; - case isc_action_svc_backup: case isc_action_svc_restore: case isc_action_svc_properties: @@ -255,6 +258,8 @@ IntlParametersBlock::TagType IntlSpbStart::checkTag(UCHAR tag, const char** tagN case isc_action_svc_trace_start: case isc_action_svc_db_stats: case isc_action_svc_validate: + case isc_action_svc_set_mapping: + case isc_action_svc_drop_mapping: mode = tag; break; } @@ -285,6 +290,7 @@ IntlParametersBlock::TagType IntlSpbStart::checkTag(UCHAR tag, const char** tagN case isc_action_svc_display_user_adm: switch (tag) { + FB_IPB_TAG(isc_spb_sql_role_name); FB_IPB_TAG(isc_spb_sec_username); FB_IPB_TAG(isc_spb_sec_password); FB_IPB_TAG(isc_spb_sec_groupname); @@ -316,6 +322,8 @@ IntlParametersBlock::TagType IntlSpbStart::checkTag(UCHAR tag, const char** tagN case isc_action_svc_db_stats: switch (tag) { + FB_IPB_TAG(isc_spb_sts_table); + return TAG_STRING; FB_IPB_TAG(isc_spb_command_line); return TAG_COMMAND_LINE; } @@ -324,7 +332,6 @@ IntlParametersBlock::TagType IntlSpbStart::checkTag(UCHAR tag, const char** tagN case isc_action_svc_validate: switch (tag) { - FB_IPB_TAG(isc_spb_dbname); FB_IPB_TAG(isc_spb_val_tab_incl); FB_IPB_TAG(isc_spb_val_tab_excl); FB_IPB_TAG(isc_spb_val_idx_incl); @@ -332,6 +339,15 @@ IntlParametersBlock::TagType IntlSpbStart::checkTag(UCHAR tag, const char** tagN return TAG_STRING; } break; + + case isc_action_svc_set_mapping: + case isc_action_svc_drop_mapping: + switch (tag) + { + FB_IPB_TAG(isc_spb_sql_role_name); + return TAG_STRING; + } + break; } return TAG_SKIP;