1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Review fixes

This commit is contained in:
Leonid Fedorov
2022-07-04 19:52:30 +03:00
parent f5b2a6885f
commit 110d9cfab5

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 MariaDB Corporation /* Copyright (C) 2022 MariaDB Corporation
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -70,13 +70,16 @@ extern "C"
{ {
struct InitData struct InitData
{ {
CURL* curl; CURL* curl = nullptr;
char* result; char* result = nullptr;
}; };
void columnstore_dataload_deinit(UDF_INIT* initid) void columnstore_dataload_deinit(UDF_INIT* initid)
{ {
InitData* initData = (InitData*)(initid->ptr); InitData* initData = (InitData*)(initid->ptr);
if (!initData)
return;
curl_easy_cleanup(initData->curl); curl_easy_cleanup(initData->curl);
delete initData->result; delete initData->result;
} }
@ -174,17 +177,17 @@ extern "C"
my_bool columnstore_dataload_init(UDF_INIT* initid, UDF_ARGS* args, char* message) my_bool columnstore_dataload_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{ {
initid->max_length = 1000 * 1000;
InitData* initData = new InitData;
initData->curl = curl_easy_init();
initid->ptr = (char*)(initData);
if (args->arg_count != 3 && args->arg_count != 4) if (args->arg_count != 3 && args->arg_count != 4)
{ {
strcpy(message, "COLUMNSTORE_DATALOAD() takes three or four arguments: (table, filename, bucket) or (table, filename, bucket, database)"); strcpy(message, "COLUMNSTORE_DATALOAD() takes three or four arguments: (table, filename, bucket) or (table, filename, bucket, database)");
return 1; return 1;
} }
initid->max_length = 1000 * 1000;
InitData* initData = new InitData;
initData->curl = curl_easy_init();
initid->ptr = (char*)(initData);
return 0; return 0;
} }
} }