summaryrefslogtreecommitdiff
path: root/strings
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'Alexander Barkov2015-08-286-36/+42
| | | | | | Note, the patch for MDEV-8661 unintentionally fixed MDEV-8694 as well, as a side effect. Adding a real clear fix: implementing Item_func_like::propagate_equal_fields() with comments.
* Adding MY_CHARSET_HANDLER::native_to_mb().Alexander Barkov2015-08-1416-23/+87
| | | | | | | This is a pre-requisite patch for: - MDEV-8433 Make field<'broken-string' use indexes - MDEV-8625 Bad result set with ignorable characters when using a prefix key - MDEV-8626 Bad result set with contractions when using a prefix key
* MDEV-8362 dash '-' is not recognized in charset armscii8 on select where queryAlexander Barkov2015-07-141-1/+22
|
* MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character"Alexander Barkov2015-07-071-232/+31
|
* Fixing a bug in MDEV-8418 (utf16, utf16le) and MDEV-8417 (utf8mb4).Alexander Barkov2015-07-062-5/+4
| | | | | Fixing non-BMP characters to have the same weight, as it was before MDEV-8418 and MDEV-8417.
* MDEV-8416 ucs2: compare broken bytes as "greater than any non-broken character"Alexander Barkov2015-07-062-454/+125
| | | | MDEV-8418 utf16: compare broken bytes as "greater than any non-broken character"
* MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken ↵Alexander Barkov2015-07-062-145/+43
| | | | character"
* Fixing a typo in the previous commit.Alexander Barkov2015-07-031-1/+1
|
* Adding UTF8 related macros to reduce duplicate code.Alexander Barkov2015-07-031-81/+73
|
* Removing unused code in ctype-utf8.cAlexander Barkov2015-07-031-112/+0
|
* MDEV-8415 utf8: compare broken bytes as "greater than any non-broken character"Alexander Barkov2015-07-032-170/+136
|
* MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any ↵Alexander Barkov2015-07-034-26/+92
| | | | non-broken character"
* Merge tag 'mariadb-10.0.20' into 10.1Sergei Golubchik2015-06-271-1/+1
|\
| * MDEV-8285 compile fails under Mac OS X 10.6.8 due to use of strnlenSergei Golubchik2015-06-141-1/+1
| | | | | | | | #include <m_string.h> where strnlen() is used
* | MDEV-8214 Asian MB2 charsets: compare broken bytes as "greater than any ↵Alexander Barkov2015-06-268-372/+474
| | | | | | | | non-broken character"
* | Merge tag 'mariadb-10.0.19' into 10.1Sergei Golubchik2015-06-012-2/+24
|\ \ | |/
| * Merge branch '5.5' into 10.0Sergei Golubchik2015-05-041-2/+20
| |\
| | * MDEV-7649 wrong result when comparing utf8 column with an invalid literalAlexander Barkov2015-04-241-1/+19
| | |
| * | MDEV-7973 bigint fail with gcc 5.0Sergei Golubchik2015-05-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -LONGLONG_MIN is the undefined behavior in C. longlong2decimal() used to do this: int longlong2decimal(longlong from, decimal_t *to) { if ((to->sign= from < 0)) return ull2dec(-from, to); return ull2dec(from, to); and later in ull2dec() (DIG_BASE is 1000000000): static int ull2dec(ulonglong from, decimal_t *to) { for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {} this breaks in gcc-5 at -O3. Here ull2dec is inlined into longlong2decimal. And gcc-5 believes that 'from' in the inlined ull2dec is always a positive integer (indeed, if it was negative, then -from was used instead). So gcc-5 uses *signed* comparison with DIG_BASE. Fix: make a special case for LONGLONG_MIN, don't negate it
* | | MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" memberAlexander Barkov2015-03-231-2/+11
| | |
* | | MDEV-6650 - LINT_INIT emits code in non-debug buildsSergey Vojtovich2015-03-161-10/+4
| | | | | | | | | | | | | | | Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT. Removed LINT_INIT macro.
* | | Moving the conversion code from String::well_formed_copy()Alexander Barkov2015-03-161-0/+73
| | | | | | | | | | | | to my_convert_fix() - a new function in /strings.
* | | MDEV-6566 Different INSERT behaviour on bad bytes with and without character ↵Alexander Barkov2015-03-1316-103/+569
| | | | | | | | | | | | set conversion
* | | Adding a shared include file ctype-mb.ic and removing a numberAlexander Barkov2015-03-049-353/+184
| | | | | | | | | | | | | | | of very similar copies of my_well_formed_len_xxx(), implemented for big5, cp932, euckr, eucjpms, gb2312m gbk, sjis, ujis.
* | | A preparatory patch for MDEV-6566.Alexander Barkov2015-03-0215-19/+139
| | | | | | | | | | | | | | | | | | Adding a new virtual function MY_CHARSET_HANDLER::copy_abort(). Moving character set specific code into the correspoding implementations (for simple, multi-byte and mbmaxlen>1 character sets).
* | | cleanup: s/const CHARSET_INFO/CHARSET_INFO/Sergei Golubchik2014-12-046-8/+8
|/ / | | | | | | | | as CHARSET_INFO is already const, using const on it is redundant and results in compiler warnings (on Windows)
* | MDEV-7086 main.ctype_cp932 fails in buildbot on a valgrind buildAlexander Barkov2014-11-183-5/+16
| | | | | | | | | | | | Removing a redundant and wrong condition which could access beyond the pattern string range.
* | 5.5.40+ mergeSergei Golubchik2014-10-092-6/+10
|\ \ | |/
| * decimal: *correct* implementation of ROUND_UP at lastSergei Golubchik2014-10-081-1/+1
| |
| * fixes for decimal typeSergei Golubchik2014-10-071-1/+5
| |
| * mysql-5.5.40Sergei Golubchik2014-10-062-5/+5
| |\
| | * Bug #11755818 : LIKE DOESN'T MATCH WHEN CP932_BIN/SJIS_BINmithun2014-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COLLATIONS ARE USED. ISSUE : ------- Code points of HALF WIDTH KATAKANA in SJIS/CP932 range from A1 to DF. In function my_wildcmp_mb_bin_impl while comparing such single byte code points, there is a code which compares signed character with unsigned character. Because of this, comparisons of two same code points representing a HALF WIDTH KATAKANA character always fails. Solution: --------- A code point of HALF WIDTH KATAKANA at-least need 8 bits. Promoting the variable from uchar to int will fix the issue. mysql-test/t/ctype_cp932.test: Tests which have conditions LIKE 'STRING PATTERN WITH HALF WIDTH KATAKANA'. strings/ctype-mb.c: A code point of HALF WIDTH KATAKANA at-least need 8 bits. Promoting the variable from uchar to int will fix the issue.
| | * Bug#18469276: MOD FOR SMALL DECIMALS FAILSChaithra Reddy2014-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: If leading zeroes of fractional part of a decimal number exceeds 45, mod operation on the same fails. Analysis: Currently there is a miscalcultion of fractional part for very small decimals in do_div_mod. For ex: For 0.000(45 times).....3 length of the integer part becomes -5 (for a length of one, buffer can hold 9 digits. Since number of zeroes are 45, integer part becomes 5) and it is negative because of the leading zeroes present in the fractional part. Fractional part is the number of digits present after the point which is 46 and therefore rounded off to the nearest 9 multiple which is 54. So the length of the resulting fractional part becomes 6. Because of this, the combined length of integer part and fractional part exceeds the max length allocated which is 9 and thereby failing. Solution: In case of negative integer value, it indicates there are leading zeroes in fractional part. As a result stop1 pointer should be set not just based on frac0 but also intg0. This is because the detination buffer will be filled with 0's for the length of intg0. strings/decimal.c: Calculate stop1 pointer based on the length of intg0 and frac0.
* | | MDEV-6776 ujis and eucjmps erroneously accept 0x8EA0 as a valid byte sequenceAlexander Barkov2014-09-242-18/+16
| | |
* | | MDEV-6752 Trailing incomplete characters are not replaced to question marks ↵Alexander Barkov2014-09-181-1/+8
| | | | | | | | | | | | on conversion
* | | Cleanup of my_hash_sort patchMichael Widenius2014-09-122-9/+11
| | | | | | | | | | | | | | | strings/ctype-uca.c: HASH needs to be done in opposite order to preserve partitioned tables
* | | MDEV-6255 DUPLICATE KEY Errors on SELECT .. GROUP BY that uses temporary and ↵Michael Widenius2014-09-118-77/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesort. The problem was that my_hash_sort didn't properly delete end-space characters properly, so strings that should compare identically was seen as different strings. (Space was handled correctly, but not NBSP) This caused duplicate key errors when a heap table was converted to Aria as part of overflow in group by. Fixed by removing all characters that compares as end space when creating a hash. Other things: - Fixed that --sorted_results also works for errors in mysqltest. - Speed up hash by not comparing strings that has different hash. - Speed up many my_hash_sort functions by using registers to calculate hash instead of pointers. This was previously done for some functions, but not for all. - Made a macro of the hash function, to simplify code and to be able to experiment with new hash functions. client/mysqltest.cc: Fixed that --sorted_results also works for error messages. mysql-test/r/ctype_partitions.result: New test to ensure that partitions on hash works mysql-test/suite/multi_source/gtid.result: Updated result mysql-test/suite/multi_source/gtid.test: Test that --sorted_result works for error messages mysql-test/suite/multi_source/gtid_ignore_duplicates.result: Updated result mysql-test/suite/multi_source/gtid_ignore_duplicates.test: Updated result mysql-test/suite/multi_source/load_data.result: Updated result mysql-test/suite/multi_source/load_data.test: Updated result mysql-test/t/ctype_partitions.test: New test to ensure that partitions on hash works storage/heap/hp_write.c: Speed up hash by not comparing strings that has different hash. storage/maria/ma_check.c: Extra debug strings/ctype-bin.c: Use macro for hash function strings/ctype-latin1.c: Use macro for hash function Use registers to calculate hash (speedup) strings/ctype-mb.c: Use macro for hash function Use registers to calculate hash (speedup) strings/ctype-simple.c: Use macro for hash function Use same variable names as in other my_hash_sort functions. Update my_hash_sort_simple() to properly remove end space (patch by Bar) strings/ctype-uca.c: Ignore duplicated space inside strings and end space in my_hash_sort_uca(). This fixed MDEV-6255 Use macro for hash function Use registers to calculate hash (speedup) strings/ctype-ucs2.c: Use macro for hash function Use registers to calculate hash (speedup) strings/ctype-utf8.c: Use macro for hash function Use registers to calculate hash (speedup) strings/strings_def.h: Made a macro of the hash function, to simplify code and to be able to experiment with new hash functions.
* | | compilation failure on x86Sergei Golubchik2014-09-071-1/+1
| | |
* | | - MDEV-6695 Bad column name for UCS2 string literalsAlexander Barkov2014-09-041-7/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Item_string constructors called set_name() on the source string, which was wrong because in case of UCS2/UTF16/UTF32 the source value might be a not well formed string (e.g. have incomplete leftmost character). Now set_name() is called on str_value after its copied (with optionally left zero padding) from the source string. - MDEV-6694 Illegal mix of collation with a PS parameter Item_param::convert_str_value() did not set repertoire. Introducing a new structure MY_STRING_METADATA to collect character length and repertoire of a string in a single loop, to avoid two separate loops. Adding a new class Item_basic_value::Metadata as a convenience wrapper around MY_STRING_METADATA, to reuse the code between Item_string and Item_param.
* | | 5.5.39 mergeSergei Golubchik2014-08-075-14/+15
|\ \ \ | |/ /
| * | mysql-5.5.39 mergeSergei Golubchik2014-08-024-8/+9
| |\ \ | | |/ | | | | | | | | | | | | | | | ~40% bugfixed(*) applied ~40$ bugfixed reverted (incorrect or we're not buggy) ~20% bugfixed applied, despite us being not buggy (*) only changes in the server code, e.g. not cmakefiles
| | * Bug#18850241 WRONG COPYRIGHT HEADER IN SOME STRINGS/CTYPE-* FILESErlend Dahl2014-06-233-3/+6
| | |
| | * Backport from trunk:Tor Didriksen2014-05-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#18187290 ISSUE WITH BUILDING MYSQL USING CMAKE 2.8.12 We want to upgrade to VS2013 on Windows. In order to do this, we need to upgrade to cmake 2.8.12 This has introduced some incompatibilities for .pdb files, and "make install" no longer works. To reproduce: cmake --build . --target package --config debug The fix: Rather than installing .pdb files for static libraries, we use the /Z7 flag to store symbolic debugging information in the .obj files.
| | * Bug #17760379 COLLATIONS WITH CONTRACTIONS BUFFER-OVERFLOW THEMSELVES IN THE ↵Venkata Sidagam2014-01-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FOOT Description: A typo in create_tailoring() causes the "contraction_flags" to be written into cs->contractions in the wrong place. This causes two problems: (1) Anyone relying on `contraction_flags` to decide "could this character be part of a contraction" is 100% broken. (2) Anyone relying on `contractions` to determine the weight of a contraction is mostly broken Analysis: When we are preparing the contraction in create_tailoring(), we are corrupting the cs->contractions memory location which is supposed to store the weights(8k) + contraction information(256 bytes). We started storing the contraction information after the 4k location. This is because of logic flaw in the code. Fix: When we create the contractions, we need to calculate the contraction with (char*) (cs->contractions + 0x40*0x40) from ((char*) cs->contractions) + 0x40*0x40. This makes the "cs->contractions" to move to 8k bytes and stores the contraction information from there. Similarly when we are calculating it for like range queries we need to calculate it from the 8k bytes onwards, this can be done by changing the logic to (const char*) (cs->contractions + 0x40*0x40). And for ucs2 charsets we need to modify the my_cs_can_be_contraction_head() and my_cs_can_be_contraction_tail() to point to 8k+ locations.
| * | MDEV-5745 analyze MySQL fix for bug#12368495Alexander Barkov2014-07-281-6/+6
| | |
* | | 5.5 mergeSergei Golubchik2014-05-091-3/+4
|\ \ \ | |/ /
| * | Merge 5.3->5.5Alexander Barkov2014-04-231-4/+5
| |\ \
| | * | MDEV-5338 XML parser accepts malformed dataAlexander Barkov2014-04-231-4/+5
| | | |
| | * | 5.2 mergeSergei Golubchik2014-03-1627-98/+181
| | |\ \
| | | * \ 5.1 mergeSergei Golubchik2014-03-1627-98/+181
| | | |\ \