summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-11-01 08:55:16 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-11-01 21:15:55 +0200
commit1c6b982e02eeaa75bb6c2f2a3c2b64491dd6d3c8 (patch)
treedd639542380856235c0d38ede1c184f148f7dff9 /mysys
parentdd6e74c62a2aa44d9d5e1790bcd36d3ff1c7d98b (diff)
downloadmariadb-git-1c6b982e02eeaa75bb6c2f2a3c2b64491dd6d3c8.tar.gz
MDEV-12779 Oracle/DB2 Compatibility Implicit Ordering for ROW_NUMBER OVER
Users expect window functions to produce a certain ordering of rows in the final result set. Although the standard does not require this, we already have the filesort result done for when we computed the window function. If there is no ORDER BY attached to the query, just keep it till the SELECT is completely evaluated and use that to print the result. Update test cases as many did not take care to guarantee a stable result.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index aea41886f05..673f9762a86 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -353,6 +353,15 @@ int init_slave_io_cache(IO_CACHE *master, IO_CACHE *slave)
void end_slave_io_cache(IO_CACHE *cache)
{
+ /* Remove the cache from the next_file_user circular linked list. */
+ if (cache->next_file_user != cache)
+ {
+ IO_CACHE *p= cache->next_file_user;
+ while (p->next_file_user != cache)
+ p= p->next_file_user;
+ p->next_file_user= cache->next_file_user;
+
+ }
my_free(cache->buffer);
}