[MXS-2080] In SQL_MODE=ORACLE, sequence_name.nextval can get routed to slave Created: 2018-10-04  Updated: 2020-08-25  Resolved: 2018-10-30

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 2.2.13
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Johan Wikman
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Relates
relates to MXS-1584 Add SEQUENCE support Closed

 Description   

MariaDB supports a special syntax for sequences when SQL_MODE=ORACLE is set:

or in Oracle mode (SQL_MODE=ORACLE)

sequence_name.nextval

https://mariadb.com/kb/en/library/sequence-overview/#using-sequence-objects

ReadWriteSplit does not currently seem to understand that this is something that needs to be routed to the master:

2018-10-05 02:59:16   info   : (27442634) [readwritesplit] > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 55, type: QUERY_TYPE_READ, stmt: SELECT MYSCHEMA.MY_DUMMY_SEQ_CACHED.NEXTVAL 
2018-10-05 02:59:16   info   : (27442634) [readwritesplit] Route query to slave 	[10.1.1.107]:6603 <
2018-10-05 02:59:16   info   : (27442634) [readwritesplit] Reply complete, last reply from node2


Generated at Thu Feb 08 04:11:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.