Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mysql-test/main/t.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# MDEV-35717: UBSAN: runtime errors: applying zero offset to null pointer in `my_strnncoll_utf8mb3_general1400_as_ci`, and applying non-zero offset 4 to null pointer in `my_strcoll_ascii_4bytes_found`
#
CREATE TABLE t (c INT,c2 CHAR,c3 DATE,CHECK (c>0));
ALTER TABLE t ADD INDEX (c2) USING HASH;
DROP TABLE t;
# End of 11.8 tests
10 changes: 10 additions & 0 deletions mysql-test/main/t.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--echo #
--echo # MDEV-35717: UBSAN: runtime errors: applying zero offset to null pointer in `my_strnncoll_utf8mb3_general1400_as_ci`, and applying non-zero offset 4 to null pointer in `my_strcoll_ascii_4bytes_found`
--echo #

CREATE TABLE t (c INT,c2 CHAR,c3 DATE,CHECK (c>0));
ALTER TABLE t ADD INDEX (c2) USING HASH;

DROP TABLE t;

--echo # End of 11.8 tests
4 changes: 2 additions & 2 deletions strings/strcoll.inl
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ MY_FUNCTION_NAME(strnncoll)(CHARSET_INFO *cs __attribute__((unused)),
const uchar *b, size_t b_length,
my_bool b_is_prefix)
{
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
const uchar *a_end= a ? a + a_length : NULL;
const uchar *b_end= b ? b + b_length : NULL;
for ( ; ; )
{
int a_weight, b_weight, res;
Expand Down
Loading