MCPcopy Create free account
hub / github.com/MariaDB/server / CheckSorted

Method CheckSorted

storage/connect/tabdos.cpp:2860–2878  ·  view source on GitHub ↗

/ Checks whether a column declared as sorted is sorted indeed. */ /

Source from the content-addressed store, hash-verified

2858/* Checks whether a column declared as sorted is sorted indeed. */
2859/***********************************************************************/
2860bool DOSCOL::CheckSorted(PGLOBAL g)
2861 {
2862 if (Sorted)
2863 {
2864 if (OldVal) {
2865 // Verify whether this column is sorted all right
2866 if (OldVal->CompareValue(Value) > 0) {
2867 // Column is no more in ascending order
2868 snprintf(g->Message, sizeof(g->Message), MSG(COL_NOT_SORTED), Name, To_Tdb->GetName());
2869 Sorted = false;
2870 return true;
2871 } else
2872 OldVal->SetValue_pval(Value);
2873
2874 } else
2875 OldVal = AllocateValue(g, Value);
2876 }
2877 return false;
2878 } // end of CheckSorted
2879
2880/***********************************************************************/
2881/* AddDistinctValue: Check whether this value already exist in the */

Callers

nothing calls this directly

Calls 4

AllocateValueFunction · 0.85
CompareValueMethod · 0.80
SetValue_pvalMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected