MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getRandomSettings

Method getRandomSettings

src/Common/QueryFuzzer.cpp:222–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void QueryFuzzer::getRandomSettings(SettingsChanges & settings_changes)
223{
224#if USE_BUZZHOUSE
225 if (!BuzzHouse::performanceSettings.empty() && fuzz_rand() % 5 == 0)
226 {
227 const uint32_t nsettings
228 = (fuzz_rand() % std::min(static_cast<uint32_t>(BuzzHouse::performanceSettings.size()), UINT32_C(20))) + UINT32_C(1);
229
230 for (uint32_t i = 0; i < nsettings; i++)
231 {
232 const String & setting = pickRandomly(fuzz_rand, BuzzHouse::performanceSettings);
233 String value = pickRandomly(fuzz_rand, BuzzHouse::performanceSettings.at(setting).oracle_values);
234
235 value.erase(std::remove(value.begin(), value.end(), '\''), value.end());
236 settings_changes.setSetting(setting, value);
237 }
238 }
239#else
240 UNUSED(settings_changes);
241#endif
242}
243
244Field QueryFuzzer::getRandomField(int type)
245{

Callers 1

processWithASTFuzzerMethod · 0.80

Calls 9

minFunction · 0.50
removeFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setSettingMethod · 0.45

Tested by

no test coverage detected