mariadb/mysys
Monty 4e9322e2ff MDEV-32203 Raise notes when an index cannot be used on data type mismatch
Raise notes if indexes cannot be used:
- in case of data type or collation mismatch (diferent error messages).
- in case if a table field was replaced to something else
  (e.g. Item_func_conv_charset) during a condition rewrite.

Added option to write warnings and notes to the slow query log for
slow queries.

New variables added/changed:

- note_verbosity, with is a set of the following options:
  basic            - All old notes
  unusable_keys    - Print warnings about keys that cannot be used
                     for select, delete or update.
  explain          - Print unusable_keys warnings for EXPLAIN querys.

The default is 'basic,explain'. This means that for old installations
the only notable new behavior is that one will get notes about
unusable keys when one does an EXPLAIN for a query. One can turn all
of all notes by either setting note_verbosity to "" or setting sql_notes=0.

- log_slow_verbosity has a new option 'warnings'. If this is set
  then warnings and notes generated are printed in the slow query log
  (up to log_slow_max_warnings times per statement).

- log_slow_max_warnings   - Max number of warnings written to
                            slow query log.

Other things:
- One can now use =ALL for any 'set' variable to set all options at once.
  For example using "note_verbosity=ALL" in a config file or
  "SET @@note_verbosity=ALL' in SQL.
- mysqldump will in the future use @@note_verbosity=""' instead of
  @sql_notes=0 to disable notes.
- Added "enum class Data_type_compatibility" and changing the return type
  of all Field::can_optimize*() methods from "bool" to this new data type.

Reviewer & Co-author: Alexander Barkov <bar@mariadb.com>
- The code that prints out the notes comes mainly from Alexander
2023-10-03 08:25:31 +03:00
..
crc32 Remove unused header from crc32c.cc 2022-02-24 19:41:00 +11:00
array.c Merge 10.5 into 10.6 2023-01-10 13:54:17 +02:00
base64.c
ChangeLog
charset-def.c MDEV-26669 Add MY_COLLATION_HANDLER functions min_str() and max_str() 2021-09-27 17:10:22 +04:00
charset.c Merge 10.5 into 10.6 2023-02-10 13:03:01 +02:00
CMakeLists.txt Merge 10.5 into 10.6 2021-10-21 16:06:34 +03:00
crc32ieee.cc MDEV-24745 Generic CRC-32C computation wrongly uses SSE4.2 instructions 2021-04-13 16:15:15 +03:00
errors.c MDEV-7947 strcmp() takes 0.37% in OLTP RO 2020-07-23 10:54:33 +03:00
file_logger.c Merge 10.4 into 10.5 2021-03-05 12:54:43 +02:00
get_password.c Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
guess_malloc_library.c
hash.c Fix synopses in mysys APIs 2023-01-06 07:20:37 +11:00
lf_alloc-pin.c Merge commit '10.4' into 10.5 2023-07-20 11:54:52 +02:00
lf_dynarray.c
lf_hash.cc MDEV-27088: Server crash on ARM (WMM architecture) due to missing barriers in lf-hash (10.5) 2021-11-30 15:16:16 +11:00
list.c Merge 10.4 into 10.5 2020-05-13 14:25:06 +03:00
ma_dyncol.c Added typedef decimal_digits_t (uint16) for number of digits in most 2021-05-19 22:27:27 +02:00
mf_arr_appstr.c
mf_cache.c
mf_dirname.c
mf_fn_ext.c
mf_format.c
mf_getdate.c
mf_iocache.c Merge 10.5 into 10.6 2021-06-21 17:49:33 +03:00
mf_iocache2.c
mf_keycache.c Merge 10.5 into 10.6 2022-09-26 14:34:43 +03:00
mf_keycaches.c
mf_loadpath.c
mf_pack.c
mf_path.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
mf_qsort.c fix clang build: check alignment the other way 2021-07-26 12:37:25 +03:00
mf_qsort2.c
mf_radix.c
mf_same.c
mf_sort.c
mf_soundex.c
mf_tempdir.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
mf_tempfile.c MDEV-26601: mysys - O_TMPFILE ^ O_CREAT 2021-09-14 21:06:34 +10:00
mf_unixpath.c
mf_wcomp.c
mulalloc.c Added detection of memory overwrite with multi_malloc 2023-02-27 19:25:44 +02:00
my_access.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_addr_resolve.c Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
my_alarm.c
my_alloc.c Merge branch '10.4' into 10.5 2023-09-05 12:41:49 +07:00
my_atomic_writes.c Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
my_basename.c
my_bit.c
my_bitmap.c Merge 10.4 into 10.5 2020-05-31 10:28:59 +03:00
my_chmod.c
my_chsize.c
my_compare.c
my_compress.c Cleanup: Remove IF_VALGRIND 2022-04-25 09:40:40 +03:00
my_conio.c Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
my_copy.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_cpu.c
my_create.c
my_default.c Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
my_delete.c Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
my_div.c
my_dlerror.c
my_error.c Merge branch '10.4' into 10.5 2020-11-01 14:26:15 +01:00
my_file.c
my_fopen.c Merge 10.4 into 10.5 2020-04-25 21:57:52 +03:00
my_fstream.c
my_gethwaddr.c OS detection logic in my_gethwaddr.c is backwards 2022-11-13 13:12:37 +11:00
my_getncpus.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_getopt.c MDEV-32203 Raise notes when an index cannot be used on data type mismatch 2023-10-03 08:25:31 +03:00
my_getpagesize.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_getsystime.c Windows : fix warning about potential division by 0 2021-05-09 13:26:03 +02:00
my_getwd.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_init.c MDEV-19935 Create unified CRC-32 interface 2020-09-17 16:07:37 +02:00
my_largepage.c Added Myisam, Aria and InnoDB buffer pool to @@memory_used status variable 2023-10-03 08:25:30 +03:00
my_lib.c MDEV-24841: More workarounds 2022-03-14 10:37:39 +02:00
my_libwrap.c
my_likely.c Merge remote-tracking branch '10.4' into 10.5 2023-03-31 21:32:41 +02:00
my_lock.c
my_lockmem.c Added Myisam, Aria and InnoDB buffer pool to @@memory_used status variable 2023-10-03 08:25:30 +03:00
my_malloc.c Added Myisam, Aria and InnoDB buffer pool to @@memory_used status variable 2023-10-03 08:25:30 +03:00
my_memmem.c
my_mess.c MDEV-23846: O_TMPFILE error in mysqlbinlog stream output breaks restore 2020-11-23 12:16:45 +05:30
my_minidump.cc MDEV-11499 mysqltest, Windows : improve diagnostics if server fails to shutdown 2021-09-24 11:49:28 +02:00
my_mkdir.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_mmap.c
my_new.cc Fixes that enables my_new.cc (new wrapper using my_malloc) 2021-05-19 22:27:27 +02:00
my_once.c
my_open.c Added checking to protect against simultaneous double free in safemalloc 2021-05-19 22:54:14 +02:00
my_port.c
my_pread.c
my_pthread.c Merge 10.5 into 10.6 2022-10-25 14:25:42 +03:00
my_quick.c
my_rdtsc.c MDEV-23175: my_timer_milliseconds clock_gettime for multiple platfomrs 2021-12-22 16:51:22 +01:00
my_read.c
my_redel.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_rename.c Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
my_rnd.c
my_safehash.c
my_safehash.h
my_seek.c myseek: AIX has no "tell" 2021-03-19 11:14:53 +11:00
my_setuser.c
my_sleep.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_static.c Fixes that enables my_new.cc (new wrapper using my_malloc) 2021-05-19 22:27:27 +02:00
my_static.h
my_symlink.c MDEV-24841 Build error with MSAN use-of-uninitialized-value in comp_err 2022-03-14 09:28:55 +02:00
my_symlink2.c MDEV-11412 Ensure that table is truly dropped when using DROP TABLE 2020-06-14 19:39:42 +03:00
my_sync.c MDEV-381: fdatasync() does not correctly flush growing binlog file 2023-08-10 19:52:04 +02:00
my_thr_init.c fix ASAN+safemalloc builds 2023-07-04 16:37:29 +02:00
my_uuid.c MDEV-24285 support oracle build-in function: sys_guid 2021-05-19 22:54:11 +02:00
my_win_popen.cc Ensure that source files contain only valid UTF8 encodings (#2188) 2023-05-19 13:21:34 +01:00
my_wincond.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_winerr.c
my_winfile.c Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
my_winthread.c
my_wintoken.c Merge pull request #1221 from grooverdan/10.4-MDEV-18851-multiple-sized-large-page-support 2020-04-02 23:54:08 +04:00
my_write.c
mysys_priv.h Merge 10.5 into 10.6 2022-12-13 16:58:58 +02:00
psi_noop.c Merge branch 'merge-perfschema-5.7' into 10.5 2022-08-02 09:34:15 +02:00
ptr_cmp.c
queues.c Merge 10.4 into 10.5 2020-05-05 21:16:22 +03:00
safemalloc.c Merge 10.5 into 10.6 2021-10-28 09:08:58 +03:00
stacktrace.c MDEV-30573 Server doesn't build with GCOV by GCC 11+ 2023-02-06 21:25:02 +11:00
string.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
test_charset.c MDEV-8334: Rename utf8 to utf8mb3 2021-05-19 06:48:36 +02:00
test_dir.c
test_thr_mutex.c
test_xml.c
testhash.c
thr_alarm.c Merge 10.5 into 10.6 2022-10-25 14:25:42 +03:00
thr_lock.c Merge 10.5 into 10.6 2021-05-04 07:37:38 +03:00
thr_mutex.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
thr_rwlock.c
thr_timer.c MDEV-15795 Stack exceeded if pthread_attr_setstacksize(&thr_attr,8196) succeeds 2022-10-22 10:24:14 +02:00
tree.c
typelib.c Added 'const' to arguments in get_one_option and find_typeset() 2021-02-08 12:16:29 +02:00
waiting_threads.c Merge 10.4 into 10.5 2020-04-25 21:57:52 +03:00
wqueue.c