| 4341 | // |
| 4342 | |
| 4343 | static act* act_set_statistics() |
| 4344 | { |
| 4345 | gpre_req* request = MSC_request(REQ_ddl); |
| 4346 | STS stats = (STS) MSC_alloc(STS_LEN); |
| 4347 | |
| 4348 | if (gpreGlob.isc_databases && !gpreGlob.isc_databases->dbb_next) |
| 4349 | request->req_database = gpreGlob.isc_databases; |
| 4350 | else |
| 4351 | PAR_error("Can SET STATISTICS in context of single database only"); |
| 4352 | |
| 4353 | if (MSC_match(KW_INDEX)) |
| 4354 | { |
| 4355 | stats->sts_flags = STS_index; |
| 4356 | stats->sts_name = (STR) MSC_alloc(NAME_SIZE + 1); |
| 4357 | SQL_resolve_identifier("<index name>", stats->sts_name->str_string, NAME_SIZE + 1); |
| 4358 | if (gpreGlob.token_global.tok_length >= NAME_SIZE) |
| 4359 | PAR_error("Index name too long"); |
| 4360 | |
| 4361 | PAR_get_token(); |
| 4362 | } |
| 4363 | else |
| 4364 | CPR_s_error("INDEX"); |
| 4365 | |
| 4366 | act* action = (act*) MSC_action(request, ACT_statistics); |
| 4367 | action->act_object = (ref*) stats; |
| 4368 | return action; |
| 4369 | } |
| 4370 | |
| 4371 | |
| 4372 | //____________________________________________________________ |
no test coverage detected