Код: Выделить всё
#include
#include
#include
#include
extern "C" bool my_udf_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1 || args->arg_type[0] != STRING_RESULT) {
strcpy(message, "Expected a single string argument");
return 1;
}
initid->const_item = 1; // This UDF is deterministic
initid->maybe_null = 1; // This UDF can return NULL
initid->max_length = 0; // The result can be of any length
return 0;
}
extern "C" char* my_udf(UDF_INIT* initid, UDF_ARGS* args, char* result,
unsigned long* length, char* is_null, char* error)
{
// Print the input string
// Run the Python script and pass the input string as a command-line parameter
char param[] = "params to script";
char cmd[100];
sprintf(cmd, "python3 checker.py %s", param);
system(cmd);
return 0;
}
Думаю, проблема с системой вызовов (cmd).
Подробнее здесь: https://stackoverflow.com/questions/762 ... -system-co