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

Function par_ready

src/gpre/par.cpp:2525–2694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2523//
2524
2525static act* par_ready()
2526{
2527 gpre_req* request;
2528 gpre_sym* symbol;
2529 gpre_dbb* db;
2530 bool need_handle = false;
2531 USHORT default_buffers = 0;
2532
2533 act* action = MSC_action(0, ACT_ready);
2534
2535 if (gpreGlob.token_global.tok_keyword == KW_CACHE)
2536 CPR_s_error("database name or handle");
2537
2538 while (!terminator())
2539 {
2540 // this default mechanism is left here for backwards
2541 // compatibility, but it is no longer documented and
2542 // is not something we should maintain for all ready
2543 // options since it needlessly complicates the ready
2544 // statement without providing any extra functionality
2545
2546 if (MSC_match(KW_DEFAULT))
2547 {
2548 if (!MSC_match(KW_CACHE))
2549 CPR_s_error("database name or handle");
2550 default_buffers = atoi(gpreGlob.token_global.tok_string);
2551 CPR_eol_token();
2552 MSC_match(KW_BUFFERS);
2553 continue;
2554 }
2555
2556 rdy* ready = (rdy*) MSC_alloc(RDY_LEN);
2557 ready->rdy_next = (rdy*) action->act_object;
2558 action->act_object = (ref*) ready;
2559
2560 if (!(symbol = gpreGlob.token_global.tok_symbol) || symbol->sym_type != SYM_database)
2561 {
2562 ready->rdy_filename = PAR_native_value(false, false);
2563 if (MSC_match(KW_AS))
2564 need_handle = true;
2565 }
2566
2567 if (!(symbol = gpreGlob.token_global.tok_symbol) || symbol->sym_type != SYM_database)
2568 {
2569 if (!gpreGlob.isc_databases || gpreGlob.isc_databases->dbb_next || need_handle)
2570 {
2571 need_handle = false;
2572 CPR_s_error("database handle");
2573 }
2574 ready->rdy_database = gpreGlob.isc_databases;
2575 }
2576
2577 need_handle = false;
2578 if (!ready->rdy_database)
2579 ready->rdy_database = (gpre_dbb*) symbol->sym_object;
2580 if (terminator())
2581 break;
2582 CPR_eol_token();

Callers 1

PAR_actionFunction · 0.85

Calls 10

MSC_actionFunction · 0.85
CPR_s_errorFunction · 0.85
terminatorFunction · 0.85
MSC_matchFunction · 0.85
CPR_eol_tokenFunction · 0.85
MSC_allocFunction · 0.85
PAR_native_valueFunction · 0.85
PAR_set_up_dpb_infoFunction · 0.85
PAR_endFunction · 0.85
PAR_errorFunction · 0.70

Tested by

no test coverage detected