GEN_descriptor @brief Generate a blr descriptor from an internal descriptor. @param dsqlScratch @param desc @param texttype **/
| 295 | |
| 296 | **/ |
| 297 | void GEN_descriptor( DsqlCompilerScratch* dsqlScratch, const dsc* desc, bool texttype) |
| 298 | { |
| 299 | switch (desc->dsc_dtype) |
| 300 | { |
| 301 | case dtype_text: |
| 302 | if (texttype || desc->dsc_ttype() == ttype_binary || desc->dsc_ttype() == ttype_none) |
| 303 | { |
| 304 | dsqlScratch->appendUChar(blr_text2); |
| 305 | dsqlScratch->appendUShort(desc->dsc_ttype()); |
| 306 | } |
| 307 | else |
| 308 | { |
| 309 | dsqlScratch->appendUChar(blr_text2); // automatic transliteration |
| 310 | dsqlScratch->appendUShort(ttype_dynamic); |
| 311 | } |
| 312 | |
| 313 | dsqlScratch->appendUShort(desc->dsc_length); |
| 314 | break; |
| 315 | |
| 316 | case dtype_varying: |
| 317 | if (texttype || desc->dsc_ttype() == ttype_binary || desc->dsc_ttype() == ttype_none) |
| 318 | { |
| 319 | dsqlScratch->appendUChar(blr_varying2); |
| 320 | dsqlScratch->appendUShort(desc->dsc_ttype()); |
| 321 | } |
| 322 | else |
| 323 | { |
| 324 | dsqlScratch->appendUChar(blr_varying2); // automatic transliteration |
| 325 | dsqlScratch->appendUShort(ttype_dynamic); |
| 326 | } |
| 327 | dsqlScratch->appendUShort(desc->dsc_length - sizeof(USHORT)); |
| 328 | break; |
| 329 | |
| 330 | case dtype_short: |
| 331 | dsqlScratch->appendUChar(blr_short); |
| 332 | dsqlScratch->appendUChar(desc->dsc_scale); |
| 333 | break; |
| 334 | |
| 335 | case dtype_long: |
| 336 | dsqlScratch->appendUChar(blr_long); |
| 337 | dsqlScratch->appendUChar(desc->dsc_scale); |
| 338 | break; |
| 339 | |
| 340 | case dtype_quad: |
| 341 | dsqlScratch->appendUChar(blr_quad); |
| 342 | dsqlScratch->appendUChar(desc->dsc_scale); |
| 343 | break; |
| 344 | |
| 345 | case dtype_int64: |
| 346 | dsqlScratch->appendUChar(blr_int64); |
| 347 | dsqlScratch->appendUChar(desc->dsc_scale); |
| 348 | break; |
| 349 | |
| 350 | case dtype_real: |
| 351 | dsqlScratch->appendUChar(blr_float); |
| 352 | break; |
| 353 | |
| 354 | case dtype_double: |
no test coverage detected