NetXMS Support Forum

English Support => General Support => Topic started by: vargaata on August 07, 2018, 11:44:31 PM

Title: Problem to store Last values into database.
Post by: vargaata on August 07, 2018, 11:44:31 PM
I upgraded my Slackware installation from 14.2 to the latest and NetXMS from 2.0.7 to 2.2.7. During the upgrade I had to delete netxms database: DROP DATABASE netxms; . I compiled NetXMS from source with following options: ./configure --with-server --with-agent --with-snmp --with-mariadb --disable-mqtt --disable-ipv6.
After I created the new database, NetXMS started correctly, but not saving any real data from "Last values". It stores values with 01.01.1970 01:00:00 Time Stamp and 0 Value.

There are no errors reported in MariaDB and NetXMS logfiles. MariaDB version is: 10.3.8.

Can somebody help me, what to check, please?
Title: Re: Problem to store Last values into database.
Post by: vargaata on August 15, 2018, 02:38:15 PM
The strange thing is, when I do a query with mysql CLI from database, for examle: SELECT idata_timestamp,idata_value FROM netxms.idata_114 WHERE item_id = 109; I can see the correct values with timestamp. Do not know how to translate idata_timestamp to real date and time yet, but idata_value is correct.

It looks like, the data stored correcly in the database, just the NetXms client (PC and Mobile) cannot display it.

Thanks.
Title: Re: Problem to store Last values into database.
Post by: Victor Kirhenshtein on September 03, 2018, 07:43:47 PM
Hi,

it's problem with reading data from database, not with storing. It is caused by bug in MariaDB client library https://jira.mariadb.org/browse/CONC-281 (https://jira.mariadb.org/browse/CONC-281). It is supposed to be fixed in latest client version, but could be not. Our MariaDB driver has check for client version that activates workaround - maybe it erroneously assumes version number where this issue was fixed. You can try to find the following lines in src/db/dbdrv/mariadb/mariadb.cpp:


/* workaround for MariaDB C Connector bug CONC-281 */
if (mysql_get_client_version() < 100209)  // for any client before 10.2.9
{
    mysql_stmt_store_result(hStmt->statement);
}


and comment out version check so it will look like this:

/* workaround for MariaDB C Connector bug CONC-281 */
//if (mysql_get_client_version() < 100209)  // for any client before 10.2.9
{
    mysql_stmt_store_result(hStmt->statement);
}


then recompile MariaDB driver.

Best regards,
Victor
Title: Re: Problem to store Last values into database.
Post by: vargaata on September 15, 2018, 12:56:43 PM
Hello Victor,

Thanx for your answer. I followed your suggestion and modified the source file. It was successful. I can see stored values now.

Thank you very much,
Best regards,
Attila.