Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: gengliqi <[email protected]>
  • Loading branch information
gengliqi committed Jan 24, 2024
1 parent 0ddc4a7 commit 3d77ac9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 105 deletions.
67 changes: 0 additions & 67 deletions dbms/src/Functions/FunctionsString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,18 +580,11 @@ TIFLASH_DECLARE_MULTITARGET_FUNCTION_TP(
to_case),
void,
lowerUpperUTF8ArrayImplTiDB,
<<<<<<< HEAD
(src, src_end, dst),
(ConstPtr<UInt8> & src,
const ConstPtr<UInt8> src_end,
Ptr<UInt8> & dst),
=======
(src_data, src_offsets, dst_data, dst_offsets),
(const ColumnString::Chars_t & src_data,
const IColumn::Offsets & src_offsets,
ColumnString::Chars_t & dst_data,
IColumn::Offsets & dst_offsets),
>>>>>>> 1305baefd6 (lowerUTF8/upperUTF8 allow lower/uppercase characters occupy different number of bytes (#8622))
{
dst_data.reserve(src_data.size());
dst_offsets.assign(src_offsets);
Expand Down Expand Up @@ -679,16 +672,6 @@ TIFLASH_DECLARE_MULTITARGET_FUNCTION_TP(
dst_offsets[i] = src_offsets[i] + diff;
}
}
<<<<<<< HEAD
while (src < src_end)
toCaseImplTiDB<
not_case_lower_bound,
not_case_upper_bound,
ascii_upper_bound,
flip_case_mask,
to_case>(src, src_end, dst);
=======
>>>>>>> 1305baefd6 (lowerUTF8/upperUTF8 allow lower/uppercase characters occupy different number of bytes (#8622))
})
} // namespace

Expand Down Expand Up @@ -734,57 +717,7 @@ void TiDBLowerUpperUTF8Impl<not_case_lower_bound, not_case_upper_bound, to_case>
size_t /*n*/,
ColumnString::Chars_t & /*res_data*/)
{
<<<<<<< HEAD
res_data.resize(data.size());
array(data.data(), data.data() + data.size(), res_data.data());
}

template <char not_case_lower_bound,
char not_case_upper_bound,
int to_case(int)>
void TiDBLowerUpperUTF8Impl<not_case_lower_bound, not_case_upper_bound, to_case>::constant(
const std::string & data,
std::string & res_data)
{
res_data.resize(data.size());
array(reinterpret_cast<const UInt8 *>(data.data()),
reinterpret_cast<const UInt8 *>(data.data() + data.size()),
reinterpret_cast<UInt8 *>(&res_data[0]));
}

template <char not_case_lower_bound,
char not_case_upper_bound,
int to_case(int)>
void TiDBLowerUpperUTF8Impl<not_case_lower_bound, not_case_upper_bound, to_case>::toCase(
const UInt8 *& src,
const UInt8 * src_end,
UInt8 *& dst)
{
toCaseImplTiDB<
not_case_lower_bound,
not_case_upper_bound,
ascii_upper_bound,
flip_case_mask,
to_case>(src, src_end, dst);
}

template <char not_case_lower_bound,
char not_case_upper_bound,
int to_case(int)>
void TiDBLowerUpperUTF8Impl<not_case_lower_bound, not_case_upper_bound, to_case>::array(
const UInt8 * src,
const UInt8 * src_end,
UInt8 * dst)
{
lowerUpperUTF8ArrayImplTiDB<
not_case_lower_bound,
not_case_upper_bound,
ascii_upper_bound,
flip_case_mask,
to_case>(src, src_end, dst);
=======
throw Exception("Cannot apply function TiDBLowerUpperUTF8 to fixed string.", ErrorCodes::ILLEGAL_COLUMN);
>>>>>>> 1305baefd6 (lowerUTF8/upperUTF8 allow lower/uppercase characters occupy different number of bytes (#8622))
}

/** If the string is encoded in UTF-8, then it selects a substring of code points in it.
Expand Down
6 changes: 0 additions & 6 deletions dbms/src/Functions/tests/gtest_strings_lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ class StringLower : public DB::tests::FunctionTest

TEST_F(StringLower, lowerAll)
{
<<<<<<< HEAD
std::vector<std::optional<String>> candidate_strings = {"one WEEK’S time TEST", "abc测试def", "ABCテストabc", "ЀЁЂѓЄЅІїЈЉЊЋЌѝЎЏ", "+Ѐ-ё*Ђ/ѓ!Є@Ѕ#І$@Ї%Ј……љ&Њ(Ћ)Ќ¥Ѝ#Ў@Џ!^", "ΑΒΓΔΕΖΗΘικΛΜΝΞΟΠΡΣτΥΦΧΨωΣ", "▲Α▼Βγ➨ΔΕ☎ΖΗ✂ΘΙ€ΚΛ♫ΜΝ✓ΞΟ✚ΠΡ℉ΣΤ♥ΥΦ♖ΧΨ♘Ω★Σ✕", "թՓՁՋՐՉՃԺԾՔՈԵՌՏԸՒԻՕՊԱՍԴՖԳՀՅԿԼԽԶՂՑՎԲՆմՇ"};
std::vector<std::optional<String>> lower_case_strings = {"one week’s time test", "abc测试def", "abcテストabc", "ѐёђѓєѕіїјљњћќѝўџ", "+ѐ-ё*ђ/ѓ!є@ѕ#і$@ї%ј……љ&њ(ћ)ќ¥ѝ#ў@џ!^", "αβγδεζηθικλμνξοπρστυφχψωσ", "▲α▼βγ➨δε☎ζη✂θι€κλ♫μν✓ξο✚πρ℉στ♥υφ♖χψ♘ω★σ✕", "թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"};
=======
std::vector<std::optional<String>> candidate_strings
= {"one WEEK'S time TEST",
"abc测试def",
Expand Down Expand Up @@ -96,8 +92,6 @@ TEST_F(StringLower, lowerAll)
"ɱɑⱥωabcdefghijklmnopɥaⱦ",
"test_wrong_utf8_2\xf1\x22",
"թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"};
>>>>>>> 1305baefd6 (lowerUTF8/upperUTF8 allow lower/uppercase characters occupy different number of bytes (#8622))


ASSERT_COLUMN_EQ(
toNullableVec(lower_case_strings),
Expand Down
32 changes: 0 additions & 32 deletions dbms/src/Functions/tests/gtest_strings_upper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ class StringUpper : public DB::tests::FunctionTest
return createColumn<Nullable<String>>(v);
}

<<<<<<< HEAD
static ColumnWithTypeAndName toVec(const std::vector<String> & v)
{
return createColumn<String>(v);
=======
static ColumnWithTypeAndName toVec(const std::vector<std::optional<String>> & v)
{
std::vector<String> strings;
Expand All @@ -58,7 +53,6 @@ class StringUpper : public DB::tests::FunctionTest
}

return createColumn<String>(strings);
>>>>>>> 1305baefd6 (lowerUTF8/upperUTF8 allow lower/uppercase characters occupy different number of bytes (#8622))
}

static ColumnWithTypeAndName toConst(const String & s)
Expand All @@ -69,31 +63,6 @@ class StringUpper : public DB::tests::FunctionTest

TEST_F(StringUpper, upperAll)
{
<<<<<<< HEAD
ASSERT_COLUMN_EQ(
toNullableVec({"ONE WEEK’S TIME TEST", "ABC测试DEF", "ABCテストABC", "ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ", "+Ѐ-Ё*Ђ/Ѓ!Є@Ѕ#І$@Ї%Ј……Љ&Њ(Ћ)Ќ¥Ѝ#Ў@Џ!^", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΣ", "▲Α▼ΒΓ➨ΔΕ☎ΖΗ✂ΘΙ€ΚΛ♫ΜΝ✓ΞΟ✚ΠΡ℉ΣΤ♥ΥΦ♖ΧΨ♘Ω★Σ✕", "ԹՓՁՋՐՉՃԺԾՔՈԵՌՏԸՒԻՕՊԱՍԴՖԳՀՅԿԼԽԶՂՑՎԲՆՄՇ"}),
executeFunction(
"upperUTF8",
toNullableVec({"one week’s time TEST", "abc测试DeF", "AbCテストAbC", "ѐёђѓєѕіїјЉЊЋЌЍЎЏ", "+ѐ-ё*ђ/ѓ!є@ѕ#і$@ї%ј……Љ&Њ(Ћ)Ќ¥Ѝ#Ў@Џ!^", "αβγδεζηθικλμνξοπρστυφχψως", "▲α▼βγ➨δε☎ζη✂θι€κλ♫μν✓ξο✚πρ℉στ♥υφ♖χψ♘ω★ς✕", "թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"})));

ASSERT_COLUMN_EQ(
toVec({"ONE WEEK’S TIME TEST", "ABC测试DEF", "ABCテストABC", "ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏ", "+Ѐ-Ё*Ђ/Ѓ!Є@Ѕ#І$@Ї%Ј……Љ&Њ(Ћ)Ќ¥Ѝ#Ў@Џ!^", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΣ", "▲Α▼ΒΓ➨ΔΕ☎ΖΗ✂ΘΙ€ΚΛ♫ΜΝ✓ΞΟ✚ΠΡ℉ΣΤ♥ΥΦ♖ΧΨ♘Ω★Σ✕", "ԹՓՁՋՐՉՃԺԾՔՈԵՌՏԸՒԻՕՊԱՍԴՖԳՀՅԿԼԽԶՂՑՎԲՆՄՇ"}),
executeFunction(
"upperUTF8",
toVec({"one week’s time TEST", "abc测试DeF", "AbCテストAbC", "ѐёђѓєѕіїјЉЊЋЌЍЎЏ", "+ѐ-ё*ђ/ѓ!є@ѕ#і$@ї%ј……Љ&Њ(Ћ)Ќ¥Ѝ#Ў@Џ!^", "αβγδεζηθικλμνξοπρστυφχψως", "▲α▼βγ➨δε☎ζη✂θι€κλ♫μν✓ξο✚πρ℉στ♥υφ♖χψ♘ω★ς✕", "թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"})));

ASSERT_COLUMN_EQ(
toNullableVec({"one week’s time TEST", "abc测试DeF", "AbCテストAbC", "ѐёђѓєѕіїјЉЊЋЌЍЎЏ", "αβγδεζηθικλμνξοπρστυφχψως", "թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"}),
executeFunction(
"upperBinary",
toNullableVec({"one week’s time TEST", "abc测试DeF", "AbCテストAbC", "ѐёђѓєѕіїјЉЊЋЌЍЎЏ", "αβγδεζηθικλμνξοπρστυφχψως", "թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"})));

ASSERT_COLUMN_EQ(
toVec({"one week’s time TEST", "abc测试DeF", "AbCテストAbC", "ѐёђѓєѕіїјЉЊЋЌЍЎЏ", "αβγδεζηθικλμνξοπρστυφχψως", "թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"}),
executeFunction(
"upperBinary",
toVec({"one week’s time TEST", "abc测试DeF", "AbCテストAbC", "ѐёђѓєѕіїјЉЊЋЌЍЎЏ", "αβγδεζηθικλμνξοπρστυφχψως", "թփձջրչճժծքոեռտըւիօպասդֆգհյկլխզղցվբնմշ"})));
=======
std::vector<std::optional<String>> candidate_strings
= {"one week's time TEST",
"abc测试DeF",
Expand Down Expand Up @@ -131,7 +100,6 @@ TEST_F(StringUpper, upperAll)
executeFunction("upperBinary", toNullableVec(candidate_strings)));

ASSERT_COLUMN_EQ(toVec(candidate_strings), executeFunction("upperBinary", toVec(candidate_strings)));
>>>>>>> 1305baefd6 (lowerUTF8/upperUTF8 allow lower/uppercase characters occupy different number of bytes (#8622))

ASSERT_COLUMN_EQ(
toConst("ONE WEEK’S TIME TEST"),
Expand Down

0 comments on commit 3d77ac9

Please sign in to comment.