commit 112c6bc392e7c9c24acf1b8ea4bc14372c6502c1 Author: kuroda.hayato%40jp.fujitsu.com Date: Tue Aug 10 08:06:20 2021 +0000 add warnings to descriptor diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c index a29f530327..35d94711d5 100644 --- a/src/interfaces/ecpg/preproc/descriptor.c +++ b/src/interfaces/ecpg/preproc/descriptor.c @@ -121,7 +121,10 @@ drop_descriptor(char *name, char *connection) } } } - mmerror(PARSE_ERROR, ET_WARNING, "descriptor \"%s\" does not exist", name); + if (connection) + mmerror(PARSE_ERROR, ET_WARNING, "descriptor %s bound to connection %s does not exist", name, connection); + else + mmerror(PARSE_ERROR, ET_WARNING, "descriptor %s bound to the default connection does not exist", name); } struct descriptor @@ -141,9 +144,18 @@ lookup_descriptor(char *name, char *connection) || (connection && i->connection && strcmp(connection, i->connection) == 0)) return i; + if (connection && !i->connection) + { + /* overwrite descriptor's connection */ + i->connection = mm_strdup(connection); + return i; + } } } - mmerror(PARSE_ERROR, ET_WARNING, "descriptor \"%s\" does not exist", name); + if (connection) + mmerror(PARSE_ERROR, ET_WARNING, "descriptor %s bound to connection %s does not exist", name, connection); + else + mmerror(PARSE_ERROR, ET_WARNING, "descriptor %s bound to the default connection does not exist", name); return NULL; }