~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2009-05-15 07:40:30 UTC
  • mfrom: (1019.1.7 merge)
  • Revision ID: brian@gaz-20090515074030-che1sh7nqadhyj45
Code / Style cleanup merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1306
1306
  }
1307
1307
  case SQLCOM_FLUSH:
1308
1308
  {
1309
 
    bool write_to_binlog;
1310
 
 
1311
1309
    /*
1312
1310
      reload_cache() will tell us if we are allowed to write to the
1313
1311
      binlog or not.
1314
1312
    */
1315
 
    if (!reload_cache(session, lex->type, first_table, &write_to_binlog))
 
1313
    if (!reload_cache(session, lex->type, first_table))
1316
1314
    {
1317
1315
      /*
1318
1316
        We WANT to write and we CAN write.
2018
2016
    ptr->schema_table= schema_table;
2019
2017
  }
2020
2018
  ptr->select_lex=  lex->current_select;
2021
 
  ptr->cacheable_table= 1;
2022
2019
  ptr->index_hints= index_hints_arg;
2023
2020
  ptr->option= option ? option->str : 0;
2024
2021
  /* check that used name is unique */
2493
2490
    @retval !=0  Error; session->killed is set or session->is_error() is true
2494
2491
*/
2495
2492
 
2496
 
bool reload_cache(Session *session, ulong options, TableList *tables, bool *write_to_binlog)
 
2493
bool reload_cache(Session *session, ulong options, TableList *tables)
2497
2494
{
2498
2495
  bool result=0;
2499
2496
  select_errors=0;                              /* Write if more errors */
2500
 
  bool tmp_write_to_binlog= 1;
2501
2497
 
2502
2498
  if (options & REFRESH_LOG)
2503
2499
  {
2504
 
    /*
2505
 
      Flush the normal query log, the update log, the binary log,
2506
 
      the slow query log, the relay log (if it exists) and the log
2507
 
      tables.
2508
 
    */
2509
 
 
2510
 
    /*
2511
 
      Writing this command to the binlog may result in infinite loops
2512
 
      when doing mysqlbinlog|mysql, and anyway it does not really make
2513
 
      sense to log it automatically (would cause more trouble to users
2514
 
      than it would help them)
2515
 
    */
2516
 
    tmp_write_to_binlog= 0;
2517
 
 
2518
2500
    if (ha_flush_logs(NULL))
2519
2501
      result=1;
2520
2502
  }
2545
2527
          }
2546
2528
        }
2547
2529
      }
2548
 
      /*
2549
 
        Writing to the binlog could cause deadlocks, as we don't log
2550
 
        UNLOCK TABLES
2551
 
      */
2552
 
      tmp_write_to_binlog= 0;
2553
2530
      if (lock_global_read_lock(session))
2554
2531
        return 1;                               // Killed
2555
2532
      result= close_cached_tables(session, tables, false, (options & REFRESH_FAST) ?
2567
2544
  }
2568
2545
  if (session && (options & REFRESH_STATUS))
2569
2546
    session->refresh_status();
2570
 
 *write_to_binlog= tmp_write_to_binlog;
2571
2547
 
2572
2548
 return result;
2573
2549
}
2827
2803
    if (match)
2828
2804
    {
2829
2805
      my_error(ER_NONUNIQ_TABLE, MYF(0), elem->alias);
2830
 
      return(NULL);
 
2806
      return NULL;
2831
2807
    }
2832
2808
 
2833
2809
    match= elem;