Commit graph

38 commits

Author SHA1 Message Date
Marko Mäkelä
c41c79650a Merge 10.4 into 10.5 2023-02-10 12:02:11 +02:00
Vicențiu Ciorbaru
08c852026d Apply clang-tidy to remove empty constructors / destructors
This patch is the result of running
run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' .

Code style changes have been done on top. The result of this change
leads to the following improvements:

1. Binary size reduction.
* For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by
  ~400kb.
* A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb.

2. Compiler can better understand the intent of the code, thus it leads
   to more optimization possibilities. Additionally it enabled detecting
   unused variables that had an empty default constructor but not marked
   so explicitly.

   Particular change required following this patch in sql/opt_range.cc

   result_keys, an unused template class Bitmap now correctly issues
   unused variable warnings.

   Setting Bitmap template class constructor to default allows the compiler
   to identify that there are no side-effects when instantiating the class.
   Previously the compiler could not issue the warning as it assumed Bitmap
   class (being a template) would not be performing a NO-OP for its default
   constructor. This prevented the "unused variable warning".
2023-02-09 16:09:08 +02:00
Marko Mäkelä
ca26953924 Merge 10.4 into 10.5 2021-11-25 07:49:58 +02:00
Sergei Krivonos
cba065f4fe Json_writer_object add integers 2021-11-24 13:01:49 +02:00
Sergei Krivonos
691f7e165a MDEV-27036: allow Json_writer_[array|object] from Json_writer 2021-11-24 13:01:18 +02:00
Sergei Krivonos
d4d71153db Json_writer_object add integers 2021-11-19 01:55:23 +02:00
Sergei Krivonos
8101af68fa MDEV-27036: allow Json_writer_[array|object] from Json_writer 2021-11-19 01:55:23 +02:00
Marko Mäkelä
09205a1c9a Merge 10.4 into 10.5 2021-11-16 14:26:13 +02:00
Sergei Krivonos
94ef277b5b MDEV-23766: fix by assert (Windows) 2021-11-10 20:53:24 +02:00
Sergei Krivonos
e9b76b896a MDEV-23766: fix by my_json_writer test 2021-11-09 12:06:49 +02:00
Sergei Petrunia
5e988ff80f MDEV-23766: Make Json_writer assert when one tries to author invalid JSON
- Add unit test.
2021-11-09 12:06:49 +02:00
Sergei Petrunia
c9b5b9321f MDEV-23766: Make Json_writer assert when one tries to author invalid JSON
Code cleanup: Remove Json_writer::is_on_fmt_helper_call. We already
maintain this state in fmt_helper.
2021-11-09 12:06:49 +02:00
Sergei Krivonos
b17576322b MDEV-23766: add Json_writer consistency asserts to check array/object sequence 2021-11-09 12:06:49 +02:00
Sergei Krivonos
052dda61bb Made optional Json_writer_object / Json_writer_array consistency check 2021-10-17 13:20:49 +03:00
Sergei Krivonos
cf8e78a401 Implemented Json_writer_array & Json_writer_object subitems name presence control 2021-10-16 02:35:16 +03:00
Monty
a24d0926b9 Second stage of optimizer_trace optimizations
- Move testing of my_writer to inline functions to avoid calls
- Made more functions inline. Especially thd->thread_started()
  is now very optimized!
- Moved Opt_trace_stmt classe to opt_trace_context.h to get critical
  functions inline
2020-03-09 13:52:40 +02:00
Monty
940fcbe73b Improved speed of optimizer trace
- Added unlikely() to optimize for not having optimizer trace enabled
- Made THD::trace_started() inline
- Added 'if (trace_enabled())' around some potentially expensive code
  (not many found)
- Added ASSERT's to ensure we don't call expensive optimizer trace calls
  if optimizer trace is not enabled
- Added length to Json_writer functions to speed up buffer writes
  when optimizer trace is enabled.
- Changed LEX_CSTRING argument handling to not send full struct to writer
  function on_add_str() functions now trusts length arguments
2020-03-09 13:49:06 +02:00
Varun Gupta
71c57bcf8f Moved the function trace_plan_prefix to the optimizer trace file
Also added comments for trace_plan_prefix and the class Json_writer_temp_disable
2019-09-11 04:32:40 +05:30
Oleksandr Byelkin
f66d1850ac Merge branch '10.3' into 10.4 2019-06-14 22:10:50 +02:00
Oleksandr Byelkin
4a3d51c76c Merge branch '10.2' into 10.3 2019-06-14 07:36:47 +02:00
Oleksandr Byelkin
5b65d61d93 Merge branch '5.5' into 10.1 2019-06-12 22:54:46 +02:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Varun Gupta
eac97ef44c MDEV-18962: ASAN heap-buffer-overflow in Single_line_formatting_helper::on_add_str with optimizer trace
Fixed a typo
2019-04-03 00:32:26 +05:30
Varun Gupta
9cb55143ac Minor cleanup in the optimizer trace code.
More test coverage added for the optimizer trace.
2019-02-18 17:11:20 +05:30
Vladislav Vaintroub
d28dab7658 Fix compilation on old gcc 2019-02-13 12:15:14 +01:00
Varun Gupta
be8709eb7b MDEV-6111 Optimizer Trace
This task involves the implementation for the optimizer trace.

This feature produces a trace for any SELECT/UPDATE/DELETE/,
which contains information about decisions taken by the optimizer during
the optimization phase (choice of table access method, various costs,
transformations, etc). This feature would help to tell why some decisions were
taken by the optimizer and why some were rejected.

Trace is session-local, controlled by the @@optimizer_trace variable.
To enable optimizer trace we need to write:
   set @@optimizer_trace variable= 'enabled=on';

To display the trace one can run:
   SELECT trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;

This task also involves:
    MDEV-18489: Limit the memory used by the optimizer trace
    introduces a switch optimizer_trace_max_mem_size which limits
    the memory used by the optimizer trace. This was implemented by
    Sergei Petrunia.
2019-02-13 11:52:36 +05:30
Varun Gupta
6b979416e0 Extending the API for json_writer by introdcing
classes for Json_writer_object and Json_writer_array.
These classes will be used for the implementation
of the optimizer trace.
2019-02-13 11:52:35 +05:30
Vladislav Vaintroub
56e7b7eaed Make possible to use clang on Windows (clang-cl)
-DWITH_ASAN can be used as well now, on x64

Fix many clang-cl warnings.
2018-02-20 21:17:36 +00:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergei Petrunia
4938b82263 MDEV-7836: ANALYZE FORMAT=JSON should provide info about GROUP/ORDER BY
Provide basic info about sorting/grouping done by the queries.
2015-04-12 04:48:42 +03:00
Sergei Petrunia
8722b6de4d Code cleanup 2014-12-02 02:14:17 +03:00
Sergei Petrunia
e235bb864d ANALYZE FORMAT=JSON: better output and tests
- Print r_loops
- Always print r_* members. Print NULL values if no scans took place
- Added testcases.
2014-11-29 03:07:24 +03:00
Sergei Petrunia
37c444e1a0 EXPLAIN FORMAT=JSON: further development
Writing JSON:
- Fix a bug in Single_line_formatting_helper
- Add Json_writer_nesting_guard - safety class

EXPLAIN JSON support
- Add basic subquery support
- Add tests for UNION/UNION ALL.
2014-11-27 19:32:48 +03:00
Sergei Petrunia
84485dbe7c MDEV-6109: EXPLAIN JSON
Add pretty-printing of possible_keys column.
2014-08-12 15:02:09 +04:00
Sergei Petrunia
33d53c4c24 MDEV-6109: EXPLAIN JSON
- Add first testcases
- Don't overquote when printing conditions
- Other small output fixes
2014-08-09 06:37:56 +04:00
Sergei Petrunia
5cfd3270ec MDEV-6109: EXPLAIN JSON
- First code, "EXPLAIN FORMAT=JSON stmt" and "ANALYZE FORMAT=JSON stmt"
  work for basic queries.  Complex constructs (e.g subqueries, etc) not
  yet supported.
- No test infrastructure yet
2014-05-27 21:04:45 +04:00