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

Method setServerInfo

src/remote/client/interface.cpp:3115–3198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3113
3114
3115void Batch::setServerInfo()
3116{
3117 if (blobAlign)
3118 return;
3119
3120 // Check and validate handles, etc.
3121 if (!stmt)
3122 {
3123 Arg::Gds(isc_bad_req_handle).raise();
3124 }
3125
3126 Rsr* statement = stmt->getStatement();
3127 CHECK_HANDLE(statement, isc_bad_req_handle);
3128 Rdb* rdb = statement->rsr_rdb;
3129 CHECK_HANDLE(rdb, isc_bad_db_handle);
3130 rem_port* port = rdb->rdb_port;
3131 RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION);
3132
3133 LocalStatus ls;
3134 CheckStatusWrapper s(&ls);
3135
3136 if (port->port_protocol < PROTOCOL_VERSION17)
3137 {
3138 UCHAR item = isc_info_sql_stmt_blob_align;
3139 UCHAR buffer[16];
3140 info(&s, rdb, op_info_sql, statement->rsr_id, 0,
3141 1, &item, 0, 0, sizeof(buffer), buffer);
3142 check(&s);
3143
3144 // Extract from buffer
3145 if (buffer[0] != item)
3146 Arg::Gds(isc_batch_align).raise();
3147
3148 int len = gds__vax_integer(&buffer[1], 2);
3149 statement->rsr_batch_stream.alignment = blobAlign = gds__vax_integer(&buffer[3], len);
3150
3151 if (!blobAlign)
3152 Arg::Gds(isc_batch_align).raise();
3153
3154 return;
3155 }
3156
3157 // Perform info call to server
3158 UCHAR items[] = {IBatch::INF_BLOB_ALIGNMENT, IBatch::INF_BUFFER_BYTES_SIZE, IBatch::INF_BLOB_HEADER};
3159 UCHAR buffer[64];
3160 info(&s, rdb, op_info_batch, statement->rsr_id, 0,
3161 sizeof(items), items, 0, 0, sizeof(buffer), buffer);
3162 check(&s);
3163
3164 // Extract from buffer
3165 ClumpletReader out(ClumpletReader::InfoResponse, buffer, sizeof(buffer));
3166 for (out.rewind(); !out.isEof(); out.moveNext())
3167 {
3168 UCHAR item = out.getClumpTag();
3169 if (item == isc_info_end)
3170 break;
3171
3172 switch(item)

Callers

nothing calls this directly

Calls 12

GdsClass · 0.85
CHECK_HANDLEFunction · 0.85
infoFunction · 0.85
getClumpTagMethod · 0.80
checkFunction · 0.50
raiseMethod · 0.45
getStatementMethod · 0.45
rewindMethod · 0.45
isEofMethod · 0.45
moveNextMethod · 0.45
getIntMethod · 0.45
printfMethod · 0.45

Tested by

no test coverage detected