~maria-captains/maria/mysql-6.0-backup

« back to all changes in this revision

Viewing changes to sql/sql_insert.cc

  • Committer: Thava Alagu
  • Date: 2010-03-11 19:18:17 UTC
  • mfrom: (3719.14.62 mysql-6.0-codebase)
  • Revision ID: thavamuni.alagu@sun.com-20100311191817-5nigmq884xo9fuut
Merge from mysql-6.0-codebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
      Open tables used for sub-selects or in stored functions, will also
546
546
      cache these functions.
547
547
    */
548
 
    if (open_and_lock_tables(thd, table_list->next_global))
 
548
    if (open_and_lock_tables(thd, table_list->next_global, TRUE, 0))
549
549
    {
550
550
      end_delayed_insert(thd);
551
551
      DBUG_RETURN(TRUE);
569
569
    Use a normal insert.
570
570
  */
571
571
  table_list->lock_type= TL_WRITE;
572
 
  DBUG_RETURN(open_and_lock_tables(thd, table_list));
 
572
  DBUG_RETURN(open_and_lock_tables(thd, table_list, TRUE, 0));
573
573
}
574
574
 
575
575
 
608
608
  /*
609
609
    log_on is about delayed inserts only.
610
610
    By default, both logs are enabled (this won't cause problems if the server
611
 
    runs without --log-update or --log-bin).
 
611
    runs without --log-bin).
612
612
  */
613
613
  bool log_on= ((thd->variables.option_bits & OPTION_BIN_LOG) ||
614
614
                (!(thd->security_ctx->master_access & SUPER_ACL)));
651
651
  }
652
652
  else
653
653
  {
654
 
    if (open_and_lock_tables(thd, table_list))
 
654
    if (open_and_lock_tables(thd, table_list, TRUE, 0))
655
655
    {
656
656
      MYSQL_INSERT_DONE(1, 0);
657
657
      DBUG_RETURN(TRUE);
3640
3640
 
3641
3641
      if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE))
3642
3642
      {
3643
 
        Open_table_context ot_ctx_unused(thd);
 
3643
        Open_table_context ot_ctx_unused(thd, LONG_TIMEOUT);
3644
3644
        /*
3645
3645
          Here we open the destination table, on which we already have
3646
3646
          an exclusive metadata lock.
3659
3659
      }
3660
3660
      else
3661
3661
      {
3662
 
        Open_table_context ot_ctx_unused(thd);
 
3662
        Open_table_context ot_ctx_unused(thd, LONG_TIMEOUT);
3663
3663
        if (open_table(thd, create_table, thd->mem_root, &ot_ctx_unused,
3664
3664
                       MYSQL_OPEN_TEMPORARY_ONLY))
3665
3665
        {