Commit graph

1375 commits

Author SHA1 Message Date
Sergei Golubchik
932646b1ff Merge branch '10.1' into 10.2 2016-06-30 16:38:05 +02:00
Sergei Golubchik
c87e002bbb str2decimal: don't return a negative zero 2016-06-30 11:43:02 +02:00
Sergei Golubchik
da372fb9dc ull2dec: exact calculation of the precision 2016-06-30 11:43:02 +02:00
Sergei Golubchik
23d03a1b1e parse negative numbers into one item
use Item->neg to convert generate negative Item_num's
instead of Item_func_neg(Item_num).

Based on the following commit:

  Author: Monty <monty@mariadb.org>
  Date:   Mon May 30 22:44:00 2016 +0300

    Make negative number their own token
    The negation (-) operator will call Item->neg() one underlying numeric constants
    and remove itself (like the NOT() function does today for other NOT functions.

    This simplifies things
    - -1 is not anymore an expression but a basic_const_item
      - improves optimizer
      - DEFAULT -1 doesn't need special handling anymore
      - When we add DEFAULT expressions, -1 will be treated exactly like 1
    - printing of items doesn't anymore put braces around all negative numbers

    Other things fixed:
    - Fixed that longlong converted to decimal's has a more appropriate size
    - Fixed that "-0.0" read into a decimal is interpreted as 0.0
2016-06-30 11:43:02 +02:00
Monty
4dc5075860 Fixed compiler warnings and test failures found by buildbot
Fixed ccfilter to detect errors where the column is included in the error message
2016-06-24 02:25:14 +03:00
Alexander Barkov
25e68c5e46 MDEV-8686 A user defined collation utf8_confusables doesn't work
The collation customization code for the UCA (Unicode Collation Alrorithm)
based collations now allows to reset to and shift of characters with
implicit weights. Previously reset/shift worked only for the characters
with explicit DUCET weights. An attempt to use reset/shift with
character with implicit weights made the server crash.
2016-06-23 14:25:48 +04:00
Monty
34eb10e406 MDEV-10138 Support for decimals up to 38 digits
Decimals with float, double and decimal now works the following way:

- DECIMAL_NOT_SPECIFIED is used when declaring DECIMALS without a firm number
  of decimals.  It's only used in asserts and my_decimal_int_part.
- FLOATING_POINT_DECIMALS (31) is used to mark that a FLOAT or DOUBLE
  was defined without decimals. This is regarded as a floating point value.
- Max decimals allowed for FLOAT and DOUBLE is FLOATING_POINT_DECIMALS-1
- Clients assumes that float and double with decimals >= NOT_FIXED_DEC are
  floating point values (no decimals)
- In the .frm decimals=FLOATING_POINT_DECIMALS are used to define
  floating point for float and double (31, like before)

To ensure compatibility with old clients we do:

- When storing float and double, we change NOT_FIXED_DEC to
  FLOATING_POINT_DECIMALS.
- When creating fields from .frm we change for float and double
  FLOATING_POINT_DEC to NOT_FIXED_DEC
- When sending definition for a float/decimal field without decimals
  to the client as part of a result set we convert NOT_FIXED_DEC to
  FLOATING_POINT_DECIMALS.
- variance() and std() has changed to limit the decimals to
  FLOATING_POINT_DECIMALS -1 to not get the double converted floating point.
  (This was to preserve compatiblity)
- FLOAT and DOUBLE still have 30 as max number of decimals.

Bugs fixed:

variance() printed more decimals than we support for double values.

New behaviour:
- Strings now have 38 decimals instead of 30 when converted to decimal
- CREATE ... SELECT with a decimal with > 30 decimals will create a column
  with a smaller range than before as we are trying to preserve the number of
  decimals.


Other changes
- We are now using the obsolete bit FIELDFLAG_LEFT_FULLSCREEN to specify
  decimals > 31
- NOT_FIXED_DEC is now declared in one place
- For clients, NOT_FIXED_DEC is always 31 (to ensure compatibility).
  On the server NOT_FIXED_DEC is DECIMAL_NOT_SPECIFIED (39)
- AUTO_SEC_PART_DIGITS is taken from DECIMAL_NOT_SPECIFIED
- DOUBLE conversion functions are now using DECIMAL_NOT_SPECIFIED instead of
  NOT_FIXED_DEC
2016-06-22 22:04:55 +03:00
Alexander Barkov
63120090f9 MDEV-10262 ucs2_thai_520_w2: wrong implicit weights on the secondary level 2016-06-21 21:36:23 +04:00
Otto Kekäläinen
effbe7dd7b General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
Alexander Barkov
bc546225c0 Adding collations
utf8mb4_thai_520_w2, ucs2_thai_520_w2, utf16_thai_520_w2, utf32_thai_520_w2
2016-05-30 16:56:29 +04:00
Alexander Barkov
29db3b5e5c Clean-ups for MDEV-10132 utf8_thai_520_w2 collation:
- Changing strnxfrm_multiply from 8 to 4, as agreed with Pruet Boonma
- Adjusting tests
2016-05-26 22:56:28 +04:00
pruet
fb35b9ad07 Multi-level collation in UCA, Thai sorting with contraction for UTF8. 2016-05-26 16:45:50 +07:00
Alexander Barkov
9c9747fed3 Updating uca-dump.c to be able to dump weights outside of BMP. 2016-05-18 12:35:38 +04:00
Alexander Barkov
e7ff281d2e MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring 2016-05-17 15:27:10 +04:00
Alexander Barkov
d516a2ae0c MDEV-9823 LOAD DATA INFILE silently truncates incomplete byte sequences 2016-04-06 09:13:49 +04:00
Alexander Barkov
38f39a9288 Updating conf_to_src.c according to the current CHARSET_INFO structure. 2016-04-05 09:35:27 +04:00
Alexander Barkov
1d73005bf3 MDEV-8360 Clean-up CHARSET_INFO: strnncollsp: diff_if_only_endspace_difference
- Removing the "diff_if_only_endspace_difference" argument from
  MY_COLLATION_HANDLER::strnncollsp(), my_strnncollsp_simple(),
  as well as in the function template MY_FUNCTION_NAME(strnncollsp)
  in strcoll.ic

- Removing the "diff_if_only_space_different" from ha_compare_text(),
  hp_rec_key_cmp().

- Adding a new function my_strnncollsp_padspace_bin() and reusing
  it instead of duplicate code pieces in my_strnncollsp_8bit_bin(),
  my_strnncollsp_latin1_de(), my_strnncollsp_tis620(),
  my_strnncollsp_utf8_cs().

- Adding more tests for better coverage of the trailing space handling.

- Removing the unused definition of HA_END_SPACE_ARE_EQUAL
2016-03-31 11:04:48 +04:00
Alexander Barkov
3be95ee061 Removing my_strnncoll_mb_bin() and my_strnncollsp_mb_bin(),
as they are not used any more.
We now use function templates from strcoll.ic instead.
2016-03-25 06:42:44 +04:00
Sergei Golubchik
f67a2211ec Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
Alexander Barkov
0a83caf4a9 Removing duplicate code: sharing implementation of "strnxfrm"
between gbk_chinese_ci and big5_chinese_ci.
2016-03-23 14:26:43 +04:00
Alexander Barkov
0d42d4e9e0 Removing unused code in ctype-bin5.c 2016-03-23 12:44:31 +04:00
Alexander Barkov
1170d23ca3 Fixing compilation warnings introduced in:
> commit e09299511e
> Author: Alexander Barkov <bar@mariadb.org>
> Date:   Wed Mar 16 10:55:12 2016 +0400
>
>     MDEV-9665 Remove cs->cset->ismbchar()
>     Using a more powerfull cs->cset->charlen() instead.
2016-03-23 12:37:19 +04:00
Sergei Golubchik
3b0c7ac1f9 Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
Alexander Barkov
e09299511e MDEV-9665 Remove cs->cset->ismbchar()
Using a more powerfull cs->cset->charlen() instead.
2016-03-16 10:55:12 +04:00
Otto Kekäläinen
1777fd5f55 Fix spelling: occurred, execute, which etc 2016-03-04 02:09:37 +02:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Alexander Barkov
ff2d92b17d MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.ROUTINES
contains broken procedure body when used shielding quotes inside.
2016-02-24 13:12:03 +04:00
Monty
d80b8442a6 Fixes needed to compile with musl C library
Patch originally by Codarren Velvindron
2016-02-07 15:00:30 +02:00
Alexander Barkov
98b6026036 Adding "const" qualifier to the argument of decimal_actual_fraction(). 2016-01-14 17:23:23 +04:00
Sergei Golubchik
a2bcee626d Merge branch '10.0' into 10.1 2015-12-21 21:24:22 +01:00
Alexander Barkov
82bec8bfdf MDEV-9265 SuSE patches: Suspicious implicit sign extension 2015-12-15 11:04:51 +04:00
Alexander Barkov
af3c67056d MDEV-9265 SuSE patches: Suspicious implicit sign extension 2015-12-15 10:57:28 +04:00
Sergei Golubchik
1623995158 Merge branch '5.5' into 10.0 2015-12-13 00:10:40 +01:00
Oleksandr Byelkin
fa25921b59 MDEV-8407 Numeric errors, server crash with COLUMN_JSON() on DECIMAL with precision > 40
In fact it was error in decimal library (incorrect processing of buffer overflow) invisible from other server parts because of buffer allocation and precision tests.
2015-12-10 11:22:53 +01:00
Jan Lindström
d85168e40d Correct length check in my_wc_mb_filename() 2015-12-07 09:20:31 +02:00
Alexander Barkov
310c718cff MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
Also, fixing compilation warnings in ctype-mb.ic (Windows).
2015-11-24 22:47:42 +04:00
Sergei Golubchik
dfb74dea30 Merge branch '10.0' into 10.1 2015-10-12 00:37:58 +02:00
Alexander Barkov
d9b25ae3db MDEV-8466 CAST works differently for DECIMAL/INT vs DOUBLE for empty strings
MDEV-8468 CAST and INSERT work differently for DECIMAL/INT vs DOUBLE for a string with trailing spaces
2015-09-17 11:05:07 +04:00
Oleksandr Byelkin
0ce0b88080 MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client()
Expression in macro protected by ()
2015-09-06 22:26:33 +02:00
Alexander Barkov
3ba2a958be MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
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.
2015-08-28 17:03:09 +04:00
Alexander Barkov
78b80cb6ba Adding MY_CHARSET_HANDLER::native_to_mb().
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
2015-08-14 18:34:41 +04:00
Alexander Barkov
75931feabe MDEV-8362 dash '-' is not recognized in charset armscii8 on select where query 2015-07-14 12:00:05 +04:00
Alexander Barkov
e4f8cea356 MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character" 2015-07-07 09:15:58 +04:00
Alexander Barkov
3a606ba210 Fixing a bug in MDEV-8418 (utf16, utf16le) and MDEV-8417 (utf8mb4).
Fixing non-BMP characters to have the same weight, as it was before
MDEV-8418 and MDEV-8417.
2015-07-06 18:59:33 +04:00
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