| 1316 | // |
| 1317 | |
| 1318 | static act* act_alter_index() |
| 1319 | { |
| 1320 | // create request block |
| 1321 | |
| 1322 | gpre_req* request = MSC_request(REQ_ddl); |
| 1323 | |
| 1324 | char i_name[NAME_SIZE + 1]; |
| 1325 | SQL_resolve_identifier("<index name>", i_name, NAME_SIZE + 1); |
| 1326 | if (gpreGlob.token_global.tok_length >= NAME_SIZE) |
| 1327 | PAR_error("Index name too long"); |
| 1328 | |
| 1329 | PAR_get_token(); |
| 1330 | |
| 1331 | gpre_index* index = make_index(request, i_name); |
| 1332 | |
| 1333 | if (MSC_match(KW_ACTIVE)) |
| 1334 | index->ind_flags |= IND_active; |
| 1335 | else if (MSC_match(KW_INACTIVE)) |
| 1336 | index->ind_flags |= IND_inactive; |
| 1337 | else |
| 1338 | PAR_error("Unsupported ALTER INDEX option"); |
| 1339 | |
| 1340 | act* action = MSC_action(request, ACT_alter_index); |
| 1341 | action->act_object = (ref*) index; |
| 1342 | action->act_whenever = gen_whenever(); |
| 1343 | |
| 1344 | return action; |
| 1345 | } |
| 1346 | |
| 1347 | |
| 1348 | //____________________________________________________________ |
no test coverage detected