MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / act_prepare

Function act_prepare

src/gpre/sql.cpp:3946–3994  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3944//
3945
3946static act* act_prepare()
3947{
3948 if (gpreGlob.isc_databases && gpreGlob.isc_databases->dbb_next)
3949 {
3950 TEXT s[ERROR_LENGTH];
3951 fb_utils::snprintf(s, sizeof(s), "Executing dynamic SQL statement in context of database %s",
3952 gpreGlob.isc_databases->dbb_name->sym_string);
3953 CPR_warn(s);
3954 }
3955
3956 const TEXT* transaction = NULL;
3957 par_options(&transaction);
3958
3959 dyn* statement = par_statement();
3960 statement->dyn_database = gpreGlob.isc_databases;
3961 statement->dyn_trans = transaction;
3962
3963 if (MSC_match(KW_INTO))
3964 {
3965 if (MSC_match(KW_SQL) && !MSC_match(KW_DESCRIPTOR))
3966 CPR_s_error("INTO SQL DESCRIPTOR sqlda");
3967 statement->dyn_sqlda = PAR_native_value(false, false);
3968 }
3969
3970 if (!MSC_match(KW_FROM))
3971 CPR_s_error("FROM");
3972
3973 switch (gpreGlob.sw_sql_dialect)
3974 {
3975 case 1:
3976 if (!isQuoted(gpreGlob.token_global.tok_type) && !MSC_match(KW_COLON))
3977 CPR_s_error(": <string expression>");
3978 break;
3979
3980 default:
3981 if (gpreGlob.token_global.tok_type != tok_sglquoted && !MSC_match(KW_COLON))
3982 CPR_s_error(": <string expression>");
3983 break;
3984 }
3985
3986 statement->dyn_string = PAR_native_value(false, false);
3987
3988 act* action = (act*) MSC_alloc(ACT_LEN);
3989 action->act_type = ACT_dyn_prepare;
3990 action->act_object = (ref*) statement;
3991 action->act_whenever = gen_whenever();
3992
3993 return action;
3994}
3995
3996
3997//____________________________________________________________

Callers 1

SQL_actionFunction · 0.85

Calls 10

CPR_warnFunction · 0.85
par_statementFunction · 0.85
MSC_matchFunction · 0.85
CPR_s_errorFunction · 0.85
PAR_native_valueFunction · 0.85
isQuotedFunction · 0.85
MSC_allocFunction · 0.85
par_optionsFunction · 0.70
gen_wheneverFunction · 0.70
snprintfFunction · 0.50

Tested by

no test coverage detected