mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
e2da748c29
Problem: Item_func_date_format::val_str() and make_date_time() did not take into account that the format string and the result string (separately or at the same time) can be of a tricky character set like UCS2, UTF16, UTF32. As a result, DATE_FORMAT() could generate an ill-formed result which crashed on DBUG_ASSERTs testing well-formedness in other parts of the code. Fix: 1. class String changes Removing String::append_with_prefill(). It was not compatible with tricky character sets. Also it was inconvenient to use and required too much duplicate code on the caller side. Adding String::append_zerofill() instead. It's compatible with tricky character sets and is easier to use. Adding helper methods Static_binary_string::q_append_wc() and String::append_wc(), to append a single wide character (a Unicode code point in my_wc_t). 2. storage/spider changes Removing spider_string::append_with_prefill(). It used String::append_with_prefix() inside, but it was unused itself. 3. Changing tricky charset incompatible code pieces in make_date_time() to compatible replacements: - Fixing the loop scanning the format string to iterate in terms of Unicode code points (using mb_wc()) rather than in terms of "char" items. - Using append_wc(my_wc_t) instead of append(char) to append a single character to the result string. - Using append_zerofill() instead of append_with_prefill() to append date/time numeric components to the result string. |
||
---|---|---|
.. | ||
hs_client | ||
mysql-test/spider | ||
scripts | ||
CMakeLists.txt | ||
configure.in | ||
ha_spider.cc | ||
ha_spider.h | ||
Makefile.am | ||
spd_conn.cc | ||
spd_conn.h | ||
spd_copy_tables.cc | ||
spd_copy_tables.h | ||
spd_db_conn.cc | ||
spd_db_conn.h | ||
spd_db_handlersocket.cc | ||
spd_db_handlersocket.h | ||
spd_db_include.cc | ||
spd_db_include.h | ||
spd_db_mysql.cc | ||
spd_db_mysql.h | ||
spd_db_oracle.cc | ||
spd_db_oracle.h | ||
spd_direct_sql.cc | ||
spd_direct_sql.h | ||
spd_environ.h | ||
spd_err.h | ||
spd_group_by_handler.cc | ||
spd_group_by_handler.h | ||
spd_i_s.cc | ||
spd_include.h | ||
spd_init_query.h | ||
spd_malloc.cc | ||
spd_malloc.h | ||
spd_param.cc | ||
spd_param.h | ||
spd_ping_table.cc | ||
spd_ping_table.h | ||
spd_sys_table.cc | ||
spd_sys_table.h | ||
spd_table.cc | ||
spd_table.h | ||
spd_trx.cc | ||
spd_trx.h | ||
spd_udf.cc | ||
spd_udf.def | ||
spd_udf.h |