~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Stewart Smith
  • Date: 2009-02-02 04:55:56 UTC
  • mto: (859.1.1 nofrm)
  • mto: This revision was merged to the branch mainline in revision 822.
  • Revision ID: stewart@flamingspork.com-20090202045556-mwmdwi60el6a371r
re-introduce db.opt, but with parsing it from disk instead of in process cache with mutex.

Write db.opt safely (temp file, rename).

LOCK_drizzle_create_db can likely easily go now.

schema.proto: remove charset as it is standard, we only care about collation.

We don't change the epic fail that is the lack of error checking in show.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
390
390
  String buffer(buff, sizeof(buff), system_charset_info);
391
391
  Protocol *protocol=session->protocol;
392
392
 
393
 
  if (store_db_create_info(dbname, &buffer, create_info))
 
393
  if (store_db_create_info(session, dbname, &buffer, create_info))
394
394
  {
395
395
    /*
396
396
      This assumes that the only reason for which store_db_create_info()
925
925
  @returns true if errors are detected, false otherwise.
926
926
*/
927
927
 
928
 
bool store_db_create_info(const char *dbname, String *buffer,
 
928
bool store_db_create_info(Session *session, const char *dbname, String *buffer,
929
929
                          HA_CREATE_INFO *create_info)
930
930
{
931
931
  HA_CREATE_INFO create;
941
941
  {
942
942
    if (check_db_dir_existence(dbname))
943
943
      return(true);
 
944
 
 
945
    load_db_opt_by_name(session, dbname, &create);
944
946
  }
945
947
 
946
948
  buffer->length(0);
2679
2681
      continue;
2680
2682
    }
2681
2683
    {
 
2684
      HA_CREATE_INFO create;
 
2685
      load_db_opt_by_name(session, db_name->str, &create);
 
2686
 
2682
2687
      if (store_schema_shemata(session, table, db_name,
2683
 
                               system_charset_info))
 
2688
                               create.default_table_charset))
2684
2689
        return(1);
2685
2690
    }
2686
2691
  }