Quantcast
Channel: SBFspot Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 360

Commented Unassigned: MySQL EToday and ETotal as integer [173]

$
0
0
I just find strange behaviour. I'm not an expert in DB engines but it looks wired.

Inverters table has the same definition for Sqlite and MySQL.
CREATE Table Inverters (
Serial int(4) NOT NULL,
Name varchar(32),
Type varchar(32),
SW_Version varchar(32),
TimeStamp datetime,
TotalPac int,
EToday int(8),
ETotal int(8),
OperatingTime double,
FeedInTime double,
Status varchar(10),
GridRelay varchar(10),
Temperature float,
PRIMARY KEY (Serial)
);

However for Sqlite in my DB I have for example this values for EToday and ETotal
1.885|50.353
0.177|3.732
0.172|6.233
What is quite strange as it should be int(8). Issue is that MySQL keep this as real integer like below
1|50
0|3
0|6

I had to change data type to float and now MySql store data properly.
In SpotData all is fine because there are Wh and can be kept as int but in Inverters we have kWh.

Anyway there is Segmentation fault in build for mysql v3.2 fro sure after data upload to DB.
Comments: Backing to our root cause of issue. DON'T change definition from int to float. And consider change all float definition to decimal (x,y). It is not so important for Sqlite3 because it maps float to real for storage. And "A column with REAL affinity behaves like a column with NUMERIC affinity " - https://www.sqlite.org/datatype3.html The real problem is in MySQL - CREATE TABLE `test_table` (`number` FLOAT NULL); Insert into test_table value (0.7); select number *1000 from test_table; '699.999988079071' select number + number from test_table '1.399999976158142' Regarding installation I have 12 inverters (full capacity of multigate)

Viewing all articles
Browse latest Browse all 360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>