Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

[TRAFODION-2791] 'Not casespecific' column comparison returns wrong #1307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

duoluodexiaokeke
Copy link

'Not casespecific' column comparison returns wrongresult, now like and t.c1=t.c2 not support

…esults. now like and t.c1=t.c2 not support
@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

3 similar comments
@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

@svarnau
Copy link
Contributor

svarnau commented Nov 21, 2017

jenkins, ok to test

@Traf-Jenkins
Copy link

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2193/

@Traf-Jenkins
Copy link

Copy link
Contributor

@DaveBirdsall DaveBirdsall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good to me. The regression failures (core/TEST032 and core/TEST038) need to be investigated.

Copy link
Contributor

@zellerh zellerh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see detailed comments.

enum CharInfo::Collation collation=CharInfo::DefaultCollation,
enum CharInfo::Coercibility coercibility=CharInfo::COERCIBLE,
NAMemory * outHeap = CmpCommon::statementHeap()
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding another constructor, I would suggest to add an optional argument isCaseInSensitive to the previous constructor.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first, I think isCaseInSensitive is a import attribute,
second, i don't think add this argument to the end of constructor is a good way.
if add this argument in the second position, it will change some code where call it.
so i add a new constructor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you need to add it as the last argument of the existing constructors.

@@ -359,6 +367,16 @@ class ConstValue : public ItemExpr
enum CharInfo::CharSet strLitPrefixCharSet=CharInfo::UnknownCharSet
);

ConstValue(const NAWString& strval,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here.

@@ -503,7 +503,13 @@ ConstValue* OptRangeSpec::getConstOperand(ItemExpr* predExpr, Lng32 constInx)
// currently support. Predicates involving types not yet supported will be
// treated as residual predicates.
if (QRDescGenerator::typeSupported(static_cast<ConstValue*>(right)->getType()))
{
Copy link
Contributor

@zellerh zellerh Nov 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a case-insensitive flag to the type in the RangeSpec, but I don't think RangeSpecs are written to handle case-insensitive comparisons. Take a look at the methods that deal with comparisons when building RangeSpecs, in file Range.cpp. So, I think you would have to do one of two things: a) disable the RangeSpec transformation for case-insensitive comparison operators (the easy way) or b) change the RangeSpec methods to handle case-insensitive comparisons.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do those operators in order to add case-insensitive to new constvalue.
i don't understand the a
for b, case-insensitive only use in
if (parentOfStart)
parentOfStart->child(1) =
new(mvqrHeap_) ConstValue(charSubrange->start,
if add a RangeSpec methods about case-insensitive , we need add this attribute to parentOfStart->child(1) after operating above.
so i don't think this is a good way

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RangeSpecs keep a list of points and intervals and these intervals need to be ordered, otherwise RangeSpec doesn't work. If we have case-insensitive comparison, that ordering needs to be different, but as far as I could tell, there is no code at the moment that would do a case-insensitive ordering of the values.

@zellerh
Copy link
Contributor

zellerh commented Nov 28, 2017

-1
You may need to study RangeSpecs a bit more before solving this problem.

@zellerh
Copy link
Contributor

zellerh commented Dec 1, 2017

Hi again, here is a suggestion: Change method OptRangeSpec::buildRange() and add a check whether a comparison operation (ITM_EQUAL, ITM_LESS, etc.) involves a case-inspecific comparison. If so, then set the local variable isRange to FALSE. This should avoid getting into this problem, as there will be no more RangeSpecs for case-inspecific comparisons.

@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

2 similar comments
@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

@Traf-Jenkins
Copy link

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2289/

@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

@Traf-Jenkins
Copy link

@DaveBirdsall
Copy link
Contributor

core/TEST032 and core/TEST038 are failing with compiler assertion errors. Those need to be fixed before we can merge this change.

@Traf-Jenkins
Copy link

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/2890/

@Traf-Jenkins
Copy link

@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

1 similar comment
@Traf-Jenkins
Copy link

Can one of the admins verify this patch?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants