~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_access.cc

  • Committer: Brian Aker
  • Date: 2010-01-22 00:53:13 UTC
  • Revision ID: brian@gaz-20100122005313-jmizcbcdi1lt4tcx
Revert db patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "mysys_priv.h"
17
 
#include <mystrings/m_string.h>
 
16
#include "drizzled/internal/mysys_priv.h"
 
17
#include "drizzled/internal/m_string.h"
18
18
 
19
19
/*
20
20
  List of file names that causes problem on windows
21
21
 
22
22
  NOTE that one can also not have file names of type CON.TXT
23
 
  
 
23
 
24
24
  NOTE: it is important to keep "CLOCK$" on the first place,
25
25
  we skip it in check_if_legal_tablename.
26
26
*/
30
30
  "CON", "PRN", "AUX", "NUL",
31
31
  "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
32
32
  "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
33
 
  NullS
 
33
  NULL
34
34
};
35
35
 
36
 
#define MAX_RESERVED_NAME_LENGTH 6
37
 
 
38
36
 
39
37
/*
40
38
  Looks up a null-terminated string in a list,
41
39
  case insensitively.
42
 
 
 
40
 
43
41
  SYNOPSIS
44
42
    str_list_find()
45
43
    list        list of items
54
52
  const char **name;
55
53
  for (name= list; *name; name++)
56
54
  {
57
 
    if (!my_strcasecmp(&my_charset_latin1, *name, str))
 
55
    if (!my_strcasecmp(&my_charset_utf8_general_ci, *name, str))
58
56
      return 1;
59
57
  }
60
58
  return 0;
91
89
 
92
90
/*
93
91
  Check if a table name may cause problems
94
 
 
 
92
 
95
93
  SYNOPSIS
96
94
    check_if_legal_tablename
97
95
    name        Table name (without any extensions)
109
107
 
110
108
int check_if_legal_tablename(const char *name)
111
109
{
112
 
  return((reserved_map[(uchar) name[0]] & 1) &&
113
 
              (reserved_map[(uchar) name[1]] & 2) &&
114
 
              (reserved_map[(uchar) name[2]] & 4) &&
 
110
  return((reserved_map[(unsigned char) name[0]] & 1) &&
 
111
              (reserved_map[(unsigned char) name[1]] & 2) &&
 
112
              (reserved_map[(unsigned char) name[2]] & 4) &&
115
113
              str_list_find(&reserved_names[1], name));
116
114
}
117
115