sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.05k stars 983 forks source link

ProxySQL crashes when a lone semicolon (;) is sent as input (MySQL and PostgreSQL Admin Interfaces) #4716

Closed rahim-kanji closed 3 weeks ago

rahim-kanji commented 1 month ago

Issue Description

When sending a lone semicolon (;) as input on both the MySQL and PostgreSQL admin interfaces of ProxySQL, the service crashes unexpectedly. This issue occurs when no valid query is provided, only a semicolon is sent as part of the input.

Steps to Reproduce (MySQL Admin Interface)

  1. Connect to MySQL admin interface using your preferred method (e.g., via the MySQL client or a script).

    Example: mysql -u admin -padmin -h 127.0.0.1 -P6032

  2. After connecting successfully, following commands: DELIMETER | ;|

  3. Observe that ProxySQL crashes.

Steps to Reproduce (PostgreSQL Admin Interface)

  1. Connect to the Proxysql PostgreSQL admin interface: Example: psql -U admin -h 127.0.0.1 -p 6132

  2. Once connected, send following command: ;

  3. Observe that ProxySQL crashes.

Expected Behavior

ProxySQL should ignore or handle the lone semicolon gracefully, without crashing. Ideally, it should return an error message indicating an empty command was provided.

Actual Behavior

ProxySQL crashes and becomes unresponsive, requiring a restart to restore functionality.

rahim-kanji commented 1 month ago

Fix available in ProxySQL verison > 2.7.1 and > 3.0.0.