~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:16:35 UTC
  • mto: This revision was merged to the branch mainline in revision 1021.
  • Revision ID: brian@gaz-20090515071635-chkog3hw0ht2f8mw
A number of random cleanups.

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.
2492
2490
    @retval !=0  Error; session->killed is set or session->is_error() is true
2493
2491
*/
2494
2492
 
2495
 
bool reload_cache(Session *session, ulong options, TableList *tables, bool *write_to_binlog)
 
2493
bool reload_cache(Session *session, ulong options, TableList *tables)
2496
2494
{
2497
2495
  bool result=0;
2498
2496
  select_errors=0;                              /* Write if more errors */
2499
 
  bool tmp_write_to_binlog= 1;
2500
2497
 
2501
2498
  if (options & REFRESH_LOG)
2502
2499
  {
2503
 
    /*
2504
 
      Flush the normal query log, the update log, the binary log,
2505
 
      the slow query log, the relay log (if it exists) and the log
2506
 
      tables.
2507
 
    */
2508
 
 
2509
 
    /*
2510
 
      Writing this command to the binlog may result in infinite loops
2511
 
      when doing mysqlbinlog|mysql, and anyway it does not really make
2512
 
      sense to log it automatically (would cause more trouble to users
2513
 
      than it would help them)
2514
 
    */
2515
 
    tmp_write_to_binlog= 0;
2516
 
 
2517
2500
    if (ha_flush_logs(NULL))
2518
2501
      result=1;
2519
2502
  }
2544
2527
          }
2545
2528
        }
2546
2529
      }
2547
 
      /*
2548
 
        Writing to the binlog could cause deadlocks, as we don't log
2549
 
        UNLOCK TABLES
2550
 
      */
2551
 
      tmp_write_to_binlog= 0;
2552
2530
      if (lock_global_read_lock(session))
2553
2531
        return 1;                               // Killed
2554
2532
      result= close_cached_tables(session, tables, false, (options & REFRESH_FAST) ?
2566
2544
  }
2567
2545
  if (session && (options & REFRESH_STATUS))
2568
2546
    session->refresh_status();
2569
 
 *write_to_binlog= tmp_write_to_binlog;
2570
2547
 
2571
2548
 return result;
2572
2549
}
2826
2803
    if (match)
2827
2804
    {
2828
2805
      my_error(ER_NONUNIQ_TABLE, MYF(0), elem->alias);
2829
 
      return(NULL);
 
2806
      return NULL;
2830
2807
    }
2831
2808
 
2832
2809
    match= elem;