~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.cc

Merged with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3038
3038
  st_table_exists_in_engine_args args= {db, name, HA_ERR_NO_SUCH_TABLE};
3039
3039
  plugin_foreach(session, table_exists_in_engine_handlerton,
3040
3040
                 DRIZZLE_STORAGE_ENGINE_PLUGIN, &args);
 
3041
 
 
3042
  if(args.err==HA_ERR_NO_SUCH_TABLE)
 
3043
  {
 
3044
    /* Default way of knowing if a table exists. (checking .frm exists) */
 
3045
 
 
3046
    char path[FN_REFLEN];
 
3047
    build_table_filename(path, sizeof(path),
 
3048
                         db, name, ".frm", 0);
 
3049
    if (!access(path, F_OK))
 
3050
      args.err= HA_ERR_TABLE_EXIST;
 
3051
    else
 
3052
      args.err= HA_ERR_NO_SUCH_TABLE;
 
3053
  }
 
3054
 
3041
3055
  return(args.err);
3042
3056
}
3043
3057