[MXS-3534] INSERT SELECT containing variable name routed to slave Created: 2021-05-05  Updated: 2021-06-09  Resolved: 2021-06-09

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

Type: Bug Priority: Major
Reporter: Andrea Ponzo (Inactive) Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Environment:

SkySQL



 Description   

Hello,
having "use_sql_variables_in": "all"

broke replication if DML is

INSERT INTO drd.drd_search(user_name, search_type, search_string)
SELECT @username, 'Session Venue_ID Search', CONCAT(@venue_id, ",", @start_datetime, ",", @end_datetime;



 Comments   
Comment by Johan Wikman [ 2021-05-05 ]

If the SELECT statement copied correctly? There appears to be a closing parenthesis missing?

Comment by Andrea Ponzo (Inactive) [ 2021-05-06 ]

Hi Johan
is a typo, sorry for that.

consider this
INSERT INTO drd.drd_search(user_name, search_type, search_string)
SELECT @username, 'Session Venue_ID Search', CONCAT(@venue_id, ",", @start_datetime, ",", @end_datetime);

Comment by markus makela [ 2021-06-07 ]

Seems to be classified correctly in 2.5:

2021-06-07 08:42:46   info   : (1) (RW-Split-Router) > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 175, type: QUERY_TYPE_WRITE|QUERY_TYPE_USERVAR_READ, stmt: INSERT INTO drd.drd_search(user_name, search_type, search_string)
SELECT @username, 'Session Venue_ID Search', CONCAT(@venue_id, ",", @start_datetime, ",", @end_datetime) 
2021-06-07 08:42:46   info   : (1) [readwritesplit] (RW-Split-Router) Route query to master: server1 <

Comment by markus makela [ 2021-06-07 ]

Can you also try if this happens with the latest 2.4 release?

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