Skip to content

Commit 29b9ffb

Browse files
committed
Fix positional args
1 parent a0eba40 commit 29b9ffb

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

programs/local/LocalChdb.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ local_result * queryToBuffer(
1212
const std::string & path = {},
1313
const std::string & udfPath = {})
1414
{
15-
std::vector<std::string> argv = {"clickhouse", "--", "--multiquery"};
15+
std::vector<std::string> argv = {"clickhouse", "--multiquery"};
1616

1717
// If format is "Debug" or "debug", then we will add `--verbose` and `--log-level=trace` to argv
1818
if (output_format == "Debug" || output_format == "debug")
@@ -28,14 +28,6 @@ local_result * queryToBuffer(
2828
argv.push_back("--output-format=" + output_format);
2929
}
3030

31-
// If udfPath is not empty, then we will add `--user_scripts_path` and `--user_defined_executable_functions_config` to argv
32-
// the path should be a one time thing, so the caller should take care of the temporary files deletion
33-
if (!udfPath.empty())
34-
{
35-
argv.push_back("--user_scripts_path=" + udfPath);
36-
argv.push_back("--user_defined_executable_functions_config=" + udfPath + "/*.xml");
37-
}
38-
3931
// If path is not empty, then we will add `--path` to argv. This is used for chdb.Session to support stateful query
4032
if (!path.empty())
4133
{
@@ -45,6 +37,15 @@ local_result * queryToBuffer(
4537
// Add query string
4638
argv.push_back("--query=" + queryStr);
4739

40+
// If udfPath is not empty, then we will add `--user_scripts_path` and `--user_defined_executable_functions_config` to argv
41+
// the path should be a one time thing, so the caller should take care of the temporary files deletion
42+
if (!udfPath.empty())
43+
{
44+
argv.push_back("--");
45+
argv.push_back("--user_scripts_path=" + udfPath);
46+
argv.push_back("--user_defined_executable_functions_config=" + udfPath + "/*.xml");
47+
}
48+
4849
// Convert std::string to char*
4950
std::vector<char *> argv_char;
5051
for (auto & arg : argv)

src/Storages/System/StorageSystemJemalloc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ UInt64 getJeMallocValue(const char * name)
2424
{
2525
UInt64 value{};
2626
size_t size = sizeof(value);
27-
mallctl(name, &value, &size, nullptr, 0);
27+
je_mallctl(name, &value, &size, nullptr, 0);
2828
/// mallctl() fills the value with 32 bit integer for some queries("arenas.nbins" for example).
2929
/// In this case variable 'size' will be changed from 8 to 4 and the 64 bit variable 'value' will hold the 32 bit actual value times 2^32 on big-endian machines.
3030
/// We should right shift the value by 32 on big-endian machines(which is unnecessary on little-endian machines).

0 commit comments

Comments
 (0)