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

Function act_insert_blob

src/gpre/sql.cpp:3617–3657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3615//
3616
3617static act* act_insert_blob()
3618{
3619 // Handle dynamic SQL statement, if appropriate
3620
3621 dyn* cursor = par_dynamic_cursor();
3622 if (cursor)
3623 {
3624 dyn* statement = (dyn*) MSC_alloc(DYN_LEN);
3625 statement->dyn_statement_name = cursor->dyn_statement_name;
3626 statement->dyn_cursor_name = cursor->dyn_cursor_name;
3627 par_using(statement);
3628 if (statement->dyn_using)
3629 PAR_error("Using host-variable list not supported.");
3630
3631 act* action = (act*) MSC_alloc(ACT_LEN);
3632 action->act_type = ACT_dyn_insert;
3633 action->act_object = (ref*) statement;
3634 action->act_whenever = gen_whenever();
3635 return action;
3636 }
3637
3638 // Statement is static SQL
3639
3640 gpre_req* request = par_cursor(NULL);
3641 if (request->req_flags & REQ_sql_blob_open)
3642 PAR_error("Inserting into a blob being opened is not allowed.");
3643
3644 act* action = MSC_action(request, ACT_put_segment);
3645 action->act_whenever = gen_whenever();
3646
3647 if (!MSC_match(KW_VALUES))
3648 CPR_s_error("VALUES");
3649
3650 EXP_left_paren(0);
3651 action->act_object = (ref*) SQE_variable(NULL, false, NULL, NULL);
3652 if (!action->act_object->ref_null_value)
3653 PAR_error("A segment length is required.");
3654 EXP_match_paren();
3655
3656 return action;
3657}
3658
3659
3660//____________________________________________________________

Callers 1

act_insertFunction · 0.85

Calls 12

par_dynamic_cursorFunction · 0.85
MSC_allocFunction · 0.85
par_usingFunction · 0.85
par_cursorFunction · 0.85
MSC_actionFunction · 0.85
MSC_matchFunction · 0.85
CPR_s_errorFunction · 0.85
EXP_left_parenFunction · 0.85
SQE_variableFunction · 0.85
EXP_match_parenFunction · 0.85
PAR_errorFunction · 0.70
gen_wheneverFunction · 0.70

Tested by

no test coverage detected