telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
65 stars 105 forks source link

SET sql_mode for MySQL persistence #1735

Open manucarrace opened 5 years ago

manucarrace commented 5 years ago

There are many problems with database persistence related with data types. In an fiware e2e scenario, types and values stored in CB, would not match database types and would provoke cygnus persistence errors.

It would be nice to investigate about sql_mode and state it as a new cygnus mysql sink parameter (e.g. cygnus-ngsi.sinks.mysql-sink.strict_sql_mode = false)

It would involve that every data is casted to database types and there would be no persistence erros.

fgalan commented 5 years ago

It would be nice to investigate about sql_mode and state it as a new cygnus mysql sink parameter (e.g. cygnus-ngsi.sinks.mysql-sink.strict_sql_mode = false)

Maybe we need the same for every SQL-based sink (postgresql, postgis, etc)?

AlvaroVega commented 5 years ago

it seems that strict mode config should be add into mysql configuration (/etc/my.conf): https://www.liquidweb.com/kb/how-to-disable-mysql-strict-mode/ Maybe as a parameter of docker: docker run --name iot-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag --sql-mode=""

pmo-sdr commented 4 years ago

Solution proposal: dd90f95

fgalan commented 4 years ago

Solution proposal: dd90f95

Does this commit belong to some on-the-fly PR?

pmo-sdr commented 4 years ago

Not yet. We will need help testing this solution, at least in other Sql backends than Mysql.