Bug #86155 | InnoDB Cluster doen not work with sql_mode="ORACLE,TRADITIONAL" | ||
---|---|---|---|
Submitted: | 2 May 2017 6:56 | Modified: | 30 Jun 2017 9:58 |
Reporter: | Ted Wennmark | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Shell AdminAPI InnoDB Cluster / ReplicaSet | Severity: | S2 (Serious) |
Version: | 1.0.9 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | sql_mode mysql_innodb_cluster_metadata |
[2 May 2017 6:56]
Ted Wennmark
[3 May 2017 6:06]
Ted Wennmark
Problem is that sql_mode ORACLE contains ANSI_QUOTES and SQL statement being executed as part of populating InnoDB Cluster meta data tables sometime uses ' and sometime uses ", by replacing " with ' all works fine, see bellow. Default sql_mode in MySQL 5.7.18: mysql-sql> select @@sql_mode\G *************************** 1. row *************************** @@sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 1 row in set (0.00 sec) Problem query: mysql-sql> SELECT COUNT(*) as count FROM mysql_innodb_cluster_metadata.instances WHERE replicaset_id = 1 AND addresses->"$.mysqlClassic" = 'Node1:63310'; +-------+ | count | +-------+ | 1 | +-------+ 1 row in set (0.00 sec) mysql-sql> set sql_mode="ORACLE"; Query OK, 0 rows affected (0.00 sec) mysql-sql> SELECT COUNT(*) as count FROM mysql_innodb_cluster_metadata.instances WHERE replicaset_id = 1 AND addresses->"$.mysqlClassic" = 'Node1:63310'; 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 '"$.mysqlClassic" = 'Node1:63310'' at line 1 Change "$.mysqlClassic" to '$.mysqlClassic' and all works: mysql-sql> SELECT COUNT(*) as count FROM mysql_innodb_cluster_metadata.instances WHERE replicaset_id = 1 AND addresses->'$.mysqlClassic' = 'Node1:63310'; +-------+ | count | +-------+ | 1 | +-------+ 1 row in set (0.00 sec) I see no problems only using ' for strings and then it should work independent of sql_mode configured.
[3 May 2017 6:23]
MySQL Verification Team
Hello Ted, Thank you for the report. Verified as described. Thanks, Umesh
[30 Jun 2017 9:58]
David Moss
Posted by developer: Thanks for your feedback Ted, this was fixed in bug#25966057.