~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/replace_select.cc

  • Committer: Monty Taylor
  • Date: 2009-09-22 23:50:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20090922235012-i0a3bs91f6krqduc
Fixed multi_malloc.h include guard.
Added include guard checking script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <drizzled/server_includes.h>
22
22
#include <drizzled/show.h>
23
23
#include <drizzled/lock.h>
24
24
#include <drizzled/session.h>
25
25
#include <drizzled/statement/replace_select.h>
26
26
 
27
 
namespace drizzled
28
 
{
 
27
using namespace drizzled;
29
28
 
30
29
bool statement::ReplaceSelect::execute()
31
30
{
35
34
  Select_Lex *select_lex= &session->lex->select_lex;
36
35
  Select_Lex_Unit *unit= &session->lex->unit;
37
36
  select_result *sel_result= NULL;
38
 
  bool res;
 
37
  bool res= false;
 
38
  bool need_start_waiting= false;
39
39
 
40
40
  if (insert_precheck(session, all_tables))
41
41
  {
47
47
 
48
48
  unit->set_limit(select_lex);
49
49
 
50
 
  if (session->wait_if_global_read_lock(false, true))
 
50
  if (! (need_start_waiting= ! wait_if_global_read_lock(session, 0, 1)))
51
51
  {
52
52
    return true;
53
53
  }
68
68
                                                session->lex->duplicates,
69
69
                                                session->lex->ignore)))
70
70
    {
71
 
      res= handle_select(session,
72
 
                         session->lex,
73
 
                         sel_result,
 
71
      res= handle_select(session, 
 
72
                         session->lex, 
 
73
                         sel_result, 
74
74
                         OPTION_SETUP_TABLES_DONE);
75
75
      /*
76
76
         Invalidate the table in the query cache if something changed
96
96
     Release the protection against the global read lock and wake
97
97
     everyone, who might want to set a global read lock.
98
98
   */
99
 
  session->startWaitingGlobalReadLock();
 
99
  start_waiting_global_read_lock(session);
100
100
 
101
101
  return res;
102
102
}
103
 
 
104
 
} /* namespace drizzled */
105