You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by anoopsharma00 <gi...@git.apache.org> on 2016/02/05 20:10:54 UTC
[GitHub] incubator-trafodion pull request: Fixes to JIRAs 1793,1807,1808. D...
GitHub user anoopsharma00 opened a pull request:
https://github.com/apache/incubator-trafodion/pull/310
Fixes to JIRAs 1793,1807,1808. Details below.
1807: timezone specification support in datetime values
1808: query cache bug fix with time/timestamp values with fraction
1793: get stmt with views now include schema names
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/anoopsharma00/incubator-trafodion dt_br
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/310.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #310
----
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fixes to JIRAs 1793,1807,1808. D...
Posted by anoopsharma00 <gi...@git.apache.org>.
Github user anoopsharma00 commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/310#discussion_r52069261
--- Diff: core/sql/common/DateTimeType.cpp ---
@@ -1399,18 +1403,69 @@ NABoolean SQLMPDatetime::isCompatible(const NAType& other, UInt32 * flags) const
// DatetimeValue : A datetime value
//
// ***********************************************************************
-
DatetimeValue::DatetimeValue
( const char* strValue
, rec_datetime_field startField
, rec_datetime_field endField
, UInt32& fractionPrecision /* IN - OUT */
+, NABoolean useOldConstructor
)
: value_(NULL)
, valueLen_(0)
, startField_(startField)
, endField_ (endField)
{
+ if (useOldConstructor)
+ {
+ oldConstructor(strValue, startField, endField, fractionPrecision);
+ return;
+ }
+
+ char dstValue[101];
+
+ ComDiagsArea *diags = NULL;
+
+ Lng32 trueFP = 6;
+ ULng32 flags = 0;
+ flags |= CONV_NO_HADOOP_DATE_FIX;
+ short rc =
+ ExpDatetime::convAsciiToDatetime((char*)strValue, strlen(strValue),
+ dstValue, 100,
+ startField, endField,
+ ExpDatetime::DATETIME_FORMAT_NONE,
+ trueFP,
+ NULL, &diags, flags);
+ if (rc)
+ return;
--- End diff --
That return is for error paths. The Datetime value being constructed will be invalid and
not be used. isValid() method will return true.
But we can initialize fractionPrecision to zero on entry to this method.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fixes to JIRAs 1793,1807,1808. D...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-trafodion/pull/310
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fixes to JIRAs 1793,1807,1808. D...
Posted by anoopsharma00 <gi...@git.apache.org>.
Github user anoopsharma00 commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/310#discussion_r52069482
--- Diff: core/sql/common/DateTimeType.cpp ---
@@ -1399,18 +1403,69 @@ NABoolean SQLMPDatetime::isCompatible(const NAType& other, UInt32 * flags) const
// DatetimeValue : A datetime value
//
// ***********************************************************************
-
DatetimeValue::DatetimeValue
( const char* strValue
, rec_datetime_field startField
, rec_datetime_field endField
, UInt32& fractionPrecision /* IN - OUT */
+, NABoolean useOldConstructor
)
: value_(NULL)
, valueLen_(0)
, startField_(startField)
, endField_ (endField)
{
+ if (useOldConstructor)
+ {
+ oldConstructor(strValue, startField, endField, fractionPrecision);
+ return;
+ }
+
+ char dstValue[101];
+
+ ComDiagsArea *diags = NULL;
+
+ Lng32 trueFP = 6;
+ ULng32 flags = 0;
+ flags |= CONV_NO_HADOOP_DATE_FIX;
+ short rc =
+ ExpDatetime::convAsciiToDatetime((char*)strValue, strlen(strValue),
+ dstValue, 100,
+ startField, endField,
+ ExpDatetime::DATETIME_FORMAT_NONE,
+ trueFP,
+ NULL, &diags, flags);
+ if (rc)
+ return;
--- End diff --
correction: isValid() method will return FALSE on error path.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fixes to JIRAs 1793,1807,1808. D...
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/310#discussion_r52064494
--- Diff: core/sql/common/DateTimeType.cpp ---
@@ -171,6 +172,8 @@ NABoolean DatetimeType::isEncodingNeeded() const
NABoolean DatetimeType::operator==(const NAType& other) const
{
+ DatetimeType &otherDT = (DatetimeType&)other;
--- End diff --
Not sure why this variable is defined. We don't use it anywhere. Doesn't hurt anything though.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fixes to JIRAs 1793,1807,1808. D...
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/310#discussion_r52065135
--- Diff: core/sql/common/DateTimeType.cpp ---
@@ -1399,18 +1403,69 @@ NABoolean SQLMPDatetime::isCompatible(const NAType& other, UInt32 * flags) const
// DatetimeValue : A datetime value
//
// ***********************************************************************
-
DatetimeValue::DatetimeValue
( const char* strValue
, rec_datetime_field startField
, rec_datetime_field endField
, UInt32& fractionPrecision /* IN - OUT */
+, NABoolean useOldConstructor
)
: value_(NULL)
, valueLen_(0)
, startField_(startField)
, endField_ (endField)
{
+ if (useOldConstructor)
+ {
+ oldConstructor(strValue, startField, endField, fractionPrecision);
+ return;
+ }
+
+ char dstValue[101];
+
+ ComDiagsArea *diags = NULL;
+
+ Lng32 trueFP = 6;
+ ULng32 flags = 0;
+ flags |= CONV_NO_HADOOP_DATE_FIX;
+ short rc =
+ ExpDatetime::convAsciiToDatetime((char*)strValue, strlen(strValue),
+ dstValue, 100,
+ startField, endField,
+ ExpDatetime::DATETIME_FORMAT_NONE,
+ trueFP,
+ NULL, &diags, flags);
+ if (rc)
+ return;
--- End diff --
fractionPrecision will be uninitialized if we take this return
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---