My project just ran into a case where we needed the resulting ID returned from an insert/update query. There is a page on your docs for LAST_INSERT_ID but the described usage is as a function. We found that the insert/update queries we actually returning the id of the just created/updated row, without any invocation of LAST_INSERT_ID()
. After doing some research it was found that this behavior is actually a part of the MySQL protocol, specifically the OK_PACKET. We were wondering if we could get some clarification on this behavior, specifically if we shouldn’t rely on MemSQL always supporting this behavior. Any information you can provide would be very helpful, thank you!
For some extra insight into the project we are using Knexjs with MySQL as a driver.