~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/insert_select.cc

  • Committer: David Shrewsbury
  • Date: 2010-09-09 21:56:04 UTC
  • mto: (1754.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1755.
  • Revision ID: shrewsbury.dave@gmail.com-20100909215604-hi1jaml3z3z9ozb7
Use of String::c_ptr() in temporal functions can corrupt PBXT row cache, so make sure temporaries are used.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
49
49
 
50
50
  unit->set_limit(select_lex);
51
51
 
52
 
  if (! (need_start_waiting= not session->wait_if_global_read_lock(false, true)))
 
52
  if (! (need_start_waiting= ! wait_if_global_read_lock(session, 0, 1)))
53
53
  {
54
54
    return true;
55
55
  }
56
56
 
57
57
  if (! (res= session->openTablesLock(all_tables)))
58
58
  {
59
 
    DRIZZLE_INSERT_SELECT_START(session->getQueryString()->c_str());
 
59
    DRIZZLE_INSERT_SELECT_START(session->query.c_str());
60
60
    /* Skip first table, which is the table we are inserting in */
61
61
    TableList *second_table= first_table->next_local;
62
62
    select_lex->table_list.first= (unsigned char*) second_table;
100
100
     Release the protection against the global read lock and wake
101
101
     everyone, who might want to set a global read lock.
102
102
   */
103
 
  session->startWaitingGlobalReadLock();
 
103
  start_waiting_global_read_lock(session);
104
104
 
105
105
  return res;
106
106
}