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

Function sqlTypeToDsc

src/common/utils.cpp:1757–1791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1755}
1756
1757unsigned sqlTypeToDsc(unsigned runOffset, unsigned sqlType, unsigned sqlLength,
1758 unsigned* dtype, unsigned* len, unsigned* offset, unsigned* nullOffset)
1759{
1760 sqlType &= ~1;
1761 unsigned dscType = sqlTypeToDscType(sqlType);
1762
1763 if (dscType == dtype_unknown)
1764 {
1765 fb_assert(false);
1766 Firebird::Arg::Gds(isc_dsql_datatype_err).raise();
1767 }
1768
1769 if (dtype)
1770 *dtype = dscType;
1771
1772 if (sqlType == SQL_VARYING)
1773 sqlLength += sizeof(USHORT);
1774 if (len)
1775 *len = sqlLength;
1776
1777 unsigned align = type_alignments[dscType % FB_NELEM(type_alignments)];
1778 if (align)
1779 runOffset = FB_ALIGN(runOffset, align);
1780 if (offset)
1781 *offset = runOffset;
1782
1783 runOffset += sqlLength;
1784 align = type_alignments[dtype_short];
1785 if (align)
1786 runOffset = FB_ALIGN(runOffset, align);
1787 if (nullOffset)
1788 *nullOffset = runOffset;
1789
1790 return runOffset + sizeof(SSHORT);
1791}
1792
1793const ISC_STATUS* nextCode(const ISC_STATUS* v) throw()
1794{

Callers 6

parseMetadataMethod · 0.85
createFormatMethod · 0.85
setTypeMethod · 0.85
makeOffsetsMethod · 0.85
setOffsetsMethod · 0.85
assignMethod · 0.85

Calls 4

sqlTypeToDscTypeFunction · 0.85
GdsClass · 0.85
FB_ALIGNFunction · 0.85
raiseMethod · 0.45

Tested by

no test coverage detected