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: Oh yes! This is a bug since the very first 3.0.0 - Thanks! It's OK in SQLite because it uses a dynamic type system. You can store almost every type in any field. See [Datatypes in SQLite 3](https://www.sqlite.org/datatype3.html) Now I have 2 options: * Change the DB structure to save EToday and ETotal in kWh * Change the device_status() code to save EToday and ETotal in Wh I tend to choose the second one for ease, but I'm open to suggestions. About segfault: do you still have it after the changes?

Viewing all articles
Browse latest Browse all 360

Trending Articles



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