Include commented out original code for flags function

This commit is contained in:
Paul Reeves 2023-01-20 16:17:06 +01:00
parent 595eb41168
commit cbc53b3ac6
1 changed files with 24 additions and 6 deletions

View File

@ -30,7 +30,7 @@
#include <ibase.h>
#include <firebird/UdrCppEngine.h>
#include <assert.h>
#include <cassert>
#include <stdio.h>
#include <stdlib.h>
@ -85,11 +85,29 @@ FB_UDR_BEGIN_FUNCTION(MFK_flagged)
FB_UDR_EXECUTE_FUNCTION
{
if ( flags == NULL ) {
return 0;
}
ISC_UINT64 i = ( 1ULL << *flag );
return ( *flags & i ) ? 1 : 0;
// Original code
// if ( flags == NULL ) {
// return 0;
// }
if ( in->flagsNull ) {
out->resultNull = FB_TRUE;
out->result = 0;
}
else
{
out->resultNull = FB_FALSE;
// Original code
// ISC_UINT64 i = ( 1ULL << *flag );
// return ( *flags & i ) ? 1 : 0;
ISC_UINT64 i = ( 1ULL << in->flag );
out->result = ( in->flags & i ) ? 1 : 0;
}
}
FB_UDR_END_FUNCTION