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

Method drop_database

src/remote/server/server.cpp:3138–3195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3136
3137
3138void rem_port::drop_database(P_RLSE* /*release*/, PACKET* sendL)
3139{
3140/**************************************
3141 *
3142 * d r o p _ d a t a b a s e
3143 *
3144 **************************************
3145 *
3146 * Functional description
3147 * End a request.
3148 *
3149 **************************************/
3150 LocalStatus ls;
3151 CheckStatusWrapper status_vector(&ls);
3152
3153 Rdb* rdb = this->port_context;
3154 if (bad_db(&status_vector, rdb))
3155 {
3156 this->send_response(sendL, 0, 0, &status_vector, false);
3157 return;
3158 }
3159
3160 rdb->rdb_iface->dropDatabase(&status_vector);
3161
3162 if ((status_vector.getState() & IStatus::STATE_ERRORS) &&
3163 (status_vector.getErrors()[1] != isc_drdb_completed_with_errs))
3164 {
3165 this->send_response(sendL, 0, 0, &status_vector, false);
3166 return;
3167 }
3168
3169 { // scope
3170 RefMutexGuard portGuard(*port_cancel_sync, FB_FUNCTION);
3171 rdb->rdb_iface = NULL;
3172 }
3173
3174 port_flags |= PORT_detached;
3175
3176 if (port_async)
3177 port_async->port_flags |= PORT_detached;
3178
3179 while (rdb->rdb_events)
3180 release_event(rdb->rdb_events);
3181
3182 while (rdb->rdb_requests)
3183 release_request(rdb->rdb_requests, true);
3184
3185 while (rdb->rdb_sql_requests)
3186 release_sql_request(rdb->rdb_sql_requests);
3187
3188 while (rdb->rdb_transactions)
3189 release_transaction(rdb->rdb_transactions);
3190
3191 if (this->port_statement)
3192 release_statement(&this->port_statement);
3193
3194 this->send_response(sendL, 0, 0, &status_vector, false);
3195}

Callers 1

process_packetFunction · 0.80

Calls 10

send_responseMethod · 0.95
bad_dbFunction · 0.85
release_eventFunction · 0.70
release_requestFunction · 0.70
release_sql_requestFunction · 0.70
release_transactionFunction · 0.70
release_statementFunction · 0.70
dropDatabaseMethod · 0.45
getStateMethod · 0.45
getErrorsMethod · 0.45

Tested by

no test coverage detected