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

Function create_index

src/gpre/cmd.cpp:1526–1558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1524//
1525
1526static void create_index( gpre_req* request, const gpre_index* index)
1527{
1528 if (index->ind_symbol)
1529 put_symbol(request, isc_dyn_def_idx, index->ind_symbol);
1530 else
1531 {
1532 // An index created because of the UNIQUE constraint on this field.
1533 put_cstring(request, isc_dyn_def_idx, "");
1534 }
1535
1536 put_symbol(request, isc_dyn_rel_name, index->ind_relation->rel_symbol);
1537
1538 if (index->ind_flags & IND_dup_flag)
1539 put_numeric(request, isc_dyn_idx_unique, 1);
1540
1541 if (index->ind_flags & IND_descend)
1542 put_numeric(request, isc_dyn_idx_type, 1);
1543
1544 if (index->ind_symbol)
1545 {
1546 for (const gpre_fld* field = index->ind_fields; field; field = field->fld_next)
1547 {
1548 put_symbol(request, isc_dyn_fld_name, field->fld_symbol);
1549 }
1550 }
1551 else
1552 {
1553 // An index created on this one field because of the UNIQUE constraint on this field.
1554 put_symbol(request, isc_dyn_fld_name, index->ind_fields->fld_symbol);
1555 }
1556
1557 request->add_end();
1558}
1559
1560
1561//____________________________________________________________

Callers 4

SetInternalMethod · 0.85
InsertInternalMethod · 0.85
CMD_compile_ddlFunction · 0.85
create_tableFunction · 0.85

Calls 4

put_symbolFunction · 0.85
put_cstringFunction · 0.85
add_endMethod · 0.80
put_numericFunction · 0.70

Tested by

no test coverage detected