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

Function duplicate_key

src/jrd/idx.cpp:1999–2024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1997
1998
1999static bool duplicate_key(const UCHAR* record1, const UCHAR* record2, void* ifl_void)
2000{
2001/**************************************
2002 *
2003 * d u p l i c a t e _ k e y
2004 *
2005 **************************************
2006 *
2007 * Functional description
2008 * Callback routine for duplicate keys during index creation. Just
2009 * bump a counter.
2010 *
2011 **************************************/
2012 IndexCreation* ifl_data = static_cast<IndexCreation*>(ifl_void);
2013 const index_sort_record* rec1 = (index_sort_record*) (record1 + ifl_data->key_length);
2014 const index_sort_record* rec2 = (index_sort_record*) (record2 + ifl_data->key_length);
2015
2016 if (!(rec1->isr_flags & (ISR_secondary | ISR_null)) &&
2017 !(rec2->isr_flags & (ISR_secondary | ISR_null)))
2018 {
2019 if (ifl_data->duplicates.exchangeAdd(1) == 0)
2020 ifl_data->dup_recno = rec2->isr_record_number;
2021 }
2022
2023 return false;
2024}
2025
2026
2027static PageNumber get_root_page(thread_db* tdbb, jrd_rel* relation)

Callers

nothing calls this directly

Calls 1

exchangeAddMethod · 0.80

Tested by

no test coverage detected