Commit graph

1331 commits

Author SHA1 Message Date
Alexander Barkov
b2e324a21f MDEV-8416 ucs2: compare broken bytes as "greater than any non-broken character"
MDEV-8418 utf16: compare broken bytes as "greater than any non-broken character"
2015-07-06 15:50:56 +04:00
Alexander Barkov
35d8ac350d MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" 2015-07-06 10:47:39 +04:00
Alexander Barkov
7ab7f5327a Fixing a typo in the previous commit. 2015-07-03 19:08:18 +04:00
Alexander Barkov
fff30e26c3 Adding UTF8 related macros to reduce duplicate code. 2015-07-03 18:40:04 +04:00
Alexander Barkov
aeb8d713f4 Removing unused code in ctype-utf8.c 2015-07-03 17:30:15 +04:00
Alexander Barkov
9ad8ff666c MDEV-8415 utf8: compare broken bytes as "greater than any non-broken character" 2015-07-03 17:24:16 +04:00
Alexander Barkov
95d07ee408 MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character" 2015-07-03 10:33:17 +04:00
Sergei Golubchik
658992699b Merge tag 'mariadb-10.0.20' into 10.1 2015-06-27 20:35:26 +02:00
Alexander Barkov
4f828a1cac MDEV-8214 Asian MB2 charsets: compare broken bytes as "greater than any non-broken character" 2015-06-26 13:40:28 +04:00
Sergei Golubchik
36bf482db1 MDEV-8285 compile fails under Mac OS X 10.6.8 due to use of strnlen
#include <m_string.h> where strnlen() is used
2015-06-14 15:51:34 +02:00
Sergei Golubchik
5091a4ba75 Merge tag 'mariadb-10.0.19' into 10.1 2015-06-01 15:51:25 +02:00
Sergei Golubchik
49c853fb94 Merge branch '5.5' into 10.0 2015-05-04 22:00:24 +02:00
Sergei Golubchik
ae18a28500 MDEV-7973 bigint fail with gcc 5.0
-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
2015-05-04 08:32:27 +02:00
Alexander Barkov
44d1e85fe5 MDEV-7649 wrong result when comparing utf8 column with an invalid literal 2015-04-24 11:00:34 +04:00
Alexander Barkov
ec68494beb MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member 2015-03-23 17:38:55 +04:00
Sergey Vojtovich
18e9c314e4 MDEV-6650 - LINT_INIT emits code in non-debug builds
Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT.
Removed LINT_INIT macro.
2015-03-16 14:48:22 +04:00
Alexander Barkov
f48dc5ccc7 Moving the conversion code from String::well_formed_copy()
to my_convert_fix() - a new function in /strings.
2015-03-16 12:14:31 +04:00
Alexander Barkov
197afb413f MDEV-6566 Different INSERT behaviour on bad bytes with and without character set conversion 2015-03-13 16:51:36 +04:00
Alexander Barkov
a7ed8523e3 Adding a shared include file ctype-mb.ic and removing a number
of very similar copies of my_well_formed_len_xxx(), implemented
for big5, cp932, euckr, eucjpms, gb2312m gbk, sjis, ujis.
2015-03-04 09:16:43 +04:00
Alexander Barkov
b1b6101af2 A preparatory patch for MDEV-6566.
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).
2015-03-02 18:24:22 +04:00
Sergei Golubchik
2ae7541bcf cleanup: s/const CHARSET_INFO/CHARSET_INFO/
as CHARSET_INFO is already const, using const on it
is redundant and results in compiler warnings (on Windows)
2014-12-04 10:41:51 +01:00
Alexander Barkov
807934d083 MDEV-7086 main.ctype_cp932 fails in buildbot on a valgrind build
Removing a redundant and wrong condition which could access beyond
the pattern string range.
2014-11-18 13:07:37 +04:00
Sergei Golubchik
1b75bed00f 5.5.40+ merge 2014-10-09 10:30:11 +02:00
Sergei Golubchik
104771de9a decimal: *correct* implementation of ROUND_UP at last 2014-10-08 00:46:10 +02:00
Sergei Golubchik
d2e808025a fixes for decimal type 2014-10-07 10:53:43 +02:00
Sergei Golubchik
1ddfce4840 mysql-5.5.40 2014-10-06 19:53:55 +02:00
Alexander Barkov
3416facb34 MDEV-6776 ujis and eucjmps erroneously accept 0x8EA0 as a valid byte sequence 2014-09-24 17:27:00 +04:00
Alexander Barkov
8286bcd721 MDEV-6752 Trailing incomplete characters are not replaced to question marks on conversion 2014-09-18 12:40:55 +04:00
Michael Widenius
9276e0e911 Cleanup of my_hash_sort patch
strings/ctype-uca.c:
  HASH needs to be done in opposite order to preserve partitioned tables
2014-09-12 14:45:11 +03:00
Michael Widenius
c4f5326bb7 MDEV-6255 DUPLICATE KEY Errors on SELECT .. GROUP BY that uses temporary and 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.
2014-09-11 22:42:35 +03:00
Sergei Golubchik
bab6dab458 compilation failure on x86 2014-09-07 20:19:29 +02:00
Alexander Barkov
9392d0e280 - MDEV-6695 Bad column name for UCS2 string literals
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.
2014-09-04 21:58:48 +04:00
mithun
f8893dc472 Bug #11755818 : LIKE DOESN'T MATCH WHEN CP932_BIN/SJIS_BIN
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.
2014-08-12 17:16:51 +05:30
Sergei Golubchik
1c6ad62a26 mysql-5.5.39 merge
~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
2014-08-02 21:26:16 +02:00
Alexander Barkov
c57c5be12a MDEV-5745 analyze MySQL fix for bug#12368495 2014-07-28 12:47:14 +04:00
Chaithra Reddy
8ded411057 Bug#18469276: MOD FOR SMALL DECIMALS FAILS
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.
2014-07-03 14:12:02 +05:30
Sergei Golubchik
6fb17a0601 5.5.39 merge 2014-08-07 18:06:56 +02:00
Erlend Dahl
13d4101a39 Bug#18850241 WRONG COPYRIGHT HEADER IN SOME STRINGS/CTYPE-* FILES 2014-06-23 12:11:13 +02:00
Sergei Golubchik
d3e2e1243b 5.5 merge 2014-05-09 12:35:11 +02:00
Tor Didriksen
918837f728 Backport from trunk:
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.
2014-05-07 17:09:14 +02:00
Alexander Barkov
fbfa004327 MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations 2014-04-25 17:10:25 +04:00
Sergei Golubchik
a91c59c2af MDEV-5920 MySQL Bug#16765410 FTS: STACK AROUND THE VARIABLE 'MYSTR' WAS CORRUPTED IN INNOBASE_STRNXFRM 2014-03-26 09:43:02 +01:00
Sergei Golubchik
9ff0c9f730 MDEV-5858 MySQL Bug#12744991 - DECIMAL_ROUND(X,D) GIVES WRONG RESULTS WHEN D == N*(-9)
don't use mysql-5.6 change.
correct fix: zero-out rounded tail after the number was shifted because
of the carry digit (otherwise the carry digit will be zeroed out too).
2014-03-20 09:50:45 +01:00
unknown
f9b3cc11bc MDEV-5819: MySQL Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265 (WARN_DATA_TRUNCATED)
Fix by MySQL ported
2014-03-14 09:31:16 +02:00
Sergey Vojtovich
b95c8ce530 MDEV-5675 - Performance: my_hash_sort_bin is called too often
Reduced number of my_hash_sort_bin() calls from 4 to 1 per query.
Reduced number of memory accesses done by my_hash_sort_bin().

Details:
- let MDL subsystem use pre-calculated hash value for hash
  inserts and deletes
- let table cache use pre-calculated MDL hash value
- MDL namespace is excluded from hash value calculation, so that
  hash value can be used by table cache as is
- hash value for MDL is calculated as resulting hash value + MDL
  namespace
- extended hash implementation to accept user defined hash function
2014-03-06 16:19:12 +04:00
Sergei Golubchik
8dce8ecfda minor cleanup 2014-03-01 10:19:42 +01:00
Alexander Barkov
64d33032a6 Merge 5.3->5.5 2014-04-23 17:43:20 +04:00
Alexander Barkov
a24ea50d1a MDEV-5338 XML parser accepts malformed data 2014-04-23 15:53:47 +04:00
Sergei Golubchik
5d0c01608c 5.2 merge 2014-03-16 21:03:01 +01:00
Sergei Golubchik
e772cbd7b7 5.1 merge 2014-03-16 13:59:44 +01:00