mariadb/include
Alexander Barkov e3dee8a7fd Bug#57737 Character sets: search fails with like, contraction, index
Problem: LIKE over an indexed column optimized away good results,
because my_like_range_utf32/utf16 returned wrong ranges for contractions.
Contraction related code was missing in my_like_range_utf32/utf16,
but did exist in my_like_range_ucs2/utf8.
It was forgotten in utf32/utf16 versions (during mysql-6.0 push/revert mess).

Fix:
The patch removes individual functions my_like_range_ucs2,
my_like_range_utf16, my_like_range_utf32 and introduces a single function
my_like_range_generic() instead. The new function handles contractions
correctly. It can handle any character set with cs->min_sort_char and
cs->max_sort_char represented in Unicode code points.

added:
  @ mysql-test/include/ctype_czech.inc
  @ mysql-test/include/ctype_like_ignorable.inc
  @ mysql-test/r/ctype_like_range.result
  @ mysql-test/t/ctype_like_range.test
  Adding tests


modified:

  @ include/m_ctype.h
  - Adding helper functions for contractions.
  - Prototypes: removing ucs2,utf16,utf32 functions, adding generic function.
  @ mysql-test/r/ctype_uca.result
  @ mysql-test/r/ctype_utf16_uca.result
  @ mysql-test/r/ctype_utf32_uca.result
  @ mysql-test/t/ctype_uca.test
  @ mysql-test/t/ctype_utf16_uca.test
  @ mysql-test/t/ctype_utf32_uca.test
  - Adding tests.

  @ strings/ctype-mb.c
  - Pad function did not put the last character.
  - Implementing my_like_range_generic() - an universal replacement
    for three separate functions
    my_like_range_ucs2(), my_like_range_utf16() and my_like_range_utf32(),
    with correct contraction handling.

  @ strings/ctype-ucs2.c
  - my_fill_mb2 did not put the high byte, as previously
    it was used to put only characters in ASCII range.
    Now it puts high byte as well
    (needed to pupulate cs->max_sort_char correctly).
  - Adding DBUG_ASSERT()
  - Removing character set specific functions:
    my_like_range_ucs2(), my_like_range_utf16() and my_like_range_utf32().
  - Using my_like_range_generic() instead of the old functions.

  @ strings/ctype-uca.c
  - Using generic function instead of the old character set specific ones.

  @ sql/item_create.cc
  @ sql/item_strfunc.cc
  @ sql/item_strfunc.h
  - Adding SQL functions LIKE_RANGE_MIN and LIKE_RANGE_MAX,
    available only in debug build to make sure like_range()
    works correctly for all character sets and collations.
2010-11-26 13:44:39 +03:00
..
atomic Bug#52419: x86 assembly based atomic CAS causes test failures 2010-09-17 17:34:15 -03:00
mysql removed misleading and over-promissing comments. 2010-11-10 17:55:57 +02:00
base64.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
CMakeLists.txt Cherry-picking patch for Bug#55846. 2010-08-31 18:33:19 +04:00
decimal.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
errmsg.h WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
ft_global.h WL#4738 streamline/simplify @@variable creation process 2009-12-22 10:35:56 +01:00
hash.h Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled 2010-07-08 18:20:08 -03:00
heap.h WL#5419 "LOCK_open scalability: make tdc_refresh_version 2010-06-11 19:28:18 +04:00
keycache.h WL#5030: Split and remove mysql_priv.h 2010-03-31 16:05:33 +02:00
lf.h WL#5498: Remove dead and unused source code 2010-07-23 17:13:36 -03:00
m_ctype.h Bug#57737 Character sets: search fails with like, contraction, index 2010-11-26 13:44:39 +03:00
m_string.h WL#5665: Removal of the autotools-based build system 2010-11-20 20:56:09 -02:00
my_aes.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_alarm.h Manual merge from 5.1. 2010-07-01 12:06:41 +04:00
my_alloc.h Post-merge fix: header is used by the client API. Obvious in retrospect. 2010-06-05 16:39:03 -03:00
my_atomic.h WL#5498: Remove dead and unused source code 2010-07-23 17:18:36 -03:00
my_attribute.h WL#5498: Remove dead and unused source code 2010-07-23 17:16:29 -03:00
my_base.h Bug#53445: Build with -Wall and fix warnings that it generates 2010-05-31 12:29:54 -03:00
my_bit.h WL#5498: Remove dead and unused source code 2010-07-23 17:18:36 -03:00
my_bitmap.h WL#5498: Remove dead and unused source code 2010-07-23 17:09:27 -03:00
my_compiler.h Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure 2010-11-10 19:14:47 -02:00
my_dbug.h Bug#52172 test binlog.binlog_index needs --skip-core-file to avoid leaving core files 2010-10-18 13:27:52 +02:00
my_dir.h WL#5030: Splitting mysql_priv.h 2010-04-06 14:11:07 +02:00
my_getopt.h Bug#54569 Some options are not allowed to take argument when passed with loose- prefix 2010-10-25 14:30:07 +02:00
my_global.h fix compile error - #if/#endif mismatch 2010-10-05 01:14:16 +02:00
my_handler.h WL#5030: Split and remove mysql_priv.h 2010-03-31 16:05:33 +02:00
my_libwrap.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_list.h Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled 2010-07-08 18:20:08 -03:00
my_md5.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_net.h WL#5498: Remove dead and unused source code 2010-07-23 17:14:35 -03:00
my_no_pthread.h WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
my_nosys.h WL#5498: Remove dead and unused source code 2010-07-23 17:15:07 -03:00
my_pthread.h Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-10-20 12:48:19 -02:00
my_rdtsc.h WL#2373 Use cycle counter for timing 2009-11-24 16:36:31 -07:00
my_stacktrace.h WL#5486: Remove code for unsupported platforms 2010-07-15 08:13:30 -03:00
my_sys.h BUG#57108: mysqld crashes when I attempt to install plugin 2010-11-04 11:00:59 +01:00
my_time.h WL#5486: Remove code for unsupported platforms 2010-07-15 08:28:41 -03:00
my_tree.h WL#5030: Split and remove mysql_priv.h 2010-03-31 16:05:33 +02:00
my_uctype.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_user.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_xml.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
myisam.h merge 2010-08-05 15:34:19 +03:00
myisammrg.h WL#2360 Performance schema 2009-12-04 18:26:15 -07:00
myisampack.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
mysql.h WL#5665: Removal of the autotools-based build system 2010-11-20 20:56:09 -02:00
mysql.h.pp merge 2010-10-04 15:42:16 +03:00
mysql_com.h Implement a fix for Bug#57058 -- send SERVER_QUERY_WAS_SLOW over 2010-11-12 15:56:21 +03:00
mysql_embed.h Bug#57210: remove pstack 2010-11-09 12:45:13 -02:00
mysql_time.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql_version.h.in Bug #15327: configure: --with-tcp-port option being partially ignored 2007-09-13 16:19:46 +02:00
mysys_err.h Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-20 16:30:10 -03:00
password.h WL#5030: Split and remove mysql_priv.h 2010-03-31 16:05:33 +02:00
probes_mysql.d.base Fixing some issues in the build when using DTrace probes 2009-03-18 10:04:15 +00:00
probes_mysql.h Backport of DTrace patches from 6.0 2008-12-20 11:01:41 +01:00
probes_mysql_nodtrace.h Re-adding 'include/probes_mysql_nodtrace.h' removed by accident 2010-02-17 14:37:55 +03:00
queues.h WL#5030: Split and remove mysql_priv.h 2010-03-31 16:05:33 +02:00
rijndael.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
service_versions.h WL#5363: Thread Pool Service Interface 2010-06-07 16:01:39 +02:00
sha1.h merge 2010-10-05 17:27:18 +03:00
sha2.h Post-fix for Bug#13174. 2010-04-13 20:10:51 +04:00
sql_common.h WL#1054: Pluggable authentication support 2010-08-09 11:32:50 +03:00
sslopt-case.h Backport of: 2010-04-13 19:04:45 +04:00
sslopt-longopts.h Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-10 22:30:49 -03:00
sslopt-vars.h Backport of: 2010-04-13 19:04:45 +04:00
t_ctype.h Many files: 2006-12-23 20:17:15 +01:00
thr_alarm.h WL#5161 : Cross-platform build with CMake 2009-11-09 12:32:48 +01:00
thr_lock.h Merging with mysql-5.5-stage. 2010-08-16 14:50:27 +02:00
typelib.h Backport changeset from mysql-next-mr-bugfixing: 2010-07-05 18:20:46 +02:00
violite.h WL#5363: Thread Pool Service Interface 2010-06-07 16:01:39 +02:00
welcome_copyright_notice.h Fix for Bug#57094 (Copyright notice incorrect?). 2010-10-06 19:06:13 +04:00