~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Grant Limberg
  • Date: 2008-08-12 21:13:01 UTC
  • mto: (322.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: grant@glsoftware.net-20080812211301-ym3wsowelkgp16s2
renamed all instances of MYSQL_ to DRIZZLE_

Show diffs side-by-side

added added

removed removed

Lines of Context:
2054
2054
                        If this is a NULL pointer, then the table is not
2055
2055
                        put in the thread-open-list.
2056
2056
    flags               Bitmap of flags to modify how open works:
2057
 
                          MYSQL_LOCK_IGNORE_FLUSH - Open table even if
 
2057
                          DRIZZLE_LOCK_IGNORE_FLUSH - Open table even if
2058
2058
                          someone has done a flush or namelock on it.
2059
2059
                          No version number checking is done.
2060
 
                          MYSQL_OPEN_TEMPORARY_ONLY - Open only temporary
 
2060
                          DRIZZLE_OPEN_TEMPORARY_ONLY - Open only temporary
2061
2061
                          table not the base table or view.
2062
2062
 
2063
2063
  IMPLEMENTATION
2134
2134
    }
2135
2135
  }
2136
2136
 
2137
 
  if (flags & MYSQL_OPEN_TEMPORARY_ONLY)
 
2137
  if (flags & DRIZZLE_OPEN_TEMPORARY_ONLY)
2138
2138
  {
2139
2139
    my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->table_name);
2140
2140
    return(0);
2255
2255
  if (!thd->open_tables)
2256
2256
    thd->version=refresh_version;
2257
2257
  else if ((thd->version != refresh_version) &&
2258
 
           ! (flags & MYSQL_LOCK_IGNORE_FLUSH))
 
2258
           ! (flags & DRIZZLE_LOCK_IGNORE_FLUSH))
2259
2259
  {
2260
2260
    /* Someone did a refresh while thread was opening tables */
2261
2261
    if (refresh)
2310
2310
    */
2311
2311
    if (table->needs_reopen_or_name_lock())
2312
2312
    {
2313
 
      if (flags & MYSQL_LOCK_IGNORE_FLUSH)
 
2313
      if (flags & DRIZZLE_LOCK_IGNORE_FLUSH)
2314
2314
      {
2315
2315
        /* Force close at once after usage */
2316
2316
        thd->version= table->s->version;
2689
2689
  TABLE *table,*next,**prev;
2690
2690
  TABLE **tables,**tables_ptr;                  // For locks
2691
2691
  bool error=0, not_used;
2692
 
  const uint flags= MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN |
2693
 
                    MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK |
2694
 
                    MYSQL_LOCK_IGNORE_FLUSH;
 
2692
  const uint flags= DRIZZLE_LOCK_NOTIFY_IF_NEED_REOPEN |
 
2693
                    DRIZZLE_LOCK_IGNORE_GLOBAL_READ_LOCK |
 
2694
                    DRIZZLE_LOCK_IGNORE_FLUSH;
2695
2695
 
2696
2696
  if (!thd->open_tables)
2697
2697
    return(0);
2740
2740
  *prev=0;
2741
2741
  if (tables != tables_ptr)                     // Should we get back old locks
2742
2742
  {
2743
 
    MYSQL_LOCK *lock;
 
2743
    DRIZZLE_LOCK *lock;
2744
2744
    /*
2745
2745
      We should always get these locks. Anyway, we must not go into
2746
2746
      wait_for_tables() as it tries to acquire LOCK_open, which is
3267
3267
    start - list of tables in/out
3268
3268
    counter - number of opened tables will be return using this parameter
3269
3269
    flags   - bitmap of flags to modify how the tables will be open:
3270
 
              MYSQL_LOCK_IGNORE_FLUSH - open table even if someone has
 
3270
              DRIZZLE_LOCK_IGNORE_FLUSH - open table even if someone has
3271
3271
              done a flush or namelock on it.
3272
3272
 
3273
3273
  NOTE
3611
3611
    thd         - thread handler
3612
3612
    tables      - list of tables for open
3613
3613
    flags       - bitmap of flags to modify how the tables will be open:
3614
 
                  MYSQL_LOCK_IGNORE_FLUSH - open table even if someone has
 
3614
                  DRIZZLE_LOCK_IGNORE_FLUSH - open table even if someone has
3615
3615
                  done a flush or namelock on it.
3616
3616
 
3617
3617
  RETURN
3801
3801
  {
3802
3802
    assert(thd->lock == 0);     // You must lock everything at once
3803
3803
    TABLE **start,**ptr;
3804
 
    uint lock_flag= MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN;
 
3804
    uint lock_flag= DRIZZLE_LOCK_NOTIFY_IF_NEED_REOPEN;
3805
3805
 
3806
3806
    if (!(ptr=start=(TABLE**) thd->alloc(sizeof(TABLE*)*count)))
3807
3807
      return(-1);
6628
6628
  for (TABLE_LIST *tables= table_list; tables; tables= tables->next_global)
6629
6629
  {
6630
6630
    TABLE *table= open_table(thd, tables, thd->mem_root, &not_used,
6631
 
                             MYSQL_LOCK_IGNORE_FLUSH);
 
6631
                             DRIZZLE_LOCK_IGNORE_FLUSH);
6632
6632
    if (!table)
6633
6633
      goto error;
6634
6634
 
6647
6647
      *(ptr++)= tables->table;
6648
6648
 
6649
6649
    thd->lock= mysql_lock_tables(thd, list, count,
6650
 
                                 MYSQL_LOCK_IGNORE_FLUSH, &not_used);
 
6650
                                 DRIZZLE_LOCK_IGNORE_FLUSH, &not_used);
6651
6651
  }
6652
6652
  if (thd->lock)
6653
6653
    return(false);