From c75b160dc071d28899cdc6d2950d3a0f58b26a33 Mon Sep 17 00:00:00 2001 From: Vlad Khorsun Date: Fri, 20 Sep 2024 17:28:59 +0300 Subject: [PATCH] Fixed #8253 : Incorrect handling of non-ASCII object names in CREATE MAPPING statement --- src/dsql/DdlNodes.epp | 1 + src/dsql/parse.y | 2 +- src/isql/show.epp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dsql/DdlNodes.epp b/src/dsql/DdlNodes.epp index 0c2a26992f..688d54ab0c 100644 --- a/src/dsql/DdlNodes.epp +++ b/src/dsql/DdlNodes.epp @@ -10870,6 +10870,7 @@ void MappingNode::runInSecurityDb(SecDbContext* secDbContext) ddl += ' '; if (from) { + ddl += "_utf8 "; addItem(ddl, fromUtf8.c_str(), '\''); ddl += ' '; } diff --git a/src/dsql/parse.y b/src/dsql/parse.y index 74501908c8..2eac7d7031 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -7804,7 +7804,7 @@ map_from_symbol_name %type map_logoninfo map_logoninfo : sql_string - | valid_symbol_name { $$ = newNode($1->c_str()); } + | valid_symbol_name { $$ = newIntlString($1->c_str(), metadataCharSet->getName()); } ; %type map_using() diff --git a/src/isql/show.epp b/src/isql/show.epp index d093e45295..8c73486c9e 100644 --- a/src/isql/show.epp +++ b/src/isql/show.epp @@ -5091,7 +5091,7 @@ static void printMap(bool extract, bool global, char* name, char* usng, char* pl isqlGlob.printf("FROM %s", anyObj ? "ANY " : ""); printIdent(extract, fromType, "%s "); if (!anyObj) - printIdent(extract, from, "%s "); + isqlGlob.printf("\'%s\' ", from); isqlGlob.printf("TO %s ", toType ? "ROLE" : "USER"); if (to)