~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/mysql_priv.h

  • Committer: Andrey Hristov
  • Date: 2008-08-06 00:04:45 UTC
  • mto: (264.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: ahristov@mysql.com-20080806000445-84urmltikgwk9v5d
Constify the usage of CHARSET_INFO almost to the last place in the code.
99% of the parameters are const CHARSET_INFO * const cs.
Wherever possible stack variables are also double consted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
#define PREV_BITS(type,A)       ((type) (((type) 1 << (A)) -1))
101
101
#define all_bits_set(A,B) ((A) & (B) != (B))
102
102
 
103
 
extern CHARSET_INFO *system_charset_info, *files_charset_info ;
104
 
extern CHARSET_INFO *national_charset_info, *table_alias_charset;
 
103
extern const CHARSET_INFO *system_charset_info, *files_charset_info ;
 
104
extern const CHARSET_INFO *national_charset_info, *table_alias_charset;
105
105
 
106
106
enum Derivation
107
107
{
1000
1000
                       Item *default_value, Item *on_update_value,
1001
1001
                       LEX_STRING *comment,
1002
1002
                       char *change, List<String> *interval_list,
1003
 
                       CHARSET_INFO *cs);
 
1003
                       const CHARSET_INFO * const cs);
1004
1004
Create_field * new_create_field(THD *thd, char *field_name, enum_field_types type,
1005
1005
                                char *length, char *decimals,
1006
1006
                                uint type_modifier, 
1252
1252
extern enum_field_types agg_field_type(Item **items, uint nitems);
1253
1253
 
1254
1254
/* strfunc.cc */
1255
 
uint64_t find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs,
 
1255
uint64_t find_set(TYPELIB *lib, const char *x, uint length, const CHARSET_INFO * const cs,
1256
1256
                   char **err_pos, uint *err_len, bool *set_warning);
1257
1257
uint find_type(const TYPELIB *lib, const char *find, uint length,
1258
1258
               bool part_match);
1259
1259
uint find_type2(const TYPELIB *lib, const char *find, uint length,
1260
 
                CHARSET_INFO *cs);
 
1260
                const CHARSET_INFO *cs);
1261
1261
void unhex_type2(TYPELIB *lib);
1262
1262
uint check_word(TYPELIB *lib, const char *val, const char *end,
1263
1263
                const char **end_of_word);
1264
1264
int find_string_in_array(LEX_STRING * const haystack, LEX_STRING * const needle,
1265
 
                         CHARSET_INFO * const cs);
 
1265
                         const CHARSET_INFO * const cs);
1266
1266
 
1267
1267
 
1268
1268
bool is_keyword(const char *name, uint len);
1274
1274
bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
1275
1275
bool load_db_opt_by_name(THD *thd, const char *db_name,
1276
1276
                         HA_CREATE_INFO *db_create_info);
1277
 
CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name);
 
1277
const CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name);
1278
1278
bool my_dbopt_init(void);
1279
1279
void my_dbopt_cleanup(void);
1280
1280
extern int creating_database; // How many database locks are made
1290
1290
extern uint mysql_data_home_len;
1291
1291
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
1292
1292
            mysql_real_data_home[], mysql_unpacked_real_data_home[];
1293
 
extern CHARSET_INFO *character_set_filesystem;
 
1293
extern const CHARSET_INFO *character_set_filesystem;
1294
1294
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
1295
1295
#ifdef MYSQL_SERVER
1296
1296
extern char *opt_mysql_tmpdir, mysql_charsets_dir[];
1631
1631
/* Conversion functions */
1632
1632
#endif /* MYSQL_SERVER */
1633
1633
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
1634
 
uint strconvert(CHARSET_INFO *from_cs, const char *from,
1635
 
                CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
 
1634
uint strconvert(const CHARSET_INFO * const from_cs, const char *from,
 
1635
                const CHARSET_INFO * const to_cs, char *to, uint to_length, uint *errors);
1636
1636
uint filename_to_tablename(const char *from, char *to, uint to_length);
1637
1637
uint tablename_to_filename(const char *from, char *to, uint to_length);
1638
1638
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */