| 1 | #ifndef FAKE_COSTMODEL_CC_INCLUDED |
| 2 | #define FAKE_COSTMODEL_CC_INCLUDED |
| 3 | |
| 4 | /* |
| 5 | Copyright (c) 2014, 2026, Oracle and/or its affiliates. |
| 6 | |
| 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License, version 2.0, |
| 9 | as published by the Free Software Foundation. |
| 10 | |
| 11 | This program is designed to work with certain software (including |
| 12 | but not limited to OpenSSL) that is licensed under separate terms, |
| 13 | as designated in a particular file or component or in included license |
| 14 | documentation. The authors of MySQL hereby grant you an additional |
| 15 | permission to link the program and your derivative works with the |
| 16 | separately licensed software that they have either included with |
| 17 | the program or referenced in the documentation. |
| 18 | |
| 19 | This program is distributed in the hope that it will be useful, |
| 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | GNU General Public License, version 2.0, for more details. |
| 23 | |
| 24 | You should have received a copy of the GNU General Public License |
| 25 | along with this program; if not, write to the Free Software |
| 26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
| 27 | |
| 28 | #include "unittest/gunit/fake_costmodel.h" |
| 29 | |
| 30 | #include <assert.h> |
| 31 | #include <sys/types.h> |
| 32 | |
| 33 | #include "lex_string.h" |
| 34 | #include "m_string.h" |
| 35 | |
| 36 | class THD; |
| 37 | struct TABLE; |
| 38 | |
| 39 | Cost_model_server::~Cost_model_server() = default; |
| 40 | |
| 41 | const double Server_cost_constants::KEY_COMPARE_COST = 0.1; |
| 42 | const double Server_cost_constants::MEMORY_TEMPTABLE_CREATE_COST = 2.0; |
| 43 | const double Server_cost_constants::MEMORY_TEMPTABLE_ROW_COST = 0.2; |
| 44 | const double Server_cost_constants::DISK_TEMPTABLE_CREATE_COST = 40.0; |
| 45 | const double Server_cost_constants::DISK_TEMPTABLE_ROW_COST = 1.0; |
| 46 | const double Server_cost_constants::ROW_EVALUATE_COST = 0.2; |
| 47 | const double SE_cost_constants::MEMORY_BLOCK_READ_COST = 1.0; |
| 48 | const double SE_cost_constants::IO_BLOCK_READ_COST = 1.0; |
| 49 | |
| 50 | /* purecov: begin inspected */ |
| 51 | const SE_cost_constants *Cost_model_constants::get_se_cost_constants( |
| 52 | const TABLE *) const { |
| 53 | // This is only implemented in order to link the unit tests |
| 54 | assert(false); |
| 55 | return nullptr; |
| 56 | } |
| 57 | /* purecov: end */ |
| 58 | |
| 59 | /* purecov: begin inspected */ |
| 60 | cost_constant_error SE_cost_constants::set(const LEX_CSTRING &, const double, |
| 61 | bool) { |
| 62 | // This is only implemented in order to link the unit tests |
| 63 | assert(false); |
| 64 | return COST_CONSTANT_OK; |
| 65 | } |
| 66 | /* purecov: end */ |
| 67 | |
| 68 | /* purecov: begin inspected */ |
| 69 | Cost_model_se_info::~Cost_model_se_info() { |
| 70 | // This is only implemented in order to link the unit tests |
| 71 | assert(false); |
| 72 | } |
| 73 | /* purecov: end */ |
| 74 | |
| 75 | /* purecov: begin inspected */ |
| 76 | Cost_model_constants::~Cost_model_constants() { |
| 77 | // This is only implemented in order to link the unit tests |
| 78 | assert(false); |
| 79 | } |
| 80 | /* purecov: end */ |
| 81 | |
| 82 | /* purecov: begin inspected */ |
| 83 | uint Cost_model_constants::find_handler_slot_from_name( |
| 84 | THD *, const LEX_CSTRING &) const { |
| 85 | // This is only implemented in order to link the unit tests |
| 86 | assert(false); |
| 87 | return 0; |
| 88 | } |
| 89 | /* purecov: end */ |
| 90 | |
| 91 | #endif /* FAKE_COSTMODEL_CC_INCLUDED */ |