inert-bot / discord-bot

Open Source discord bot written in python
https://inert.blotz.dev/discord-bot/
GNU General Public License v3.0
0 stars 3 forks source link

SQL errors #22

Open Blotz opened 2 years ago

Blotz commented 2 years ago

inert    | [06/Mar/2022 14:26:06] ERROR [discord_bot.sqlHandler.execute:85] 1064 (42000): 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 guild_id=950036111848267786' at line 1
inert    | Traceback (most recent call last):
inert    |   File "/root/.local/lib/python3.9/site-packages/mysql/connector/connection_cext.py", line 523, in cmd_query
inert    |     self._cmysql.query(query,
inert    | _mysql_connector.MySQLInterfaceError: 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 guild_id=950036111848267786' at line 1
inert    | 
inert    | During handling of the above exception, another exception occurred:
inert    | 
inert    | Traceback (most recent call last):
inert    |   File "/code/src/discord_bot/sqlHandler.py", line 81, in execute
inert    |     c.execute(sql, params)
inert    |   File "/root/.local/lib/python3.9/site-packages/mysql/connector/cursor_cext.py", line 269, in execute
inert    |     result = self._cnx.cmd_query(stmt, raw=self._raw,
inert    |   File "/root/.local/lib/python3.9/site-packages/mysql/connector/connection_cext.py", line 528, in cmd_query
inert    |     raise errors.get_mysql_exception(exc.errno, msg=exc.msg,
inert    | mysql.connector.errors.ProgrammingError: 1064 (42000): 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 guild_id=950036111848267786' at line 1```
SQL Code has mistakes and errors
Blotz commented 2 years ago

implementing pytest-mysql to catch these errors