[asterisk-bugs] [JIRA] (ASTERISK-29360) Asterisk, Mysql, Odbc (Unknown column 'data' in 'field list')
George Joseph (JIRA)
noreply at issues.asterisk.org
Mon Mar 22 07:35:15 CDT 2021
[ https://issues.asterisk.org/jira/browse/ASTERISK-29360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=254263#comment-254263 ]
George Joseph edited comment on ASTERISK-29360 at 3/22/21 7:33 AM:
-------------------------------------------------------------------
it seems need to be check logic in ./main/logger.c line num 877
{code}
if (ast_check_realtime("queue_log")) {
tv = ast_tvnow();
ast_localtime(&tv, &tm, logfiles.queue_log_realtime_use_gmt ? "GMT" : NULL);
ast_strftime(time_str, sizeof(time_str), "%F %T.%6q", &tm);
va_start(ap, fmt);
vsnprintf(qlog_msg, sizeof(qlog_msg), fmt, ap);
va_end(ap);
if (logfiles.queue_adaptive_realtime) {
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(data)[5];
);
AST_NONSTANDARD_APP_ARGS(args, qlog_msg, '|');
/* Ensure fields are large enough to receive data */
ast_realtime_require_field("queue_log",
"data1", RQ_CHAR, strlen(S_OR(args.data[0], "")),
"data2", RQ_CHAR, strlen(S_OR(args.data[1], "")),
"data3", RQ_CHAR, strlen(S_OR(args.data[2], "")),
"data4", RQ_CHAR, strlen(S_OR(args.data[3], "")),
"data5", RQ_CHAR, strlen(S_OR(args.data[4], "")),
SENTINEL);
/* Store the log */
ast_store_realtime("queue_log", "time", time_str,
"callid", callid,
"queuename", queuename,
"agent", agent,
"event", event,
"data1", S_OR(args.data[0], ""),
"data2", S_OR(args.data[1], ""),
"data3", S_OR(args.data[2], ""),
"data4", S_OR(args.data[3], ""),
"data5", S_OR(args.data[4], ""),
SENTINEL);
} else {
ast_store_realtime("queue_log", "time", time_str,
"callid", callid,
"queuename", queuename,
"agent", agent,
"event", event,
"data", qlog_msg,
SENTINEL);
}
{code}
was (Author: maxim.dogonov):
it seems need to be check logic in ./main/logger.c line num 877
if (ast_check_realtime("queue_log")) {
tv = ast_tvnow();
ast_localtime(&tv, &tm, logfiles.queue_log_realtime_use_gmt ? "GMT" : NULL);
ast_strftime(time_str, sizeof(time_str), "%F %T.%6q", &tm);
va_start(ap, fmt);
vsnprintf(qlog_msg, sizeof(qlog_msg), fmt, ap);
va_end(ap);
if (logfiles.queue_adaptive_realtime) {
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(data)[5];
);
AST_NONSTANDARD_APP_ARGS(args, qlog_msg, '|');
/* Ensure fields are large enough to receive data */
ast_realtime_require_field("queue_log",
"data1", RQ_CHAR, strlen(S_OR(args.data[0], "")),
"data2", RQ_CHAR, strlen(S_OR(args.data[1], "")),
"data3", RQ_CHAR, strlen(S_OR(args.data[2], "")),
"data4", RQ_CHAR, strlen(S_OR(args.data[3], "")),
"data5", RQ_CHAR, strlen(S_OR(args.data[4], "")),
SENTINEL);
/* Store the log */
ast_store_realtime("queue_log", "time", time_str,
"callid", callid,
"queuename", queuename,
"agent", agent,
"event", event,
"data1", S_OR(args.data[0], ""),
"data2", S_OR(args.data[1], ""),
"data3", S_OR(args.data[2], ""),
"data4", S_OR(args.data[3], ""),
"data5", S_OR(args.data[4], ""),
SENTINEL);
} else {
ast_store_realtime("queue_log", "time", time_str,
"callid", callid,
"queuename", queuename,
"agent", agent,
"event", event,
"data", qlog_msg,
SENTINEL);
}
> Asterisk, Mysql, Odbc (Unknown column 'data' in 'field list')
> -------------------------------------------------------------
>
> Key: ASTERISK-29360
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-29360
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Core/Logging
> Affects Versions: 16.15.1
> Environment: CentOS Linux release 8.3.2011
> Your MySQL connection id is 108
> Server version: 5.5.62 MySQL Community Server (GPL)
> Reporter: Maksim
> Severity: Major
>
> Hi,
> We use for logging queuelog events to mysql database use odbc driver.
> When first start asterisk and after started mysqlDB we have trouble with queuelog logging.
> WARNING[1995]: res_odbc.c:538 ast_odbc_print_errors: SQL Prepare returned an error: 42S22: [MySQL][ODBC 8.0(w) Driver][mysqld-5.7.28-log]Unknown column 'data' in 'field list'
> WARNING[1995]: res_config_odbc.c:122 custom_prepare: SQL Prepare failed! [INSERT INTO queue_log (time, data, event, agent, queuename, callid) VALUES (?, ?, ?, ?, ?, ?)]
> after I run command asterisk -rx "core reload" is temp fixed.
> I try add that column data to my sql sheme:
> ALTER TABLE queuelog ADD data varchar(40) COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER event;
> and I don't get error, but column data1, data2, data3, data4 is empty.
> Asterisk write all volumes to data fields like "|11-9873630826|11"
> after asterisk -rx "core reload"
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list