Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/590#discussion_r70331698
--- Diff: core/sql/common/MiscType.cpp ---
@@ -106,21 +172,51 @@ const NAType* SQLBoolean::synthesizeType(enum
NATypeSynthRuleEnum synthRule,
// expressions.
//
if (synthRule == SYNTH_RULE_UNION)
- return new(h) SQLBoolean();
+ return new(h) SQLBooleanNative
+ (operand1.supportsSQLnull() || operand2.supportsSQLnull());
+
return NULL;
} // synthesizeType()
+void SQLBooleanNative::minRepresentableValue(void* bufPtr, Lng32* bufLen,
+ NAString ** stringLiteral,
+ CollHeap* h) const
+{
+ assert(*bufLen >= sizeof(Int8));
+ Lng32 valueBuf;
+ *bufLen = sizeof(Int8);
+ *((Int8*)bufPtr) = 0;
+ valueBuf = 0;
-// ---------------------------------------------------------------------
-// A method which tells if a conversion error can occur when converting
-// a value of this type to the target type.
-// This method is a stub and so just returns true for now.
-// ---------------------------------------------------------------------
-NABoolean SQLBoolean::errorsCanOccur(const NAType& target, NABoolean lax)
const
+ if (stringLiteral != NULL)
+ {
+ // Generate a printable string for the minimum value
+ char nameBuf[10];
+ strcpy(nameBuf, "false");
+ *stringLiteral = new (h) NAString(nameBuf, h);
--- End diff --
Just curious: Can we say, *stringLiteral = new (h) NAString("false",h)?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---