Jeremy, you're right.
"CREATE TABLE t1 AS SELECT REPEAT('a',N) AS a LIMIT 0" has been always used
in tests to create a VARCHAR(N) column using the current value of @@collation_connection.
It worked fine with all tests not using binlog with statement format.
A fix for MDEV-6170 added a new test into include/ctype_filesort.inc,
to cover as many collations as possible (not only utf8_bin).
As a result, the test binlog_stm_ctype_cp932 started to fail with the error
"Unsafe statement written to the binary log using statement...".
The easiest way was to make "SELECT .. LIMIT 0" deterministic,
which was erroneously not. So the patch actually fixes two problems.
The new behaviour IS tested in binlog_stm_ctype_cp932.
By the way, the old behaviour of "LIMIT 0" was not tested,
neither specifically, nor indirectly.
Note that with only that patch applied, I get a failure in main.ctype_utf32:
assertion failed at sql/filesort.cc:927 in void make_sortkey(Sort_param*, uchar*, uchar*): sort_field->length >= length
Obviously some other change is required but I am not sure what.