Skip to content

Commit b3da905

Browse files
committed
Fix problem with INTRODUCER reported by Pavel Zotov.
create or alter user foo password 'bar' lastname _ascii 'john'; Statement failed, SQLSTATE = 2C000 Dynamic SQL Error -SQL error code = -504 -CHARACTER SET "ASCII" is not defined
1 parent c3c2011 commit b3da905

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

src/dsql/DdlNodes.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,14 @@ class MappingNode final : public DdlNode, private ExecInSecurityDb
22442244
void validateAdmin();
22452245

22462246
public:
2247+
DdlNode* dsqlPass(DsqlCompilerScratch* dsqlScratch) override
2248+
{
2249+
if (from)
2250+
from->dsqlPass(dsqlScratch);
2251+
2252+
return DdlNode::dsqlPass(dsqlScratch);
2253+
}
2254+
22472255
Firebird::string internalPrint(NodePrinter& printer) const override;
22482256
void checkPermission(thread_db* tdbb, jrd_tra* transaction) override;
22492257
void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction) override;

src/dsql/dsql.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,12 @@ static UCHAR* put_item( UCHAR item,
718718
}
719719

720720

721+
void IntlString::dsqlPass(DsqlCompilerScratch* dsqlScratch)
722+
{
723+
if (charset.object.hasData())
724+
dsqlScratch->qualifyExistingName(charset, obj_charset);
725+
}
726+
721727
// Return as UTF8
722728
string IntlString::toUtf8(jrd_tra* transaction) const
723729
{

src/dsql/dsql.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ class IntlString
648648
s(p)
649649
{ }
650650

651+
void dsqlPass(DsqlCompilerScratch* dsqlScratch);
652+
651653
Firebird::string toUtf8(jrd_tra* transaction) const;
652654

653655
const QualifiedName& getCharSet() const

src/dsql/parse.y

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8398,7 +8398,10 @@ sql_string
83988398
%type <stringPtr> utf_string
83998399
utf_string
84008400
: sql_string
8401-
{ $$ = newString($1->toUtf8(scratch->getTransaction())); }
8401+
{
8402+
$1->dsqlPass(scratch);
8403+
$$ = newString($1->toUtf8(scratch->getTransaction()));
8404+
}
84028405
;
84038406

84048407
%type <int32Val> signed_short_integer

0 commit comments

Comments
 (0)