~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_db.cc

Merged uint fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
{array_elements(del_exts)-1,"del_exts", del_exts, NULL};
36
36
 
37
37
static long mysql_rm_known_files(THD *thd, MY_DIR *dirp,
38
 
                                 const char *db, const char *path, uint level, 
 
38
                                 const char *db, const char *path, uint32_t level, 
39
39
                                 TableList **dropped_tables);
40
40
         
41
41
static bool rm_dir_w_symlink(const char *org_path, bool send_error);
54
54
typedef struct my_dblock_st
55
55
{
56
56
  char *name;        /* Database name        */
57
 
  uint name_length;  /* Database length name */
 
57
  uint32_t name_length;  /* Database length name */
58
58
} my_dblock_t;
59
59
 
60
60
 
88
88
  Delete a database lock entry from hash.
89
89
*/
90
90
 
91
 
void lock_db_delete(const char *name, uint length)
 
91
void lock_db_delete(const char *name, uint32_t length)
92
92
{
93
93
  my_dblock_t *opt;
94
94
  safe_mutex_assert_owner(&LOCK_lock_db);
107
107
typedef struct my_dbopt_st
108
108
{
109
109
  char *name;                   /* Database name                  */
110
 
  uint name_length;             /* Database length name           */
 
110
  uint32_t name_length;         /* Database length name           */
111
111
  const CHARSET_INFO *charset;  /* Database default character set */
112
112
} my_dbopt_t;
113
113
 
131
131
  Helper function to write a query to binlog used by mysql_rm_db()
132
132
*/
133
133
 
134
 
static inline void write_to_binlog(THD *thd, char *query, uint q_len,
135
 
                                   char *db, uint db_len)
 
134
static inline void write_to_binlog(THD *thd, char *query, uint32_t q_len,
 
135
                                   char *db, uint32_t db_len)
136
136
{
137
137
  Query_log_event qinfo(thd, query, q_len, 0, 0);
138
138
  qinfo.error_code= 0;
237
237
static bool get_dbopt(const char *dbname, HA_CREATE_INFO *create)
238
238
{
239
239
  my_dbopt_t *opt;
240
 
  uint length;
 
240
  uint32_t length;
241
241
  bool error= true;
242
242
  
243
243
  length= (uint) strlen(dbname);
268
268
static bool put_dbopt(const char *dbname, HA_CREATE_INFO *create)
269
269
{
270
270
  my_dbopt_t *opt;
271
 
  uint length;
 
271
  uint32_t length;
272
272
  bool error= false;
273
273
 
274
274
  length= (uint) strlen(dbname);
529
529
  long result= 1;
530
530
  int error= 0;
531
531
  struct stat stat_info;
532
 
  uint create_options= create_info ? create_info->options : 0;
533
 
  uint path_len;
 
532
  uint32_t create_options= create_info ? create_info->options : 0;
 
533
  uint32_t path_len;
534
534
 
535
535
  /* do not create 'information_schema' db */
536
536
  if (!my_strcasecmp(system_charset_info, db, INFORMATION_SCHEMA_NAME.str))
617
617
  if (!silent)
618
618
  {
619
619
    char *query;
620
 
    uint query_length;
 
620
    uint32_t query_length;
621
621
 
622
622
    if (!thd->query)                            // Only in replication
623
623
    {
764
764
  int error= false;
765
765
  char  path[FN_REFLEN+16];
766
766
  MY_DIR *dirp;
767
 
  uint length;
 
767
  uint32_t length;
768
768
  TableList* dropped_tables= 0;
769
769
 
770
770
  if (db && (strcmp(db, "information_schema") == 0))
874
874
  {
875
875
    char *query, *query_pos, *query_end, *query_data_start;
876
876
    TableList *tbl;
877
 
    uint db_len;
 
877
    uint32_t db_len;
878
878
 
879
879
    if (!(query= (char*) thd->alloc(MAX_DROP_TABLE_Q_LEN)))
880
880
      goto exit; /* not much else we can do */
884
884
 
885
885
    for (tbl= dropped_tables; tbl; tbl= tbl->next_local)
886
886
    {
887
 
      uint tbl_name_len;
 
887
      uint32_t tbl_name_len;
888
888
 
889
889
      /* 3 for the quotes and the comma*/
890
890
      tbl_name_len= strlen(tbl->table_name) + 3;
929
929
*/
930
930
 
931
931
static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
932
 
                                 const char *org_path, uint level,
 
932
                                 const char *org_path, uint32_t level,
933
933
                                 TableList **dropped_tables)
934
934
{
935
935
  long deleted=0;
939
939
 
940
940
  tot_list_next= &tot_list;
941
941
 
942
 
  for (uint idx=0 ;
 
942
  for (uint32_t idx=0 ;
943
943
       idx < (uint) dirp->number_off_files && !thd->killed ;
944
944
       idx++)
945
945
  {
1429
1429
bool check_db_dir_existence(const char *db_name)
1430
1430
{
1431
1431
  char db_dir_path[FN_REFLEN];
1432
 
  uint db_dir_path_len;
 
1432
  uint32_t db_dir_path_len;
1433
1433
 
1434
1434
  db_dir_path_len= build_table_filename(db_dir_path, sizeof(db_dir_path),
1435
1435
                                        db_name, "", "", 0);