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

Function PAR_sort

src/jrd/par.cpp:1489–1514  ·  view source on GitHub ↗

Parse a sort clause (sans header byte). This is used for blr_sort, blr_project and blr_group_by.

Source from the content-addressed store, hash-verified

1487
1488// Parse a sort clause (sans header byte). This is used for blr_sort, blr_project and blr_group_by.
1489SortNode* PAR_sort(thread_db* tdbb, CompilerScratch* csb, UCHAR expectedBlr,
1490 bool nullForEmpty)
1491{
1492 SET_TDBB(tdbb);
1493
1494 const UCHAR blrOp = csb->csb_blr_reader.getByte();
1495
1496 if (blrOp != expectedBlr)
1497 {
1498 char s[20];
1499 sprintf(s, "blr code %d", expectedBlr);
1500 PAR_syntax_error(csb, s);
1501 }
1502
1503 USHORT count = csb->csb_blr_reader.getByte();
1504
1505 if (count == 0 && nullForEmpty)
1506 return NULL;
1507
1508 SortNode* sort = PAR_sort_internal(tdbb, csb, blrOp == blr_sort, count);
1509
1510 if (blrOp != blr_sort)
1511 sort->unique = true;
1512
1513 return sort;
1514}
1515
1516
1517// Parse the internals of a sort clause. This is used for blr_sort, blr_project, blr_group_by

Callers 3

parseMethod · 0.85
PAR_rseFunction · 0.85

Calls 4

SET_TDBBFunction · 0.85
PAR_syntax_errorFunction · 0.85
PAR_sort_internalFunction · 0.85
getByteMethod · 0.45

Tested by

no test coverage detected