Bug #81491 | delete then insert multiple values produces data in wrong order. | ||
---|---|---|---|
Submitted: | 18 May 2016 15:05 | Modified: | 18 May 2016 18:13 |
Reporter: | tom mlay | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.5.49-c11 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | insert data wrong order |
[18 May 2016 15:05]
tom mlay
[18 May 2016 15:50]
MySQL Verification Team
Thank you for your bug report. However, it is not a bug ... One of the basic premises of the relational model is that data sets do not have an ordering. It thus applies to all SQL databases. It was stipulated first time by the great C.J.Date, who was co-inventor of SQL. Hence, when the language was first time standardized, that was clearly stipulated. Hence, on page 373 of the SQL-92 standard it writes loud and clear: "If an <order by clause> is not specified, then the table specified by the <cursor specification> is T and the ordering of rows in T is implementation-dependent." Hence, no guarantee ....
[18 May 2016 18:13]
tom mlay
Thanks for your quick reply. I understand there is no intrinsic ordering of data in an sql table. However, in every previous version of mysql and in every other sql product I have worked with (MS Sql, IBN/SQL,Postgress) I have been able to rely on the data being written in the order in which I insert it, i.e. the select * from table returns the records in the order inserted. Your interpretation leads to two significant issues: 1) If I insert 10 records in one insert command I get a different result than if I do 10 insert commands. 2) I now have to do an order by id in order to retrieve the data in the order I inserted it. This will be a MAJOR performance issue on large data sets. Thanks, -Tom Mlay