Skip to content

Commit

Permalink
show reason for dbCreateAlias failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-zimoch committed Aug 13, 2024
1 parent 86cdfc5 commit 24e4c59
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/database/src/ioc/dbStatic/dbLexRoutines.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,8 +1263,9 @@ static void dbRecordAlias(char *name)
pdbentry = ptempListNode->item;
status = dbCreateAlias(pdbentry, name);
if (status) {
fprintf(stderr, "Can't create alias \"%s\" for \"%s\"\n",
name, dbGetRecordName(pdbentry));
fprintf(stderr, "Can't create alias \"%s\" for \"%s\"%s\n",
name, dbGetRecordName(pdbentry),
status == S_dbLib_recExists ? ", name already used" : "");
yyerror(NULL);
return;
}
Expand All @@ -1274,6 +1275,7 @@ static void dbAlias(char *name, char *alias)
{
DBENTRY dbEntry;
DBENTRY *pdbEntry = &dbEntry;
long status;

if(dbRecordNameValidate(alias) || dbRecordNameValidate(name))
return;
Expand All @@ -1284,9 +1286,10 @@ static void dbAlias(char *name, char *alias)
alias, name);
yyerror(NULL);
}
else if (dbCreateAlias(pdbEntry, alias)) {
fprintf(stderr, "Can't create alias \"%s\" referring to \"%s\"\n",
alias, name);
else if ((status = dbCreateAlias(pdbEntry, alias))) {
fprintf(stderr, "Can't create alias \"%s\" referring to \"%s\%s"\n",
alias, name
status == S_dbLib_recExists ? ", name already used" : "");
yyerror(NULL);
}
dbFinishEntry(pdbEntry);
Expand Down

0 comments on commit 24e4c59

Please sign in to comment.