summaryrefslogtreecommitdiff
path: root/strings
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-24790 CAST('0e1111111111' AS DECIMAL(38,0)) returns a wrong resultAlexander Barkov2021-02-081-4/+59
|
* ucs2: cppcheck - add va_endbb-10.2-danielblack-cppcheckDaniel Black2021-01-211-2/+8
|
* MDEV-22387: Do not violate __attribute__((nonnull))Marko Mäkelä2020-11-022-4/+6
| | | | | | | | | | | This follows up commit commit 94a520ddbe39ae97de1135d98699cf2674e6b77e and commit 7c5519c12d46ead947d341cbdcbb6fbbe4d4fe1b. After these changes, the default test suites on a cmake -DWITH_UBSAN=ON build no longer fail due to passing null pointers as parameters that are declared to never be null, but plenty of other runtime errors remain.
* MDEV-23941: strings/json_lib.c:893:12: style: Suspicious conditionVicențiu Ciorbaru2020-10-231-1/+1
| | | | | | | | | | The characters parsed are always ascii characters, hence one byte. This means that the code did not have "incorrect" logic because the boolean condition, if true, would also evaluate to the value of 1. The condition however is semantically wrong, assuming a length is equal to the condition outcome. Change paranthesis to make it also read according to the intent.
* MDEV-22387: Do not violate __attribute__((nonnull))Marko Mäkelä2020-09-231-2/+4
| | | | | | | Passing a null pointer to a nonnull argument is not only undefined behaviour, but it also grants the compiler the permission to optimize away further checks whether the pointer is null. GCC -O2 at least starting with version 8 may do that, potentially causing SIGSEGV.
* Fix GCC 10.2.0 -Og -Wmaybe-uninitializedMarko Mäkelä2020-08-111-1/+1
| | | | | | For some reason, GCC emits more -Wmaybe-uninitialized warnings when using the flag -Og than when using -O2. Many of the warnings look genuine.
* Merge 10.1 into 10.2Marko Mäkelä2020-08-101-0/+18
|\
| * MDEV-23105 Cast number string with many leading zeros to decimal gives ↵Alexander Barkov2020-08-051-0/+18
| | | | | | | | | | | | unexpected result Skip leading zeros when converting a string to decimal_t.
* | MDEV-20377: Make WITH_MSAN more usableMarko Mäkelä2020-07-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemorySanitizer (clang -fsanitize=memory) requires that all code be compiled with instrumentation enabled. The only exception is the C runtime library. Failure to use instrumented libraries will cause bogus messages about memory being uninitialized. In WITH_MSAN builds, we must avoid calling getservbyname(), because even though it is a standard library function, it is not instrumented, not even in clang 10. Note: Before MariaDB Server 10.5, ./mtr will typically fail due to the old PCRE library, which was updated in MDEV-14024. The following cmake options were tested on 10.5 in commit 94d0bb4dbeb28a94d1f87fdd55f4297ff3df0157: cmake \ -DCMAKE_C_FLAGS='-march=native -O2' \ -DCMAKE_CXX_FLAGS='-stdlib=libc++ -march=native -O2' \ -DWITH_EMBEDDED_SERVER=OFF -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug \ -DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF \ -DPLUGIN_{ARCHIVE,TOKUDB,MROONGA,OQGRAPH,ROCKSDB,CONNECT,SPIDER}=NO \ -DWITH_SAFEMALLOC=OFF \ -DWITH_{ZLIB,SSL,PCRE}=bundled \ -DHAVE_LIBAIO_H=0 \ -DWITH_MSAN=ON MEM_MAKE_DEFINED(): An alias for VALGRIND_MAKE_MEM_DEFINED() and __msan_unpoison(). MEM_GET_VBITS(), MEM_SET_VBITS(): Aliases for VALGRIND_GET_VBITS(), VALGRIND_SET_VBITS(), __msan_copy_shadow(). InnoDB: Replace the UNIV_MEM_ macros with corresponding MEM_ macros. ut_crc32_8_hw(), ut_crc32_64_low_hw(): Use the compiler built-in functions instead of inline assembler when building WITH_MSAN. This will require at least -msse4.2 when building for IA-32 or AMD64. The inline assembler would not be instrumented, and would thus cause bogus failures.
* | MDEV-22849 Reuse skip_trailing_space() in my_hash_sort_utf8mbXAlexander Barkov2020-06-101-15/+11
| | | | | | | | | | | | | | | | | | | | | | Replacing the slow loop in my_hash_sort_utf8mbX() to the fast skip_trailing_spaces(), which consumes 8 bytes in one iteration, and is around 8 times faster on long data. Also, renaming: - my_hash_sort_utf8() to my_hash_sort_utf8mb3() - my_hash_sort_utf8_nopad() to my_hash_sort_utf8mb3_nopad() to merge to 10.5 easier (automatically?).
* | MDEV-22545: my_vsnprintf behaves not as in C standardOleksandr Byelkin2020-05-241-20/+35
| | | | | | | | Added parameter %T for string which should be visibly truncated.
* | MDEV-20604: Duplicate key value is silently truncated to 64 characters in ↵Oleksandr Byelkin2020-04-011-5/+61
| | | | | | | | | | | | print_keydup_error Added indication of truncated string for "s" and "M" formats
* | Merge 10.1 into 10.2Marko Mäkelä2019-12-232-6/+14
|\ \ | |/
| * Merge remote-tracking branch 'origin/5.5' into 10.1Alexander Barkov2019-12-162-6/+14
| |\
| | * MDEV-21065 UNIQUE constraint causes a query with string comparison to omit a ↵Alexander Barkov2019-12-162-6/+14
| | | | | | | | | | | | row in the result set
* | | Merge 10.1 into 10.2Marko Mäkelä2019-10-251-4/+14
|\ \ \ | |/ /
| * | Merge branch 'github/5.5' into 10.1Sergei Golubchik2019-10-231-4/+14
| |\ \ | | |/
| | * crash in string-to-int conversionSergei Golubchik2019-10-191-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | using a specially crafted strings one could overflow `shift` variable and cause a crash by dereferencing d10[-2147483648] (on a sufficiently old gcc). This is a correct fix and a test case for Bug #29723340: MYSQL SERVER CRASH AFTER SQL QUERY WITH DATA ?AST
* | | Merge 10.1 into 10.2Marko Mäkelä2019-05-1337-38/+38
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-1135-36/+36
| |\ \ | | |/
| | * Update FSF AddressVicențiu Ciorbaru2019-05-1134-35/+35
| | | | | | | | | | | | * Update wrong zip-code
| * | Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-112-2/+2
| |\ \ | | |/
| | * Update FSF addressMichal Schorm2019-05-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on the work of Michal Schorm, rebased on the earliest MariaDB version. Th command line used to generate this diff was: find ./ -type f \ -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \ -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
| * | Remove unused declarationsMarko Mäkelä2019-04-031-30/+1
| | |
* | | post-merge: -Werror fixes in 10.2Sergei Golubchik2019-03-291-2/+2
| | |
* | | MDEV-17454 JSON_VALID( '{"a":1]' ) evaluates to 1.Alexey Botchkov2018-11-121-1/+1
| | | | | | | | | | | | Produce syntax error when '{...]'.
* | | Merge 10.1 into 10.2Marko Mäkelä2018-11-064-100/+101
|\ \ \ | |/ /
| * | Merge 10.0 into 10.1Marko Mäkelä2018-11-051-2/+2
| |\ \
| | * | MDEV-17298 ASAN unknown-crash / READ of size 1 in my_strntoul_8bit upon ↵Alexander Barkov2018-10-311-2/+2
| | | | | | | | | | | | | | | | INSERT .. SELECT
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-10-311-16/+19
| |\ \ \ | | |/ /
| | * | Merge branch '5.5' into 10.0Sergei Golubchik2018-10-311-16/+19
| | |\ \ | | | |/
| | | * MDEV-17256 Decimal field multiplication bug.bb-5.5-hfAlexey Botchkov2018-10-301-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | We should clear trailing zeroes in frac part. Otherwise that tail is growing quickly and forces unnecessary truncating of arguments.
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-10-302-82/+80
| |\ \ \ | | |/ /
| | * | MDEV-17064 LIKE function has error behavior on the fields in which the ↵Alexander Barkov2018-10-152-82/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | collation is xxx_unicode_xx Synchronizing sources in: - my_wildcmp_uca_impl() handling utf8_unicode_ci - my_wildcmp_unicode_impl() handling utf8_general_ci The latter has already had a fix for a similar MySQL bug in utf8_general_ci: Bug#11754 SET NAMES utf8 followed by SELECT "A\\" LIKE "A\\" returns 0 So fix is now propagated to utf8_unicode_ci.
* | | | MDEV-17001 JSON_MERGE returns nullwhen merging empty array.Alexey Botchkov2018-09-131-4/+0
| | | | | | | | | | | | | | | | Don't add the comma if nothing appended to the array.
* | | | MDEV-17121 JSON_ARRAY_APPEND.Alexey Botchkov2018-09-111-0/+25
| | | | | | | | | | | | | | | | Extra comma added to the result when an json array is empty.
* | | | Merge 10.1 into 10.2Marko Mäkelä2018-08-027-152/+88
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into bb-10.1-merge-sanjaOleksandr Byelkin2018-07-257-152/+88
| |\ \ \ | | |/ /
| | * | Simplify caseup() and casedn() in charsetsAlexander Barkov2018-07-197-152/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the MDEV-13118 fix there's no code in the server that wants caseup/casedn to change the argument in place for simple charsets. Let's remove this logic and always return the result in a new string for all charsets, both simple and complex. 1. Removing the optimization that *some* character sets used in casedn() and caseup(), which allowed (and required) to change the case in-place, overwriting the string passed as the "src" argument. Now all CHARSET_INFO's work in the same way: non of them change the source string in-place, all of them now convert case from the source string to the destination string, leaving the source string untouched. 2. Adding "const" qualifier to the "char *src" parameter to caseup() and casedn(). 3. Removing duplicate implementations in ctype-mb.c. Now both caseup() and casedn() implementations for all CJK character sets use internally the same function my_casefold_mb() (the former my_casefold_mb_varlen()). 4. Removing the "unused" attribute from parameters of some my_case{up|dn}_xxx() implementations, as the affected parameters are now *used* in the code. Previously these parameters were used only in DBUG_ASSERT().
* | | | MDEV-16054 simple json functions flatline cpu on garbage input.Alexey Botchkov2018-07-311-0/+2
| | | | | | | | | | | | | | | | Incorrect char sentence should be handled properly.
* | | | MDEV-15561 json_extract returns NULL with numbers in scientific notation.Alexey Botchkov2018-03-251-2/+2
| | | | | | | | | | | | | | | | Scientific notation handling fixed.
* | | | MDEV-15420 Wrong result for CAST from TIME or DATETIME with zero integer ↵Alexander Barkov2018-02-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | part and non-zero microseconds to DECIMAL(X,Y) The loop in ull2dec() does not iterate if "from" is zero, so to->intg got erroneously set to 0 instead of 1. Because if this, my_decimal2seconds() wrote the fractional part into a wrong buf[x]. Catching the special case with zero "from" and properly initialize "to" using decimal_make_zero().
* | | | Fix and reenable Windows compiler warning C4800 (size_t conversion).Vladislav Vaintroub2018-01-268-27/+27
| | | |
* | | | Merge remote-tracking branch 'origin/10.1' into 10.2Vladislav Vaintroub2018-01-061-1/+2
|\ \ \ \ | |/ / /
| * | | Fix conf_to_src build.Vladislav Vaintroub2018-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2cd316911309e3db4007aa224f7874bfbeb14032 broke conf_to_src, because strings library is now dependend on mysys (my_alloc etc are used now directly in string lib) Fix by adding appropriate dependency. Also exclude conf_to_src from VS IDE builds. EXCLUDE_FROM_ALL is not enough for that.
* | | | Merge remote-tracking branch 'origin/10.1' into 10.2Vicențiu Ciorbaru2017-12-225-53/+13
|\ \ \ \ | |/ / /
| * | | MDEV-14265 - RPMLint warning: shared-lib-calls-exitSergey Vojtovich2017-12-195-53/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find_type_or_exit() client helper did exit(1) on error, exit(1) moved to clients. mysql_read_default_options() did exit(1) on error, error is passed through and handled now. my_str_malloc_default() did exit(1) on error, replaced my_str_ allocator functions with normal my_malloc()/my_realloc()/my_free(). sql_connect.cc did many exit(1) on hash initialisation failure. Removed error check since my_hash_init() never fails. my_malloc() did exit(1) on error. Replaced with abort(). my_load_defaults() did exit(1) on error, replaced with return 2. my_load_defaults() still does exit(0) when invoked with --print-defaults.
* | | | MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern ↵Alexander Barkov2017-12-082-7/+7
| | | | | | | | | | | | | | | | with wrong results
* | | | MDEV-13971 crash in skip_num_constant.Alexey Botchkov2017-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | Character bigger than 0x60 wasn't handled properly inside a numeric constant.
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-10-242-8/+3
|\ \ \ \ | |/ / /