Bug #119108 Get ERROR 4501 via Router w/ RW split executing "<>"
Submitted: 6 Oct 11:02 Modified: 11 Oct 3:25
Reporter: Keith Hollman Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Router Severity:S3 (Non-critical)
Version:8.4.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: 3310, mysqlrouter, read-write split, router, rw split

[6 Oct 11:02] Keith Hollman
Description:
Previous bug https://bugs.mysql.com/bug.php?id=116952 corrected the comments but, finally able to apply in production, I get the 4501 error and for the usage of <> in a script. All other options that gave errors don't. Just the use of <>.

Seems that when using the ordinary RW port something that could give an error like using <> now gives the 4501 error.

However, I'm still not exactly sure what SQL command generate the 4501 error from my CMS, as it could be anything, but if I send a bad SQL command like <> it should still give me the same "You have an error in your SQL syntax.." error.

How to repeat:
# Using 3306 as RW split port:

cat /tmp/kk1.sql
<empty>

mysqlsh --login-path=admin -hweb-02 --show-warnings=true --sqlc -A -e "source /tmp/kk1.sql"
ERROR: 4501 (HY000) at line 1: Statement not allowed if access_mode is 'auto'

when port is changed back to standard RW:

mysqlsh --login-path=admin -hweb-02 --show-warnings=true --sqlc -A -e "source /tmp/kk1.sql"
ERROR: 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<>' at line 1

Suggested fix:
if I have a SQL error, make sure this is returned as is, as before. Not a 4501 error.

And see what other commands that normally work, come back with 4501 instead of an empty result set or whatever.
[6 Oct 11:06] Keith Hollman
Reproduced that "-" also fails, where "--" doesn't anymore.

No default schema selected; type \use <schema> to set one.
 MySQL  web-02:3306 ssl  SQL > -
                                    -> ;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  web-02:3306 ssl  SQL > -- ;
Query OK, 0 rows affected (0.0085 sec)
Statement ID: 604307
[6 Oct 11:14] Keith Hollman
Trying to determine in a preprod env what's happening and it could be anything of the following (according to my keyboard):

 MySQL  e-web-02:3306 ssl  SQL > @;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > #;
Query OK, 0 rows affected (0.0018 sec)
Statement ID: 604466
 MySQL  e-web-02:3306 ssl  SQL > ~;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > €;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ¬;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ;
ERROR: 1065 (42000): Query was empty
 MySQL  e-web-02:3306 ssl  SQL > (;
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 MySQL  e-web-02:3306 ssl  SQL > );
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > =;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ª;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > º;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > \;
Unknown command: '\;'
 MySQL  e-web-02:3306 ssl  SQL > |;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > €;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ^;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > *;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > `;
                                    `> ;
                                    `> `;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > +;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ´;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ç;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ,;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > .;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > -;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > {;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > };
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > [;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ];
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ¿;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ?;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
[6 Oct 11:14] Keith Hollman
Trying to determine in a preprod env what's happening and it could be anything of the following (according to my keyboard):

 MySQL  e-web-02:3306 ssl  SQL > @;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > #;
Query OK, 0 rows affected (0.0018 sec)
Statement ID: 604466
 MySQL  e-web-02:3306 ssl  SQL > ~;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > €;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ¬;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ;
ERROR: 1065 (42000): Query was empty
 MySQL  e-web-02:3306 ssl  SQL > (;
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
 MySQL  e-web-02:3306 ssl  SQL > );
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > =;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ª;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > º;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > \;
Unknown command: '\;'
 MySQL  e-web-02:3306 ssl  SQL > |;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > €;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ^;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > *;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > `;
                                    `> ;
                                    `> `;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > +;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ´;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ç;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ,;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > .;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > -;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > {;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > };
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > [;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ];
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ¿;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
 MySQL  e-web-02:3306 ssl  SQL > ?;
ERROR: 4501 (HY000): Statement not allowed if access_mode is 'auto'
[7 Oct 1:09] MySQL Verification Team
Thank you for the report.