1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

A cleanup for MCOL-4064 Make JOIN collation aware

After creating and populating tables with CHAR(5) case insensitive columns,
in a set of consequent joins like:

select * from t1, t2 where t1.c1=t2.c1;
select * from t1, t2 where t1.c1=t2.c2;
select * from t1, t2 where t1.c2=t2.c1;
select * from t1, t2 where t1.c2=t2.c2;

only the first join worked reliably case insensitively.

Removing the remaining pieces of the code that used order_swap() to compare
short CHAR columns, and using Charset::strnncollsp() instead.
This fixes the issue.
This commit is contained in:
Alexander Barkov
2020-12-10 18:58:49 +04:00
parent 4da3d8b376
commit a433c65575
6 changed files with 49 additions and 63 deletions

View File

@ -20,6 +20,7 @@
#define MCS_DATATYPES_STRING_H
#include "conststring.h"
#include "collation.h"
namespace datatypes
{
@ -36,6 +37,13 @@ public:
utils::ConstString res = utils::ConstString((const char *) &mValue, 8);
return res.rtrimZero();
}
static int strnncollsp(const datatypes::Charset &cs, int64_t a, int64_t b)
{
datatypes::TCharShort sa(a);
datatypes::TCharShort sb(b);
return cs.strnncollsp(static_cast<utils::ConstString>(sa),
static_cast<utils::ConstString>(sb));
}
};