ioBroker / ioBroker.sql

Store history data in SQL Database: MySQL, PostgreSQL or SQLite
MIT License
44 stars 25 forks source link

Adapter adds two insert statements to the same request (leads to an error) #294

Open klein0r opened 1 year ago

klein0r commented 1 year ago

Describe the bug

In some cases, the adapter generates a statement with two separate inserts. e.g.

INSERT INTO `iobroker`.ts_counter (id, ts, val) VALUES (5, 1676135872618, 53.32),(5, 1676138387812, 53),(5, 1676138387812, 53),(5, 1676138670902, 52.95);INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES (5, 1676138387812, 53, 1, 2, 0),(5, 1676138670902, 52.95, 1, 2, 0);
Cannot insert INSERT INTO `iobroker`.ts_counter (id, ts, val) VALUES (5, 1676135872618, 53.32),(5, 1676138387812, 53),(5, 1676138387812, 53),(5, 1676138670902, 52.95);INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES (5, 1676138387812, 53, 1, 2, 0),(5, 1676138670902, 52.95, 1, 2, 0);: Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES (5, 1676...' at line 1 (id: LUFTFEUCHTE@William_Martin)

See https://forum.iobroker.net/topic/62640/sql-adpter-insert-befehle-innerhalb-von-40ms

1676198865950-iolog

Versions: