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

Method buildInfoItems

src/common/StatementMetadata.cpp:62–91  ·  view source on GitHub ↗

Build a list of info codes based on a prepare flags bitmask. Return "estimated" necessary size for the result buffer.

Source from the content-addressed store, hash-verified

60// Build a list of info codes based on a prepare flags bitmask.
61// Return "estimated" necessary size for the result buffer.
62unsigned StatementMetadata::buildInfoItems(Array<UCHAR>& items, unsigned flags)
63{
64 items.clear();
65
66 if (flags & IStatement::PREPARE_PREFETCH_TYPE)
67 items.add(isc_info_sql_stmt_type);
68
69 if (flags & IStatement::PREPARE_PREFETCH_FLAGS)
70 items.add(isc_info_sql_stmt_flags);
71
72 if (flags & IStatement::PREPARE_PREFETCH_INPUT_PARAMETERS)
73 {
74 items.add(isc_info_sql_bind);
75 items.push(DESCRIBE_VARS, sizeof(DESCRIBE_VARS));
76 }
77
78 if (flags & IStatement::PREPARE_PREFETCH_OUTPUT_PARAMETERS)
79 {
80 items.add(isc_info_sql_select);
81 items.push(DESCRIBE_VARS, sizeof(DESCRIBE_VARS));
82 }
83
84 if (flags & IStatement::PREPARE_PREFETCH_LEGACY_PLAN)
85 items.add(isc_info_sql_get_plan);
86
87 if (flags & IStatement::PREPARE_PREFETCH_DETAILED_PLAN)
88 items.add(isc_info_sql_explain_plan);
89
90 return INFO_BUFFER_SIZE;
91}
92
93// Build a prepare flags bitmask based on a list of info codes.
94unsigned StatementMetadata::buildInfoFlags(unsigned itemsLength, const UCHAR* items)

Callers

nothing calls this directly

Calls 3

clearMethod · 0.45
addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected