From 0db5ec9227c893ef9798531756f271eb59dde82b Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 12 Apr 2019 03:52:24 +0300 Subject: [PATCH] More tests --- dbms/src/Functions/GatherUtils/Sources.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dbms/src/Functions/GatherUtils/Sources.h b/dbms/src/Functions/GatherUtils/Sources.h index 6be9e6b472c..1665992d112 100644 --- a/dbms/src/Functions/GatherUtils/Sources.h +++ b/dbms/src/Functions/GatherUtils/Sources.h @@ -279,6 +279,15 @@ struct StringSource /// Differs to StringSource by having 'offest' and 'length' in code points instead of bytes in getSlice* methods. +/** NOTE: The behaviour of substring and substringUTF8 is inconsistent when negative offset is greater than string size: + * substring: + * hello + * ^-----^ - offset -10, length 7, result: "he" + * substringUTF8: + * hello + * ^-----^ - offset -10, length 7, result: "hello" + * This may be subject for change. + */ struct UTF8StringSource : public StringSource { using StringSource::StringSource;