Can not handle correctly with mysql upsert statement
cardoc-yhbu opened this issue · comments
cardoc-yhbu commented
insert into user (id, name, age)
values ('user1', 'john doe', 20)
on duplicate key
update name='john doe', age=20;
The correct value of Parser(sql).tables
is ['user']
, but it returns ['user', 'name', 'age']
.
I used 0.4.3
.
Maciej Brencz commented
It's broken on the latest sql-metadata
as well:
assert Parser(
"insert into user (id, name, age) values ('user1', 'john doe', 20) on duplicate key update name='john doe', age=20"
).tables == ['user']
Expected :['user']
Actual :['user', 'name', 'age']