Commit graph

1423 commits

Author SHA1 Message Date
Alexey Botchkov
bb71d9abf2 MDEV-12604 Comparison of JSON_EXTRACT result differs with Mysql.
Comparison fixed to take the actual type of JSON value into
        account. Bug in escaping handling fixed.
2017-08-08 10:35:26 +04:00
Alexey Botchkov
f701ac65e9 MDEV-12324 Wrong result (phantom array value) on JSON_EXTRACT.
Fixed the path comparison.
2017-08-07 13:46:45 +04:00
Marko Mäkelä
8f643e2063 Merge 10.1 into 10.2 2017-05-23 11:09:47 +03:00
Marko Mäkelä
b61700c221 Merge 10.0 into 10.1 2017-05-23 08:59:03 +03:00
Marko Mäkelä
70505dd45b Merge 10.1 into 10.2 2017-05-22 09:46:51 +03:00
Sergei Golubchik
7c03edf2fe MDEV-6262 analyze the coverity report on mariadb
uploaded 10.0, analyzed everything with the Impact=High
(and a couple of Medium)
2017-05-19 20:26:56 +02:00
Marko Mäkelä
71cd205956 Silence bogus GCC 7 warnings -Wimplicit-fallthrough
Do not silence uncertain cases, or fix any bugs.

The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
2017-05-17 08:27:04 +03:00
Marko Mäkelä
7972da8aa1 Silence bogus GCC 7 warnings -Wimplicit-fallthrough
Do not silence uncertain cases, or fix any bugs.

The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
2017-05-17 08:07:02 +03:00
Alexey Botchkov
4a484e7a20 MDEV-12351 Assertion `cur_step->type & JSON_PATH_KEY' failed in
json_find_path.

        The ..[0] path can be treated wrong on second json_find_path
        call.
2017-05-02 15:16:01 +04:00
Sergei Golubchik
da4d71d10d Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
Alexey Botchkov
7c7c0696e7 MDEV-11856 json_search doesn't search for values with double quotes
character (").

        The my_wildcmp function doesn't expect the string parameter to
        have escapements, only the template. So the string
        should be unescaped if necessary.
2017-03-14 15:25:02 +04:00
Vladislav Vaintroub
f2fe5cb282 Fix several compile warnings on Windows 2017-03-10 19:07:07 +00:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergei Golubchik
5d40ed864e MDEV-11752 Unsafe strmov - function definition in include/m_string.h
assert that strmov() cannot be used on overlapping strings.
(because strpcpy cannot)
2017-03-10 18:21:29 +01:00
Alexey Botchkov
25aaecb240 MDEV-11858 json_merge() concatenates instead of merging.
Fix json_merge implementation.
2017-02-10 01:05:27 +04:00
Alexey Botchkov
0e6968c244 MDEV-11857 json_search() shows "Out of memory" with empty key.
We should be ready for an empty key.
2017-02-09 17:38:53 +04:00
Alexey Botchkov
abf7582112 MDEV-11557 port MySQL-5.7 JSON tests to MariaDB.
Fixes for issues found.
2017-02-06 06:47:48 +04:00
Alexey Botchkov
d123ed852a MDEV-11938 json.json_no_table crashes or fails with valgrind warnings in json_find_path / Item_func_json_length::val_int.
Paths with quoted keynames handled improperly.
2017-02-02 18:56:15 +04:00
Alexey Botchkov
d96ee168a1 MDEV-11557 port MySQL-5.7 JSON tests to MariaDB.
paths ending on [0]..[0] should be handled in conforming manner.
2017-01-26 16:35:05 +04:00
Alexey Botchkov
50831b0f19 MDEV-11557 port MySQL-5.7 JSON tests to MariaDB.
json_no_table.test ported.
2017-01-24 17:34:44 +04:00
Alexey Botchkov
0d107a85b3 MDEV-11042 Implement GeoJSON functions.
ST_AsGeoJSON and ST_GeomFromGeoJSON functions implemented.
2017-01-24 02:29:04 +04:00
Sergei Golubchik
4a5d25c338 Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
Alexey Botchkov
4d10273b4f MDEV-11571 JSON_EXTRACT returns wrong results.
Array counter didn't increment after an item was found.
2016-12-24 10:51:43 +04:00
Alexey Botchkov
e5377be211 MDEV-11562 Assertion `js->state == JST_VALUE' failed in check_contains(json_engine_t*, json_engine_t*).
check_contains() fixed. When an item of an array is a complex
        structure, it can be half-read after the end of the recursive
        check_contains() call. So we just manually get to it's ending.
2016-12-16 12:32:56 +04:00
Alexey Botchkov
d26b9f670d MDEV-11470 JSON_KEYS accepts arguments in invalid format.
Now JSON functions return warnings if arguments are invalid.
2016-12-13 12:39:48 +04:00
Sergei Golubchik
46ae210422 cleanup: my_strerror 2016-12-12 20:27:29 +01:00
Sergei Golubchik
2f20d297f8 Merge branch '10.0' into 10.1 2016-12-11 09:53:42 +01:00
Alexey Botchkov
9320d8ae30 MDEV-11453 JSON_CONTAINS returns incorrect values.
The weird logic of json_contains was implemented.
2016-12-11 01:12:33 +04:00
Sergei Golubchik
3e8155c637 Merge branch '5.5' into 10.0 2016-12-09 16:33:48 +01:00
Alexey Botchkov
04aa31c70b MDEV-11469 JSON_SEARCH returns incorrect results.
Support for '**' in json path expressions added.
2016-12-09 12:26:32 +04:00
Sergei Golubchik
02d153c7b9 str2decimal: don't return a negative zero 2016-12-05 10:28:20 +01:00
Alexey Botchkov
78dc7c3a6e MDEV-11461 JSON_TYPE does not recognize integer/double types.
Integer/Double recognition added.
2016-12-05 01:03:31 +04:00
Alexey Botchkov
7fca133028 MDEV-11463 Server crashes in mark_array upon JSON_VALID.
The depth of nested arrays should be controlled, as it's limited.
2016-12-03 12:36:10 +04:00
kevg
780db8e252 fix build and some warnings 2016-11-24 17:36:02 +03:00
Alexander Barkov
1d8eafbeaf Removing the unused function my_bincmp() from strings/ctype-ucs2.c 2016-11-24 15:55:55 +04:00
Alexey Botchkov
ebe5ebba16 MDEV-9143 JSON_xxx functions.
The rest of mysql/json functions implemented.
        CAST AS JSON implemented.
2016-11-15 17:04:31 +04:00
Alexander Barkov
0259b3cbbe MDEV-11255 LDML: allow defining 2-level UCA collations 2016-11-08 20:57:19 +04:00
Alexey Botchkov
27025221fe MDEV-9143 JSON_xxx functions.
strings/json_lib.c added as a JSON library.
        SQL frunction added with sql/item_jsonfunc.h/cc
2016-10-19 14:10:03 +04:00
Alexander Barkov
5058ced5df MDEV-7769 MY_CHARSET_INFO refactoring# On branch 10.2
Part 3 (final): removing MY_CHARSET_HANDLER::well_formed_len().
2016-10-10 14:36:09 +04:00
Sergei Golubchik
66d9696596 Merge branch '10.0' into 10.1 2016-09-28 17:55:28 +02:00
Sergei Golubchik
77ce4ead81 Merge branch '5.5' into 10.0 2016-09-27 09:21:19 +02:00
Alexander Barkov
0f8a1a314d MDEV-10877 xxx_unicode_nopad_ci collations 2016-09-23 14:19:07 +04:00
Sergei Golubchik
a229091953 potential signedness issue
different fix for 07a33cdcef:

Bug #23296299 : HANDLE_FATAL_SIGNAL (SIG=11) IN MY_TOSORT_UTF32
2016-09-12 16:41:54 +02:00
Alexander Barkov
ee19806b8e MDEV-9711 NO PAD collations
Based on the patch from Daniil Medvedev (a Google Summer of Code task)
2016-09-06 12:50:02 +04:00
Alexander Barkov
e4f6fd5e12 MDEV-10743 LDML: a new syntax to reuse sort order from another 8bit simple collation 2016-09-06 12:37:11 +04:00
Alexander Barkov
9e89e117f9 MDEV-10742 LDML: make conf_to_src reuse common data between collations 2016-09-05 10:03:10 +04:00
Alexander Barkov
1ca595fbf7 LDML refactoring for "MDEV-9711 NO PAD collations"
- Moving detection of the MY_CS_CSSORT, MY_CS_PUREASCII, MY_CS_NONASCII
  flags of loadable collations from add_collation() in mysys.c
  to my_cset_init_8bit() and my_coll_init_simple() in ctype-simple.c.

- Adding tests that these flags are set properly for loadable collations

- Moving LDML test related *.xml files from mysql-test/std_data/
  to mysql-test/std_data/ldml/, as there will be more *.xml test files
2016-09-03 09:05:56 +04:00
Sergei Golubchik
e81455bb16 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
2016-07-06 15:17:38 +04:00
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