pBlueG / SA-MP-MySQL

MySQL plugin for San Andreas Multiplayer
BSD 3-Clause "New" or "Revised" License
196 stars 80 forks source link

You have an error in your SQL syntax #238

Open Romz24 opened 4 years ago

Romz24 commented 4 years ago

From time to time (once a week, and sometimes even less often) I get mysql errors. There are no problems in the request, only sometimes it gives an error for some reason, and in the request it shows some unknown characters. Could this be a plugin problem? Someone came across a similar one, if so, how to fix it?

Mysql error:

[12:46:00] [ERROR] error #1064 while executing query "UPDATE vehicle SET save_X = 955.6770, save_Y = 2436.1999, save_Z = 10.8020, save_A = 180.2409, save_Interior = 0, save_World = 0, Color1 = 0, Color2 = 79, Tire1 = 0, Tire2 = 0, Tire3 = 0, Tire4 = 0, Tank = 1, Gas = 5.42, Health = 1000.00, `Lock`ЮЭ WHERE ID = 5457 LIMIT 1": 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 'ЮЭ WHERE ID = 5457 LIMIT 1' at line 1
[09:17:10] [ERROR] error #1064 while executing query "UPDATE vehicle SET save_X = 2089.4199, save_Y = 2795.0900, save_Z = 10.8503, save_A = 0.2170, save_Interior = 0, save_World = 0, Color1 = 3, Color2 = 0, Tire1 = 0, Tire2 = 0, Tire3 = 0, Tire4 = 0, Tank = 1, Gas = 82.15, Health = 1000.00, `Lock` = 1 WHERE ID = 5387 LIMI9®": 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 'LIMI9®' at line 1
[19:24:30] [ERROR] error #1064 while executing query "UPDATE vehicle SET save_X = -1284.2800, save_Y = 2520.4099, save_Z = 89.7693, save_A = 269.4219, save_Interior = 0, save_World = 0, Color1 = 133, Color2 = 74, Tire1 = 0, Tire2 = 0, Tire3 = 0, Tire4 = 0, Tank = 1, Gas = 40.46, Health = 1000.00, `Lock` = 1 WHERE ID = 549тµJMIT 1": 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 'µJMIT 1' at line 1
[15:05:41] [ERROR] error #1064 while executing query "UPDATE vehicle SET save_X = -1293.7600, save_Y = 2527.1999, save_Z = 88.1405, save_A = 175.0119, save_Interior = 0, save_World = 0, Color1 = 9, Color2 = 247, Tire1 = 0, Tire2 = 0, Tire3 = 0, Tire4 = 0, Tank = 1, Gas = 54.63, Health = 1700.00, `L5ѕ] = 1 WHERE ID = 5498 LIMIT 1": 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 '' at line 1
[01:11:44] [ERROR] error #1064 while executing query "UPDATE vehicle SET save_X = -1307.6800, save_Y = 2527.4599, save_Z = 87.8317, save_A = 179.6199, save_Interior = 0, save_World = 0, Color1 = 0, Color2 = 0, Tire1 = 0, Tire2 = 0, Tire3 = 0, Tire4 = 0, Tank = 1, Gas = 44.47, Health = 1000.00, `Locщ—€ 1 WHERE ID = 5495 LIMIT 1": 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 '' at line 1
[15:25:11] [ERROR] error #1064 while executing query "UPDATE vehicle SET save_X = -1303.2500, save_Y = 2527.3898, save_Z = 87.8275, save_A = 177.7299, save_Interior = 0, save_World = 0, Color1 = 0, Color2 = 1, Tire1 = 0, Tire2 = 0, Tire3 = 0, Tire4 = 0, Tank = 1, Gas = 81.27, Health = 1000.00, `Lock` = 1 WHERE ID = 5496 L¶˜o 1": 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 'L¶?o 1' at line 1
[19:16:46] [ERROR] error #1064 while executing query "UPDATE vehicle SET save_X = 726.8129, save_Y = -1434.7800, save_Z = 13.4700, save_A = 269.7390, save_Interior = 0, save_World = 0, Color1 = 162, Color2 = 110, Tire1 = 1, Tire2 = 1, Tire3 = 1, Tire4 = 0, Tank = 0, Gas = 0.00, Health = 378.14, `LoБЎC= 0 WHERE ID = 111 LIMIT 1": 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 '' at line 1

Code query:

UPDATE vehicle SET save_X = %.4f, save_Y = %.4f, save_Z = %.4f, save_A = %.4f, save_Interior = %d, save_World = %d, Color1 = %d, Color2 = %d, Tire1 = %d, Tire2 = %d, Tire3 = %d, Tire4 = %d, Tank = %d, Gas = %.2f, Health = %.2f, `Lock` = %d WHERE ID = %d LIMIT 1
mikeydevelops commented 4 years ago

So the thing that pops out is that you have encoding problem. First what you'll have to do is to find the source of the query. Then look in the format arguments and search for something that might be changing the encoding of the string.