8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 04:03:03 +01:00

Backport fix for CORE-1862.

This commit is contained in:
robocop 2008-04-26 10:33:52 +00:00
parent b474ff21f9
commit dec27dc97d

View File

@ -1181,6 +1181,7 @@ static void list_all_procs()
bool header = true;
static const SCHAR* create_procedure_str1 = "CREATE PROCEDURE %s ";
static const SCHAR* create_procedure_str2 = "BEGIN EXIT; END %s%s";
static const char* create_procedure_str3 = "BEGIN SUSPEND; END %s%s";
// First the dummy procedures
@ -1209,7 +1210,30 @@ static void list_all_procs()
}
get_procedure_args (PRC.RDB$PROCEDURE_NAME);
isqlGlob.printf(create_procedure_str2, Procterm, NEWLINE);
prc_t proc_type = prc_legacy;
if (ENCODE_ODS(isqlGlob.major_ods, isqlGlob.minor_ods) >= ODS_11_1)
{
FOR PRC2 IN RDB$PROCEDURES
WITH PRC2.RDB$PROCEDURE_NAME EQ PRC.RDB$PROCEDURE_NAME AND
PRC2.RDB$PROCEDURE_TYPE NOT MISSING
proc_type = (prc_t) PRC2.RDB$PROCEDURE_TYPE;
END_FOR
ON_ERROR
ISQL_errmsg(gds_status);
return;
END_ERROR;
}
// We'll assume for safety that prc_legacy can be mapped to prc_selectable.
if (proc_type == prc_executable)
isqlGlob.printf(create_procedure_str2, Procterm, NEWLINE);
else
isqlGlob.printf(create_procedure_str3, Procterm, NEWLINE);
END_FOR
ON_ERROR