mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
merge 5.1 => 5.5
This commit is contained in:
commit
f066558a20
2 changed files with 20 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
#ifndef INCLUDES_MYSQL_SQL_LIST_H
|
||||
#define INCLUDES_MYSQL_SQL_LIST_H
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -174,6 +174,14 @@ protected:
|
|||
public:
|
||||
uint elements;
|
||||
|
||||
bool operator==(const base_list &rhs) const
|
||||
{
|
||||
return
|
||||
elements == rhs.elements &&
|
||||
first == rhs.first &&
|
||||
last == rhs.last;
|
||||
}
|
||||
|
||||
inline void empty() { elements=0; first= &end_of_list; last=&first;}
|
||||
inline base_list() { empty(); }
|
||||
/**
|
||||
|
|
|
@ -1719,6 +1719,8 @@ JOIN::optimize()
|
|||
*/
|
||||
void JOIN::restore_tmp()
|
||||
{
|
||||
DBUG_PRINT("info", ("restore_tmp this %p tmp_join %p", this, tmp_join));
|
||||
DBUG_ASSERT(tmp_join != this);
|
||||
memcpy(tmp_join, this, (size_t) sizeof(JOIN));
|
||||
}
|
||||
|
||||
|
@ -7202,13 +7204,18 @@ void JOIN::cleanup(bool full)
|
|||
{
|
||||
if (tmp_join)
|
||||
tmp_table_param.copy_field= 0;
|
||||
group_fields.delete_elements();
|
||||
|
||||
/*
|
||||
Ensure that the above delete_elements() would not be called
|
||||
Ensure that the following delete_elements() would not be called
|
||||
twice for the same list.
|
||||
*/
|
||||
if (tmp_join && tmp_join != this)
|
||||
tmp_join->group_fields= group_fields;
|
||||
if (tmp_join && tmp_join != this &&
|
||||
tmp_join->group_fields == this->group_fields)
|
||||
tmp_join->group_fields.empty();
|
||||
|
||||
// Run Cached_item DTORs!
|
||||
group_fields.delete_elements();
|
||||
|
||||
/*
|
||||
We can't call delete_elements() on copy_funcs as this will cause
|
||||
problems in free_elements() as some of the elements are then deleted.
|
||||
|
|
Loading…
Reference in a new issue