-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Open
Description
Feature Request
Is your feature request related to a problem?
No
Describe the feature you would like.
Currently, ShardingSphere MySQL parsing engine does not fully support MySQL INSERT INTO VALUES AS row_alias parsing. The AS row_alias part is not correctly parsed into the SQLStatement object. In addition, the expression in ON DUPLCIATE KEY UPDATE is not processed correctly and only CommonExpressionSegment is used to represent it.
INSERT INTO t_order VALUES (?, ?, ?, ?, 'test', '2017-08-08'), (?, ?, ?, ?, 'test', '2017-08-08') AS new_order ON DUPLICATE KEY UPDATE status = new_order.status
INSERT INTO t_order VALUES (?, ?, ?, ?, 'test', '2017-08-08'), (?, ?, ?, ?, 'test', '2017-08-08') AS new_order(order_id, user_id, status, merchant_id, remark, creation_date) ON DUPLICATE KEY UPDATE status = new_order.status
INSERT INTO t_order SET order_id = ?, user_id = ?, status = ?, merchant_id = ?, remark = 'test', creation_date = '2017-08-08' AS new_order ON DUPLICATE KEY UPDATE status = new_order.status
INSERT INTO t_order SET order_id = ?, user_id = ?, status = ?, merchant_id = ?, remark = 'test', creation_date = '2017-08-08' AS new_order(order_id, user_id, status, merchant_id, remark, creation_date) ON DUPLICATE KEY UPDATE status = new_order.status

Goal: Fully support the two SQL statements in the example and extract them into SQLStatement through visit.