diff --git a/storage/temptable/include/temptable/cell_calculator.h b/storage/temptable/include/temptable/cell_calculator.h index d993e47..87aa0a7 100644 --- a/storage/temptable/include/temptable/cell_calculator.h +++ b/storage/temptable/include/temptable/cell_calculator.h @@ -166,9 +166,21 @@ inline size_t Cell_calculator::hash(const Cell &cell) const { } auto data_length = cell.data_length(); +#ifdef HAVE_ZSQL_FIX_ORIGINAL_BUGS //EC-YT:612004735630 + /* + If the collation of field to calculate hash is with PAD_SPACE attribute, + empty string '' and space ' ' will be calculated as different hash values, + because we handle empty string '' directly (return 0), and calculate hash + with cs for space ' '. But actually, for collations with PAD_SPACE attribute + empty string '' should be equal with space ' '. As a result, incorrect resultset + will be produced, or `duplicate entry` error will be reported (should not). + */ + /* if (data_length == 0) { return 0; } + */ +#endif /* HAVE_ZSQL_FIX_ORIGINAL_BUGS */ auto data = cell.data();