I am currently facing the error
{
"message": "Malformed communication packet.",
"code":"ER_MALFORMED_PACKET","errno":1835,"sqlState":"HY000","sqlMessage":"Malformed communication packet."
}
if I replace .query by .execute in
let query = 'INSERT INTO table (_id, location,size) ' +
'VALUES (UUID_TO_BIN(?,1), ST_GeomFromGeoJSON( \'{"type":"Point","coordinates":[ ? , ? ]}\'),?)'
res = await mysql.execute(query, [id, location.longitude, location.latitude, size])
Since this query is called many times I tried using execute instead of query. I allready figured out that:
let query = 'INSERT INTO table (_id, location,size) ' +
'VALUES (UUID_TO_BIN(?,1), ST_GeomFromGeoJSON( \'{"type":"Point","coordinates":[ 10,50 ]}\'),?)'
res = await mysql.execute(query, [id, size])
works fine. Is there a way to use execute ?
I am using: mysql2 (nodejsClient): 2.1.0 mysql: 8.0.19