1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1

into sanja.is.com.ua:/home/bell/mysql/bk/work-explain-4.1


mysql-test/r/func_encrypt.result:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
This commit is contained in:
unknown
2004-05-19 17:09:40 +03:00
149 changed files with 1764 additions and 1473 deletions

View File

@@ -93,7 +93,7 @@ sub add_copyright
{
$start_copyright="/* ";
$line_copyright= " ";
$end_copyright= " */";
$end_copyright= "*/";
}
elsif ($ARGV =~ /-x86\.s$/)
{

View File

@@ -1239,7 +1239,6 @@ static void fix_history(String *final_command)
static int not_in_history(const char *line)
{
HIST_ENTRY *oldhist = history_get(history_length);
int num;
if (oldhist == 0)
return 1;
@@ -1589,7 +1588,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
const char *server_cmd= buffer->ptr();
char cmd_buf[100];
MYSQL_RES *result;
MYSQL_FIELD *fields;
int error;
if (help_arg[0] != '\'')
@@ -1615,7 +1613,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
{
unsigned int num_fields= mysql_num_fields(result);
my_ulonglong num_rows= mysql_num_rows(result);
fields= mysql_fetch_fields(result);
mysql_fetch_fields(result);
if (num_fields==3 && num_rows==1)
{
if (!(cur= mysql_fetch_row(result)))
@@ -2404,6 +2402,10 @@ static int
com_shell(String *buffer, char *line __attribute__((unused)))
{
char *shell_cmd;
/* Skip space from line begin */
while (my_isspace(charset_info, *line))
line++;
if (!(shell_cmd = strchr(line, ' ')))
{
put_info("Usage: \\! shell-command", INFO_ERROR);

View File

@@ -1264,18 +1264,32 @@ static char *field_escape(char *to,const char *from,uint length)
} /* field_escape */
static char *alloc_query_str(ulong size)
{
char *query;
if (!(query= (char*) my_malloc(size, MYF(MY_WME))))
{
ignore_errors= 0; /* Fatal error */
safe_exit(EX_MYSQLERR); /* Force exit */
}
return query;
}
/*
** dumpTable saves database contents as a series of INSERT statements.
*/
static void dumpTable(uint numFields, char *table)
{
char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table;
char *query= query_buf;
MYSQL_RES *res;
MYSQL_FIELD *field;
MYSQL_ROW row;
ulong rownr, row_break, total_length, init_length;
const char *table_type;
int error= 0;
result_table= quote_name(table,table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
@@ -1321,8 +1335,11 @@ static void dumpTable(uint numFields, char *table)
sprintf(buff," FROM %s", result_table);
end= strmov(end,buff);
if (where)
end= strxmov(end, " WHERE ",where,NullS);
if (mysql_query(sock, query))
{
query= alloc_query_str((ulong) (strlen(where) + (end - query) + 10));
end= strxmov(query, query_buf, " WHERE ", where, NullS);
}
if (mysql_real_query(sock, query, (uint) (end - query)))
{
DBerror(sock, "when executing 'SELECT INTO OUTFILE'");
return;
@@ -1339,14 +1356,16 @@ static void dumpTable(uint numFields, char *table)
{
if (!opt_xml && opt_comments)
fprintf(md_result_file,"-- WHERE: %s\n",where);
strxmov(strend(query), " WHERE ",where,NullS);
query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10));
strxmov(query, query_buf, " WHERE ", where, NullS);
}
if (!opt_xml && !opt_compact)
fputs("\n", md_result_file);
if (mysql_query(sock, query))
{
DBerror(sock, "when retrieving data from server");
return;
error= EX_CONSCHECK;
goto err;
}
if (quick)
res=mysql_use_result(sock);
@@ -1355,7 +1374,8 @@ static void dumpTable(uint numFields, char *table)
if (!res)
{
DBerror(sock, "when retrieving data from server");
return;
error= EX_CONSCHECK;
goto err;
}
if (verbose)
fprintf(stderr, "-- Retrieving rows...\n");
@@ -1363,8 +1383,8 @@ static void dumpTable(uint numFields, char *table)
{
fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n",
my_progname, result_table);
safe_exit(EX_CONSCHECK);
return;
error= EX_CONSCHECK;
goto err;
}
if (opt_disable_keys)
@@ -1402,8 +1422,8 @@ static void dumpTable(uint numFields, char *table)
sprintf(query,"%s: Not enough fields from table %s! Aborting.\n",
my_progname, result_table);
fputs(query,stderr);
safe_exit(EX_CONSCHECK);
return;
error= EX_CONSCHECK;
goto err;
}
if (extended_insert)
{
@@ -1422,7 +1442,8 @@ static void dumpTable(uint numFields, char *table)
if (dynstr_realloc(&extended_row,length * 2+2))
{
fputs("Aborting dump (out of memory)",stderr);
safe_exit(EX_EOM);
error= EX_EOM;
goto err;
}
dynstr_append(&extended_row,"'");
extended_row.length +=
@@ -1458,7 +1479,8 @@ static void dumpTable(uint numFields, char *table)
else if (dynstr_append(&extended_row,"NULL"))
{
fputs("Aborting dump (out of memory)",stderr);
safe_exit(EX_EOM);
error= EX_EOM;
goto err;
}
}
else
@@ -1552,8 +1574,8 @@ static void dumpTable(uint numFields, char *table)
result_table,
rownr);
fputs(query,stderr);
safe_exit(EX_CONSCHECK);
return;
error= EX_CONSCHECK;
goto err;
}
if (opt_lock)
fputs("UNLOCK TABLES;\n", md_result_file);
@@ -1563,7 +1585,16 @@ static void dumpTable(uint numFields, char *table)
if (opt_autocommit)
fprintf(md_result_file, "commit;\n");
mysql_free_result(res);
if (query != query_buf)
my_free(query, MYF(MY_ALLOW_ZERO_PTR));
}
return;
err:
if (query != query_buf)
my_free(query, MYF(MY_ALLOW_ZERO_PTR));
safe_exit(error);
return;
} /* dumpTable */

View File

@@ -109,7 +109,7 @@ MYSQL_MANAGER* manager=0;
static char **default_argv;
static const char *load_default_groups[]= { "mysqltest","client",0 };
static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;;
static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;
static FILE* file_stack[MAX_INCLUDE_DEPTH];
static FILE** cur_file;
@@ -1097,7 +1097,7 @@ int do_sync_with_master2(const char* p)
MYSQL_ROW row;
MYSQL* mysql = &cur_con->mysql;
char query_buf[FN_REFLEN+128];
int offset = 0;
int offset= 0, tries= 0;
int rpl_parse;
if (!master_pos.file[0])
@@ -1112,6 +1112,9 @@ int do_sync_with_master2(const char* p)
sprintf(query_buf, "select master_pos_wait('%s', %ld)", master_pos.file,
master_pos.pos + offset);
wait_for_position:
if (mysql_query(mysql, query_buf))
die("line %u: failed in %s: %d: %s", start_lineno, query_buf,
mysql_errno(mysql), mysql_error(mysql));
@@ -1122,8 +1125,20 @@ int do_sync_with_master2(const char* p)
if (!(row = mysql_fetch_row(res)))
die("line %u: empty result in %s", start_lineno, query_buf);
if (!row[0])
{
/*
It may be that the slave SQL thread has not started yet, though START
SLAVE has been issued ?
*/
if (tries++ == 3)
{
die("line %u: could not sync with master ('%s' returned NULL)",
start_lineno, query_buf);
}
sleep(1); /* So at most we will wait 3 seconds and make 4 tries */
mysql_free_result(res);
goto wait_for_position;
}
mysql_free_result(res);
last_result=0;
if (rpl_parse)

View File

@@ -29,19 +29,15 @@
hp_rb_records_in_range()
info HEAP handler
inx Index to use
start_key Start of range. Null pointer if from first key
start_key_len Length of start key
start_search_flag Flag if start key should be included or not
end_key End of range. Null pointer if to last key
end_key_len Length of end key
end_search_flag Flag if start key should be included or not
min_key Min key. Is = 0 if no min range
max_key Max key. Is = 0 if no max range
NOTES
start_search_flag can have one of the following values:
min_key.flag can have one of the following values:
HA_READ_KEY_EXACT Include the key in the range
HA_READ_AFTER_KEY Don't include key in range
end_search_flag can have one of the following values:
max_key.flag can have one of the following values:
HA_READ_BEFORE_KEY Don't include key in range
HA_READ_AFTER_KEY Include all 'end_key' values in the range
@@ -52,11 +48,8 @@
the range.
*/
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
uint start_key_len,
enum ha_rkey_function start_search_flag,
const byte *end_key, uint end_key_len,
enum ha_rkey_function end_search_flag)
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key,
key_range *max_key)
{
ha_rows start_pos, end_pos;
HP_KEYDEF *keyinfo= info->s->keydef + inx;
@@ -67,12 +60,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
info->lastinx= inx;
custom_arg.keyseg= keyinfo->seg;
custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME;
if (start_key)
if (min_key)
{
custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf,
(uchar*) start_key,
start_key_len);
start_pos= tree_record_pos(rb_tree, info->recbuf, start_search_flag,
(uchar*) min_key->key,
min_key->length);
start_pos= tree_record_pos(rb_tree, info->recbuf, min_key->flag,
&custom_arg);
}
else
@@ -80,11 +73,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
start_pos= 0;
}
if (end_key)
if (max_key)
{
custom_arg.key_length= hp_rb_pack_key(keyinfo, (uchar*) info->recbuf,
(uchar*) end_key, end_key_len);
end_pos= tree_record_pos(rb_tree, info->recbuf, end_search_flag,
(uchar*) max_key->key,
max_key->length);
end_pos= tree_record_pos(rb_tree, info->recbuf, max_key->flag,
&custom_arg);
}
else
@@ -100,6 +94,7 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
(end_pos == start_pos ? (ha_rows) 1 : end_pos - start_pos));
}
/* Search after a record based on a key */
/* Sets info->current_ptr to found record */
/* next_flag: Search=0, next=1, prev =2, same =3 */

View File

@@ -182,11 +182,8 @@ extern int heap_disable_indexes(HP_INFO *info);
extern int heap_enable_indexes(HP_INFO *info);
extern int heap_indexes_are_disabled(HP_INFO *info);
extern void heap_update_auto_increment(HP_INFO *info, const byte *record);
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
uint start_key_len,
enum ha_rkey_function start_search_flag,
const byte *end_key, uint end_key_len,
enum ha_rkey_function end_search_flag);
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key,
key_range *max_key);
int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
uint key_len, enum ha_rkey_function find_flag);
extern gptr heap_find(HP_INFO *info,int inx,const byte *key);

View File

@@ -349,6 +349,16 @@ enum data_file_type {
STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD
};
/* For key ranges */
typedef struct st_key_range
{
const byte *key;
uint length;
enum ha_rkey_function flag;
} key_range;
/* For number of records */
#ifdef BIG_TABLES
#define rows2double(A) ulonglong2double(A)

View File

@@ -55,6 +55,12 @@ extern void bitmap_set_bit(MY_BITMAP *map, uint bitmap_bit);
extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size);
extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2);
/* Fast, not thread safe, bitmap functions */
#define bitmap_fast_set_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] |= (1 << ((BIT) & 7))
#define bitmap_fast_clear_bit(MAP, BIT) (MAP)->bitmap[(BIT) / 8] &= ~ (1 << ((BIT) & 7))
#define bitmap_fast_is_set(MAP, BIT) (MAP)->bitmap[(BIT) / 8] & (1 << ((BIT) & 7))
#ifdef __cplusplus
}
#endif

View File

@@ -231,10 +231,7 @@ extern int mi_extra(struct st_myisam_info *file,
enum ha_extra_function function,
void *extra_arg);
extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx,
const byte *start_key,uint start_key_len,
enum ha_rkey_function start_search_flag,
const byte *end_key,uint end_key_len,
enum ha_rkey_function end_search_flag);
key_range *min_key, key_range *max_key);
extern int mi_log(int activate_log);
extern int mi_is_changed(struct st_myisam_info *info);
extern int mi_delete_all_rows(struct st_myisam_info *info);

View File

@@ -101,10 +101,7 @@ extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function,
void *extra_arg);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx,
const byte *start_key,uint start_key_len,
enum ha_rkey_function start_search_flag,
const byte *end_key,uint end_key_len,
enum ha_rkey_function end_search_flag);
key_range *min_key, key_range *max_key);
extern ulonglong myrg_position(MYRG_INFO *info);
#ifdef __cplusplus

View File

@@ -883,7 +883,7 @@ btr_page_reorganize_low(
fprintf(stderr,
"InnoDB: Error: page old data size %lu new data size %lu\n"
"InnoDB: Error: page old max ins size %lu new max ins size %lu\n"
"InnoDB: Make a detailed bug report and send it to mysql@lists.mysql.com\n",
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
(unsigned long) data_size1, (unsigned long) data_size2,
(unsigned long) max_ins_size1,
(unsigned long) max_ins_size2);

View File

@@ -399,7 +399,7 @@ btr_cur_search_to_nth_level(
retry_page_get:
page = buf_page_get_gen(space, page_no, rw_latch, guess,
buf_mode,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
mtr);
if (page == NULL) {
/* This must be a search to perform an insert;
@@ -580,7 +580,7 @@ btr_cur_open_at_index_side(
for (;;) {
page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL,
BUF_GET,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
mtr);
ut_ad(0 == ut_dulint_cmp(tree->id,
btr_page_get_index_id(page)));
@@ -689,7 +689,7 @@ btr_cur_open_at_rnd_pos(
for (;;) {
page = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL,
BUF_GET,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
mtr);
ut_ad(0 == ut_dulint_cmp(tree->id,
btr_page_get_index_id(page)));

View File

@@ -764,7 +764,7 @@ btr_search_guess_on_hash(
success = buf_page_get_known_nowait(latch_mode, page,
BUF_MAKE_YOUNG,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
mtr);
rw_lock_s_unlock(&btr_search_latch);
@@ -1048,7 +1048,7 @@ btr_search_drop_page_hash_when_freed(
having to fear a deadlock. */
page = buf_page_get_gen(space, page_no, RW_S_LATCH, NULL,
BUF_GET_IF_IN_POOL, IB__FILE__, __LINE__,
BUF_GET_IF_IN_POOL, __FILE__, __LINE__,
&mtr);
#ifdef UNIV_SYNC_DEBUG

View File

@@ -1048,7 +1048,7 @@ buf_page_get_gen(
buf_frame_t* guess, /* in: guessed frame or NULL */
ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL,
BUF_GET_NO_LATCH, BUF_GET_NOWAIT */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr) /* in: mini-transaction */
{
@@ -1257,7 +1257,7 @@ buf_page_optimistic_get_func(
frames */
dulint modify_clock,/* in: modify clock value if mode is
..._GUESS_ON_CLOCK */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr) /* in: mini-transaction */
{
@@ -1382,7 +1382,7 @@ buf_page_get_known_nowait(
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */
buf_frame_t* guess, /* in: the known page frame */
ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr) /* in: mini-transaction */
{
@@ -1742,7 +1742,7 @@ buf_page_create(
buf_LRU_add_block(block, FALSE);
#ifdef UNIV_SYNC_DEBUG
buf_block_buf_fix_inc_debug(block, IB__FILE__, __LINE__);
buf_block_buf_fix_inc_debug(block, __FILE__, __LINE__);
#else
buf_block_buf_fix_inc(block);
#endif

View File

@@ -70,7 +70,7 @@ dict_col_reposition_in_cache(
/*=========================*/
dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */
char* new_name); /* in: new table name */
const char* new_name); /* in: new table name */
/**************************************************************************
Removes a column from the data dictionary hash table. */
static
@@ -309,7 +309,7 @@ dict_table_get_index_noninline(
/*===========================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
char* name) /* in: index name */
const char* name) /* in: index name */
{
return(dict_table_get_index(table, name));
}
@@ -693,8 +693,9 @@ directory dict_table_get_low is usually the appropriate function. */
dict_table_t*
dict_table_get(
/*===========*/
/* out: table, NULL if does not exist */
char* table_name, /* in: table name */
/* out: table, NULL if
does not exist */
const char* table_name, /* in: table name */
trx_t* trx) /* in: transaction handle or NULL */
{
dict_table_t* table;
@@ -722,8 +723,9 @@ Returns a table object and increments MySQL open handle count on the table. */
dict_table_t*
dict_table_get_and_increment_handle_count(
/*======================================*/
/* out: table, NULL if does not exist */
char* table_name, /* in: table name */
/* out: table, NULL if
does not exist */
const char* table_name, /* in: table name */
trx_t* trx) /* in: transaction handle or NULL */
{
dict_table_t* table;
@@ -886,7 +888,7 @@ dict_table_rename_in_cache(
/*=======================*/
/* out: TRUE if success */
dict_table_t* table, /* in: table */
char* new_name, /* in: new name */
const char* new_name, /* in: new name */
ibool rename_also_foreigns)/* in: in ALTER TABLE we want
to preserve the original table name
in constraints which reference it */
@@ -1294,7 +1296,7 @@ dict_col_reposition_in_cache(
/*=========================*/
dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */
char* new_name) /* in: new table name */
const char* new_name) /* in: new table name */
{
ulint fold;
@@ -2019,7 +2021,7 @@ dict_foreign_find_index(
column types must match */
{
dict_index_t* index;
char* col_name;
const char* col_name;
ulint i;
index = dict_table_get_first_index(table);
@@ -2567,10 +2569,10 @@ dict_strip_comments(
/* out, own: SQL string stripped from
comments; the caller must free this
with mem_free()! */
char* sql_string) /* in: SQL string */
const char* sql_string) /* in: SQL string */
{
char* str;
char* sptr;
const char* sptr;
char* ptr;
str = mem_alloc(strlen(sql_string) + 1);
@@ -2970,7 +2972,8 @@ col_loop1:
}
foreign->foreign_table = table;
foreign->foreign_table_name = table->name;
foreign->foreign_table_name = mem_heap_strdup(foreign->heap,
table->name);
foreign->foreign_index = index;
foreign->n_fields = i;
foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
@@ -3246,13 +3249,16 @@ dict_create_foreign_constraints(
/*============================*/
/* out: error code or DB_SUCCESS */
trx_t* trx, /* in: transaction */
char* sql_string, /* in: table create or ALTER TABLE
statement where foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
name before it: test.table2; the default
database is the database of parameter name */
char* name) /* in: table full name in the normalized form
const char* sql_string, /* in: table create statement where
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES
table2(c, d), table2 can be written
also with the database
name before it: test.table2; the
default database id the database of
parameter name */
const char* name) /* in: table full name in the
normalized form
database_name/table_name */
{
char* str;
@@ -4287,5 +4293,5 @@ dict_index_name_print(
fputs("index ", file);
ut_print_name(file, index->name);
fputs(" of table ", file);
ut_print_name(stderr, index->table_name);
ut_print_name(file, index->table_name);
}

View File

@@ -27,9 +27,10 @@ Finds the first table name in the given database. */
char*
dict_get_first_table_name_in_db(
/*============================*/
/* out, own: table name, NULL if does not exist;
the caller must free the memory in the string! */
char* name) /* in: database name which ends to '/' */
/* out, own: table name, NULL if
does not exist; the caller must
free the memory in the string! */
const char* name) /* in: database name which ends to '/' */
{
dict_table_t* sys_tables;
btr_pcur_t pcur;
@@ -389,7 +390,7 @@ Report that an index field or index for a table has been delete marked. */
static
void
dict_load_report_deleted_index(
char* name, /* in: table name */
const char* name, /* in: table name */
ulint field) /* in: index field, or ULINT_UNDEFINED */
{
fputs("InnoDB: Error: data dictionary entry"
@@ -688,12 +689,13 @@ dictionary cache. */
dict_table_t*
dict_load_table(
/*============*/
/* out: table, NULL if does not exist; if the table is
stored in an .ibd file, but the file does not exist,
then we set the ibd_file_missing flag TRUE in the table
object we return */
char* name) /* in: table name in the databasename/tablename
format */
/* out: table, NULL if does not exist;
if the table is stored in an .ibd file,
but the file does not exist,
then we set the ibd_file_missing flag TRUE
in the table object we return */
const char* name) /* in: table name in the
databasename/tablename format */
{
ibool ibd_file_missing = FALSE;
dict_table_t* table;
@@ -849,7 +851,7 @@ dict_load_table(
"InnoDB: the foreign key table or the referenced table!\n"
"InnoDB: The data dictionary of InnoDB is corrupt. You may need to drop\n"
"InnoDB: and recreate the foreign key table or the referenced table.\n"
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf);
mutex_exit(&dict_foreign_err_mutex);
@@ -1186,7 +1188,7 @@ ulint
dict_load_foreigns(
/*===============*/
/* out: DB_SUCCESS or error code */
char* table_name) /* in: table name */
const char* table_name) /* in: table name */
{
btr_pcur_t pcur;
mem_heap_t* heap;

View File

@@ -30,7 +30,7 @@ dict_table_t*
dict_mem_table_create(
/*==================*/
/* out, own: table object */
char* name, /* in: table name */
const char* name, /* in: table name */
ulint space, /* in: space where the clustered index of
the table is placed; this parameter is
ignored if the table is made a member of
@@ -38,7 +38,6 @@ dict_mem_table_create(
ulint n_cols) /* in: number of columns */
{
dict_table_t* table;
char* str;
mem_heap_t* heap;
ut_ad(name);
@@ -49,10 +48,8 @@ dict_mem_table_create(
table->heap = heap;
str = mem_heap_strdup(heap, name);
table->type = DICT_TABLE_ORDINARY;
table->name = str;
table->name = mem_heap_strdup(heap, name);
table->space = space;
table->ibd_file_missing = FALSE;
table->tablespace_discarded = FALSE;
@@ -103,11 +100,11 @@ dict_table_t*
dict_mem_cluster_create(
/*====================*/
/* out, own: cluster object */
char* name, /* in: cluster name */
const char* name, /* in: cluster name */
ulint space, /* in: space where the clustered indexes
of the member tables are placed */
ulint n_cols, /* in: number of columns */
ulint mix_len) /* in: length of the common key prefix in the
ulint mix_len)/* in: length of the common key prefix in the
cluster */
{
dict_table_t* cluster;
@@ -127,7 +124,7 @@ void
dict_mem_table_make_cluster_member(
/*===============================*/
dict_table_t* table, /* in: non-published table */
char* cluster_name) /* in: cluster name */
const char* cluster_name) /* in: cluster name */
{
table->type = DICT_TABLE_CLUSTER_MEMBER;
table->cluster_name = cluster_name;
@@ -140,7 +137,7 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
char* name, /* in: column name */
const char* name, /* in: column name */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len, /* in: length */
@@ -175,12 +172,13 @@ dict_index_t*
dict_mem_index_create(
/*==================*/
/* out, own: index object */
char* table_name, /* in: table name */
char* index_name, /* in: index name */
ulint space, /* in: space where the index tree is placed,
ignored if the index is of the clustered
type */
ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
const char* table_name, /* in: table name */
const char* index_name, /* in: index name */
ulint space, /* in: space where the index tree is
placed, ignored if the index is of
the clustered type */
ulint type, /* in: DICT_UNIQUE,
DICT_CLUSTERED, ... ORed */
ulint n_fields) /* in: number of fields */
{
dict_index_t* index;
@@ -259,7 +257,7 @@ void
dict_mem_index_add_field(
/*=====================*/
dict_index_t* index, /* in: index */
char* name, /* in: column name */
const char* name, /* in: column name */
ulint order, /* in: order criterion; 0 means an
ascending order */
ulint prefix_len) /* in: 0 or the column prefix length

View File

@@ -390,11 +390,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
void
fil_node_create(
/*============*/
char* name, /* in: file name (file must be closed) */
ulint size, /* in: file size in database blocks, rounded downwards
to an integer */
const char* name, /* in: file name (file must be closed) */
ulint size, /* in: file size in database blocks, rounded
downwards to an integer */
ulint id, /* in: space id where to append */
ibool is_raw) /* in: TRUE if a raw device or a raw disk partition */
ibool is_raw) /* in: TRUE if a raw device or
a raw disk partition */
{
fil_system_t* system = fil_system;
fil_node_t* node;
@@ -805,7 +806,7 @@ ibool
fil_space_create(
/*=============*/
/* out: TRUE if success */
char* name, /* in: space name */
const char* name, /* in: space name */
ulint id, /* in: space id */
ulint purpose)/* in: FIL_TABLESPACE, or FIL_LOG if log */
{
@@ -1542,15 +1543,17 @@ static
void
fil_op_write_log(
/*=============*/
ulint type, /* in: MLOG_FILE_CREATE, MLOG_FILE_DELETE, or
ulint type, /* in: MLOG_FILE_CREATE,
MLOG_FILE_DELETE, or
MLOG_FILE_RENAME */
ulint space_id, /* in: space id */
char* name, /* in: table name in the familiar
'databasename/tablename' format, or the file
path in the case of MLOG_FILE_DELETE */
char* new_name, /* in: if type is MLOG_FILE_RENAME, the new
table name in the 'databasename/tablename'
format */
const char* name, /* in: table name in the familiar
'databasename/tablename' format, or
the file path in the case of
MLOG_FILE_DELETE */
const char* new_name, /* in: if type is MLOG_FILE_RENAME,
the new table name in the
'databasename/tablename' format */
mtr_t* mtr) /* in: mini-transaction handle */
{
byte* log_ptr;
@@ -1961,13 +1964,14 @@ ibool
fil_rename_tablespace(
/*==================*/
/* out: TRUE if success */
char* old_name, /* in: old table name in the standard
databasename/tablename format of InnoDB, or
NULL if we do the rename based on the space
id only */
const char* old_name, /* in: old table name in the standard
databasename/tablename format of
InnoDB, or NULL if we do the rename
based on the space id only */
ulint id, /* in: space id */
char* new_name) /* in: new table name in the standard
databasename/tablename format of InnoDB */
const char* new_name) /* in: new table name in the standard
databasename/tablename format
of InnoDB */
{
fil_system_t* system = fil_system;
ibool success;
@@ -2125,14 +2129,15 @@ ulint
fil_create_new_single_table_tablespace(
/*===================================*/
/* out: DB_SUCCESS or error code */
ulint* space_id, /* in/out: space id; if this is != 0, then
this is an input parameter, otherwise
output */
char* tablename, /* in: the table name in the usual
databasename/tablename format of InnoDB */
ulint size) /* in: the initial size of the tablespace file
in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE
*/
ulint* space_id, /* in/out: space id; if this is != 0,
then this is an input parameter,
otherwise output */
const char* tablename, /* in: the table name in the usual
databasename/tablename format
of InnoDB */
ulint size) /* in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
{
os_file_t file;
ibool ret;
@@ -2294,11 +2299,11 @@ ibool
fil_reset_too_high_lsns(
/*====================*/
/* out: TRUE if success */
char* name, /* in: table name in the databasename/tablename
format */
dulint current_lsn) /* in: reset lsn's if the lsn stamped to
FIL_PAGE_FILE_FLUSH_LSN in the first page is
too high */
const char* name, /* in: table name in the
databasename/tablename format */
dulint current_lsn) /* in: reset lsn's if the lsn stamped
to FIL_PAGE_FILE_FLUSH_LSN in the
first page is too high */
{
os_file_t file;
char* filepath;
@@ -2435,8 +2440,8 @@ fil_open_single_table_tablespace(
/*=============================*/
/* out: TRUE if success */
ulint id, /* in: space id */
char* name) /* in: table name in the databasename/tablename
format */
const char* name) /* in: table name in the
databasename/tablename format */
{
os_file_t file;
char* filepath;
@@ -2937,20 +2942,22 @@ there may be many tablespaces which are not yet in the memory cache. */
ibool
fil_space_for_table_exists_in_mem(
/*==============================*/
/* out: TRUE if a matching tablespace exists
in the memory cache */
/* out: TRUE if a matching tablespace
exists in the memory cache */
ulint id, /* in: space id */
char* name, /* in: table name in the standard
const char* name, /* in: table name in the standard
'databasename/tablename' format */
ibool mark_space, /* in: in crash recovery, at database startup
we mark all spaces which have an associated
table in the InnoDB data dictionary, so that
ibool mark_space, /* in: in crash recovery, at database
startup we mark all spaces which have
an associated table in the InnoDB
data dictionary, so that
we can print a warning about orphaned
tablespaces */
ibool print_error_if_does_not_exist)
/* in: print detailed error information to
the .err log if a matching tablespace is
not found from memory */
/* in: print detailed error
information to the .err log if a
matching tablespace is not found from
memory */
{
fil_system_t* system = fil_system;
fil_space_t* namespace;

View File

@@ -2770,7 +2770,7 @@ ibuf_insert_to_index_page(
fprintf(stderr, "Bitmap bits %lu\n", (ulong) old_bits);
fputs(
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr);
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
}
}
}
@@ -2833,7 +2833,7 @@ ibuf_delete_rec(
if (!success) {
fprintf(stderr,
"InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n"
"InnoDB: ERROR: Submit the output to http://bugs.mysql.com\n"
"InnoDB: ibuf cursor restoration fails!\n"
"InnoDB: ibuf record inserted to page %lu\n", (ulong) page_no);
fflush(stderr);
@@ -3025,8 +3025,7 @@ ibuf_merge_or_delete_for_page(
"InnoDB: We try to resolve the problem by skipping the insert buffer\n"
"InnoDB: merge for this page. Please run CHECK TABLE on your tables\n"
"InnoDB: to determine if they are corrupt after this.\n\n"
"InnoDB: Please make a detailed bug report and send it to\n"
"InnoDB: mysql@lists.mysql.com\n\n",
"InnoDB: Please submit a detailed bug report to http://bugs.mysql.com\n\n",
(ulong) page_no,
(ulong) fil_page_get_type(page));
}
@@ -3042,7 +3041,7 @@ loop:
if (page) {
ibool success = buf_page_get_known_nowait(RW_X_LATCH, page,
BUF_KEEP_OLD,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
&mtr);
ut_a(success);
#ifdef UNIV_SYNC_DEBUG

View File

@@ -132,7 +132,7 @@ to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed
in LA! */
#define buf_page_get(SP, OF, LA, MTR) buf_page_get_gen(\
SP, OF, LA, NULL,\
BUF_GET, IB__FILE__, __LINE__, MTR)
BUF_GET, __FILE__, __LINE__, MTR)
/******************************************************************
Use these macros to bufferfix a page with no latching. Remember not to
read the contents of the page unless you know it is safe. Do not modify
@@ -141,19 +141,19 @@ error-prone programming not to set a latch, and it should be used
with care. */
#define buf_page_get_with_no_latch(SP, OF, MTR) buf_page_get_gen(\
SP, OF, RW_NO_LATCH, NULL,\
BUF_GET_NO_LATCH, IB__FILE__, __LINE__, MTR)
BUF_GET_NO_LATCH, __FILE__, __LINE__, MTR)
/******************************************************************
NOTE! The following macros should be used instead of buf_page_get_gen, to
improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */
#define buf_page_get_nowait(SP, OF, LA, MTR) buf_page_get_gen(\
SP, OF, LA, NULL,\
BUF_GET_NOWAIT, IB__FILE__, __LINE__, MTR)
BUF_GET_NOWAIT, __FILE__, __LINE__, MTR)
/******************************************************************
NOTE! The following macros should be used instead of
buf_page_optimistic_get_func, to improve debugging. Only values RW_S_LATCH and
RW_X_LATCH are allowed as LA! */
#define buf_page_optimistic_get(LA, BL, G, MC, MTR) buf_page_optimistic_get_func(\
LA, BL, G, MC, IB__FILE__, __LINE__, MTR)
LA, BL, G, MC, __FILE__, __LINE__, MTR)
/************************************************************************
This is the general function used to get optimistic access to a database
page. */
@@ -168,7 +168,7 @@ buf_page_optimistic_get_func(
frames */
dulint modify_clock,/* in: modify clock value if mode is
..._GUESS_ON_CLOCK */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr); /* in: mini-transaction */
/************************************************************************
@@ -201,7 +201,7 @@ buf_page_get_known_nowait(
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH */
buf_frame_t* guess, /* in: the known page frame */
ulint mode, /* in: BUF_MAKE_YOUNG or BUF_KEEP_OLD */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr); /* in: mini-transaction */
/************************************************************************
@@ -217,7 +217,7 @@ buf_page_get_gen(
buf_frame_t* guess, /* in: guessed frame or NULL */
ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL,
BUF_GET_NO_LATCH */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line where called */
mtr_t* mtr); /* in: mini-transaction */
/************************************************************************

View File

@@ -585,7 +585,7 @@ buf_page_get_release_on_io(
frame = buf_page_get_gen(space, offset, rw_latch, guess,
BUF_GET_IF_IN_POOL,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
mtr);
if (frame != NULL) {

View File

@@ -86,7 +86,7 @@ void
dfield_set_data(
/*============*/
dfield_t* field, /* in: field */
void* data, /* in: data */
const void* data, /* in: data */
ulint len); /* in: length or UNIV_SQL_NULL */
/**************************************************************************
Writes an SQL null field full of zeros. */

View File

@@ -93,7 +93,7 @@ void
dfield_set_data(
/*============*/
dfield_t* field, /* in: field */
void* data, /* in: data */
const void* data, /* in: data */
ulint len) /* in: length or UNIV_SQL_NULL */
{
ut_ad(field);

View File

@@ -166,7 +166,7 @@ dict_table_rename_in_cache(
/*=======================*/
/* out: TRUE if success */
dict_table_t* table, /* in: table */
char* new_name, /* in: new name */
const char* new_name, /* in: new name */
ibool rename_also_foreigns);/* in: in ALTER TABLE we want
to preserve the original table name
in constraints which reference it */
@@ -212,13 +212,16 @@ dict_create_foreign_constraints(
/*============================*/
/* out: error code or DB_SUCCESS */
trx_t* trx, /* in: transaction */
char* sql_string, /* in: table create statement where
const char* sql_string, /* in: table create statement where
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
name before it: test.table2; the default
database id the database of parameter name */
char* name); /* in: table full name in the normalized form
FOREIGN KEY (a, b) REFERENCES
table2(c, d), table2 can be written
also with the database
name before it: test.table2; the
default database id the database of
parameter name */
const char* name); /* in: table full name in the
normalized form
database_name/table_name */
/**************************************************************************
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
@@ -246,8 +249,9 @@ directory dict_table_get_low is usually the appropriate function. */
dict_table_t*
dict_table_get(
/*===========*/
/* out: table, NULL if does not exist */
char* table_name, /* in: table name */
/* out: table, NULL if
does not exist */
const char* table_name, /* in: table name */
trx_t* trx); /* in: transaction handle */
/**************************************************************************
Returns a table object and increments MySQL open handle count on the table.
@@ -256,8 +260,9 @@ Returns a table object and increments MySQL open handle count on the table.
dict_table_t*
dict_table_get_and_increment_handle_count(
/*======================================*/
/* out: table, NULL if does not exist */
char* table_name, /* in: table name */
/* out: table, NULL if
does not exist */
const char* table_name, /* in: table name */
trx_t* trx); /* in: transaction handle or NULL */
/**************************************************************************
Returns a table object, based on table id, and memoryfixes it. */
@@ -291,7 +296,7 @@ dict_table_t*
dict_table_check_if_in_cache_low(
/*==============================*/
/* out: table, NULL if not found */
char* table_name); /* in: table name */
const char* table_name); /* in: table name */
/**************************************************************************
Gets a table; loads it to the dictionary cache if necessary. A low-level
function. */
@@ -300,7 +305,7 @@ dict_table_t*
dict_table_get_low(
/*===============*/
/* out: table, NULL if not found */
char* table_name); /* in: table name */
const char* table_name); /* in: table name */
/**************************************************************************
Returns an index object. */
UNIV_INLINE
@@ -309,7 +314,7 @@ dict_table_get_index(
/*=================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
char* name); /* in: index name */
const char* name); /* in: index name */
/**************************************************************************
Returns an index object. */
@@ -318,7 +323,7 @@ dict_table_get_index_noninline(
/*===========================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
char* name); /* in: index name */
const char* name); /* in: index name */
/**************************************************************************
Prints a table data. */
@@ -340,7 +345,7 @@ Prints a table data when we know the table name. */
void
dict_table_print_by_name(
/*=====================*/
char* name);
const char* name);
#endif /* UNIV_DEBUG */
/**************************************************************************
Outputs info on foreign keys of a table. */

View File

@@ -537,7 +537,7 @@ dict_table_t*
dict_table_check_if_in_cache_low(
/*==============================*/
/* out: table, NULL if not found */
char* table_name) /* in: table name */
const char* table_name) /* in: table name */
{
dict_table_t* table;
ulint table_fold;
@@ -563,7 +563,7 @@ dict_table_t*
dict_table_get_low(
/*===============*/
/* out: table, NULL if not found */
char* table_name) /* in: table name */
const char* table_name) /* in: table name */
{
dict_table_t* table;
@@ -642,7 +642,7 @@ dict_table_get_index(
/*=================*/
/* out: index, NULL if does not exist */
dict_table_t* table, /* in: table */
char* name) /* in: index name */
const char* name) /* in: index name */
{
dict_index_t* index = NULL;

View File

@@ -31,9 +31,10 @@ Finds the first table name in the given database. */
char*
dict_get_first_table_name_in_db(
/*============================*/
/* out, own: table name, NULL if does not exist;
the caller must free the memory in the string! */
char* name); /* in: database name which ends to '/' */
/* out, own: table name, NULL if
does not exist; the caller must free
the memory in the string! */
const char* name); /* in: database name which ends to '/' */
/************************************************************************
Loads a table definition and also all its index definitions, and also
the cluster definition if the table is a member in a cluster. Also loads
@@ -43,11 +44,13 @@ a foreign key references columns in this table. */
dict_table_t*
dict_load_table(
/*============*/
/* out: table, NULL if does not exist; if the table is
stored in an .ibd file, but the file does not exist,
then we set the ibd_file_missing flag TRUE in the table
object we return */
char* name); /* in: table name */
/* out: table, NULL if does not exist;
if the table is stored in an .ibd file,
but the file does not exist,
then we set the ibd_file_missing flag TRUE
in the table object we return */
const char* name); /* in: table name in the
databasename/tablename format */
/***************************************************************************
Loads a table object based on the table id. */
@@ -76,7 +79,7 @@ ulint
dict_load_foreigns(
/*===============*/
/* out: DB_SUCCESS or error code */
char* table_name); /* in: table name */
const char* table_name); /* in: table name */
/************************************************************************
Prints to the standard output information on all tables found in the data
dictionary system table. */

View File

@@ -49,11 +49,11 @@ dict_table_t*
dict_mem_table_create(
/*==================*/
/* out, own: table object */
char* name, /* in: table name */
ulint space, /* in: space where the clustered index of
the table is placed; this parameter is
ignored if the table is made a member of
a cluster */
const char* name, /* in: table name */
ulint space, /* in: space where the clustered index
of the table is placed; this parameter
is ignored if the table is made
a member of a cluster */
ulint n_cols); /* in: number of columns */
/**************************************************************************
Creates a cluster memory object. */
@@ -61,14 +61,15 @@ Creates a cluster memory object. */
dict_cluster_t*
dict_mem_cluster_create(
/*====================*/
/* out, own: cluster object (where the type
dict_cluster_t == dict_table_t) */
char* name, /* in: cluster name */
ulint space, /* in: space where the clustered indexes
of the member tables are placed */
/* out, own: cluster object (where the
type dict_cluster_t == dict_table_t) */
const char* name, /* in: cluster name */
ulint space, /* in: space where the clustered
indexes of the member tables are
placed */
ulint n_cols, /* in: number of columns */
ulint mix_len); /* in: length of the common key prefix in the
cluster */
ulint mix_len); /* in: length of the common key prefix
in the cluster */
/**************************************************************************
Declares a non-published table as a member in a cluster. */
@@ -76,7 +77,7 @@ void
dict_mem_table_make_cluster_member(
/*===============================*/
dict_table_t* table, /* in: non-published table */
char* cluster_name); /* in: cluster name */
const char* cluster_name); /* in: cluster name */
/**************************************************************************
Adds a column definition to a table. */
@@ -84,7 +85,7 @@ void
dict_mem_table_add_col(
/*===================*/
dict_table_t* table, /* in: table */
char* name, /* in: column name */
const char* name, /* in: column name */
ulint mtype, /* in: main datatype */
ulint prtype, /* in: precise type */
ulint len, /* in: length */
@@ -96,12 +97,13 @@ dict_index_t*
dict_mem_index_create(
/*==================*/
/* out, own: index object */
char* table_name, /* in: table name */
char* index_name, /* in: index name */
ulint space, /* in: space where the index tree is placed,
ignored if the index is of the clustered
type */
ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
const char* table_name, /* in: table name */
const char* index_name, /* in: index name */
ulint space, /* in: space where the index tree is
placed, ignored if the index is of
the clustered type */
ulint type, /* in: DICT_UNIQUE,
DICT_CLUSTERED, ... ORed */
ulint n_fields); /* in: number of fields */
/**************************************************************************
Adds a field definition to an index. NOTE: does not take a copy
@@ -112,7 +114,7 @@ void
dict_mem_index_add_field(
/*=====================*/
dict_index_t* index, /* in: index */
char* name, /* in: column name */
const char* name, /* in: column name */
ulint order, /* in: order criterion; 0 means an
ascending order */
ulint prefix_len); /* in: 0 or the column prefix length
@@ -142,7 +144,7 @@ struct dict_col_struct{
clustered index */
ulint ord_part;/* count of how many times this column
appears in ordering fields of an index */
char* name; /* name */
const char* name; /* name */
dtype_t type; /* data type */
dict_table_t* table; /* back pointer to table of this column */
ulint aux; /* this is used as an auxiliary variable
@@ -154,7 +156,7 @@ struct dict_col_struct{
/* Data structure for a field in an index */
struct dict_field_struct{
dict_col_t* col; /* pointer to the table column */
char* name; /* name of the column */
const char* name; /* name of the column */
ulint order; /* flags for ordering this field:
DICT_DESCEND, ... */
ulint prefix_len; /* 0 or the length of the column
@@ -197,8 +199,8 @@ struct dict_index_struct{
dulint id; /* id of the index */
mem_heap_t* heap; /* memory heap */
ulint type; /* index type */
char* name; /* index name */
char* table_name; /* table name */
const char* name; /* index name */
const char* table_name; /* table name */
dict_table_t* table; /* back pointer to table */
ulint space; /* space where the index tree is placed */
ulint page_no;/* page number of the index tree root */
@@ -254,12 +256,12 @@ struct dict_foreign_struct{
or DICT_FOREIGN_ON_DELETE_SET_NULL */
char* foreign_table_name;/* foreign table name */
dict_table_t* foreign_table; /* table where the foreign key is */
char** foreign_col_names;/* names of the columns in the
const char** foreign_col_names;/* names of the columns in the
foreign key */
char* referenced_table_name;/* referenced table name */
dict_table_t* referenced_table;/* table where the referenced key
is */
char** referenced_col_names;/* names of the referenced
const char** referenced_col_names;/* names of the referenced
columns in the referenced table */
ulint n_fields; /* number of indexes' first fields
for which the the foreign key
@@ -295,7 +297,7 @@ struct dict_table_struct{
dulint id; /* id of the table or cluster */
ulint type; /* DICT_TABLE_ORDINARY, ... */
mem_heap_t* heap; /* memory heap */
char* name; /* table name */
const char* name; /* table name */
ulint space; /* space where the clustered index of the
table is placed */
ibool ibd_file_missing;/* TRUE if this is in a single-table
@@ -363,7 +365,7 @@ struct dict_table_struct{
byte mix_id_buf[12];
/* mix id of a mixed table written in
a compressed form */
char* cluster_name; /* if the table is a member in a
const char* cluster_name; /* if the table is a member in a
cluster, this is the name of the cluster */
/*----------------------*/
ibool does_not_fit_in_memory;

View File

@@ -132,11 +132,12 @@ Appends a new file to the chain of files of a space. File must be closed. */
void
fil_node_create(
/*============*/
char* name, /* in: file name (file must be closed) */
ulint size, /* in: file size in database blocks, rounded downwards
to an integer */
const char* name, /* in: file name (file must be closed) */
ulint size, /* in: file size in database blocks, rounded
downwards to an integer */
ulint id, /* in: space id where to append */
ibool is_raw);/* in: TRUE if a raw device or a raw disk partition */
ibool is_raw);/* in: TRUE if a raw device or
a raw disk partition */
/********************************************************************
Drops files from the start of a file space, so that its size is cut by
the amount given. */
@@ -156,7 +157,7 @@ ibool
fil_space_create(
/*=============*/
/* out: TRUE if success */
char* name, /* in: space name */
const char* name, /* in: space name */
ulint id, /* in: space id */
ulint purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log */
/***********************************************************************
@@ -328,13 +329,14 @@ ibool
fil_rename_tablespace(
/*==================*/
/* out: TRUE if success */
char* old_name, /* in: old table name in the standard
databasename/tablename format of InnoDB, or
NULL if we do the rename based on the space
id only */
const char* old_name, /* in: old table name in the standard
databasename/tablename format of
InnoDB, or NULL if we do the rename
based on the space id only */
ulint id, /* in: space id */
char* new_name); /* in: new table name in the standard
databasename/tablename format of InnoDB */
const char* new_name); /* in: new table name in the standard
databasename/tablename format
of InnoDB */
/***********************************************************************
Creates a new single-table tablespace to a database directory of MySQL.
Database directories are under the 'datadir' of MySQL. The datadir is the
@@ -345,13 +347,15 @@ ulint
fil_create_new_single_table_tablespace(
/*===================================*/
/* out: DB_SUCCESS or error code */
ulint* space_id, /* in/out: space id; if this is != 0, then
this is an input parameter, otherwise
output */
char* tablename, /* in: the table name in the usual
databasename/tablename format of InnoDB */
ulint size); /* in: the initial size of the tablespace file
in pages, must be > 0 */
ulint* space_id, /* in/out: space id; if this is != 0,
then this is an input parameter,
otherwise output */
const char* tablename, /* in: the table name in the usual
databasename/tablename format
of InnoDB */
ulint size); /* in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
/************************************************************************
Tries to open a single-table tablespace and checks the space id is right in
it. If does not succeed, prints an error message to the .err log. This
@@ -364,8 +368,8 @@ fil_open_single_table_tablespace(
/*=============================*/
/* out: TRUE if success */
ulint id, /* in: space id */
char* name); /* in: table name in the databasename/tablename
format */
const char* name); /* in: table name in the
databasename/tablename format */
/************************************************************************
It is possible, though very improbable, that the lsn's in the tablespace to be
imported have risen above the current system lsn, if a lengthy purge, ibuf
@@ -380,11 +384,11 @@ ibool
fil_reset_too_high_lsns(
/*====================*/
/* out: TRUE if success */
char* name, /* in: table name in the databasename/tablename
format */
dulint current_lsn); /* in: reset lsn's if the lsn stamped to
FIL_PAGE_FILE_FLUSH_LSN in the first page is
too high */
const char* name, /* in: table name in the
databasename/tablename format */
dulint current_lsn); /* in: reset lsn's if the lsn stamped
to FIL_PAGE_FILE_FLUSH_LSN in the
first page is too high */
/************************************************************************
At the server startup, if we need crash recovery, scans the database
directories under the MySQL datadir, looking for .ibd files. Those files are
@@ -439,17 +443,19 @@ fil_space_for_table_exists_in_mem(
/* out: TRUE if a matching tablespace
exists in the memory cache */
ulint id, /* in: space id */
char* name, /* in: table name in the standard
const char* name, /* in: table name in the standard
'databasename/tablename' format */
ibool mark_space, /* in: in crash recovery, at database startup
we mark all spaces which have an associated
table in the InnoDB data dictionary, so that
ibool mark_space, /* in: in crash recovery, at database
startup we mark all spaces which have
an associated table in the InnoDB
data dictionary, so that
we can print a warning about orphaned
tablespaces */
ibool print_error_if_does_not_exist);
/* in: print detailed error information to
the .err log if a matching tablespace is
not found from memory */
/* in: print detailed error
information to the .err log if a
matching tablespace is not found from
memory */
/**************************************************************************
Tries to extend a data file so that it would accommodate the number of pages
given. The tablespace must be cached in the memory cache. If the space is big

View File

@@ -64,14 +64,14 @@ heap creation. */
#define mem_heap_create(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_DYNAMIC,\
IB__FILE__, __LINE__)
__FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
#define mem_heap_create_in_buffer(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BUFFER,\
IB__FILE__, __LINE__)
__FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap creation. */
@@ -79,7 +79,7 @@ heap creation. */
#define mem_heap_create_in_btr_search(N) mem_heap_create_func(\
(N), NULL, MEM_HEAP_BTR_SEARCH |\
MEM_HEAP_BUFFER,\
IB__FILE__, __LINE__)
__FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for fast
memory heap creation. An initial block of memory B is given by the
@@ -88,14 +88,14 @@ mem_heap_free. See the parameter comment in mem_heap_create_func below. */
#define mem_heap_fast_create(N, B) mem_heap_create_func(\
(N), (B), MEM_HEAP_DYNAMIC,\
IB__FILE__, __LINE__)
__FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function! Macro for memory
heap freeing. */
#define mem_heap_free(heap) mem_heap_free_func(\
(heap), IB__FILE__, __LINE__)
(heap), __FILE__, __LINE__)
/*********************************************************************
NOTE: Use the corresponding macros instead of this function. Creates a
memory heap which allocates memory from dynamic space. For debugging
@@ -122,8 +122,9 @@ mem_heap_create_func(
block is not unintentionally erased
(if allocated in the stack), before
the memory heap is explicitly freed. */
ulint type, /* in: MEM_HEAP_DYNAMIC or MEM_HEAP_BUFFER */
char* file_name, /* in: file name where created */
ulint type, /* in: MEM_HEAP_DYNAMIC
or MEM_HEAP_BUFFER */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
);
/*********************************************************************
@@ -135,7 +136,7 @@ void
mem_heap_free_func(
/*===============*/
mem_heap_t* heap, /* in, own: heap to be freed */
char* file_name __attribute__((unused)),
const char* file_name __attribute__((unused)),
/* in: file name where freed */
ulint line __attribute__((unused)));
/* in: line where freed */
@@ -206,13 +207,13 @@ mem_heap_get_size(
Use this macro instead of the corresponding function!
Macro for memory buffer allocation */
#define mem_alloc(N) mem_alloc_func((N), IB__FILE__, __LINE__)
#define mem_alloc(N) mem_alloc_func((N), __FILE__, __LINE__)
/******************************************************************
Use this macro instead of the corresponding function!
Macro for memory buffer allocation */
#define mem_alloc_noninline(N) mem_alloc_func_noninline(\
(N), IB__FILE__, __LINE__)
(N), __FILE__, __LINE__)
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
Allocates a single buffer of memory from the dynamic memory of
@@ -225,7 +226,7 @@ mem_alloc_func(
/* out, own: free storage, NULL
if did not succeed */
ulint n, /* in: desired number of bytes */
char* file_name, /* in: file name where created */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
);
/*******************************************************************
@@ -237,17 +238,17 @@ with mem_free. */
void*
mem_alloc_func_noninline(
/*=====================*/
/* out, own: free storage, NULL if did not
succeed */
/* out, own: free storage,
NULL if did not succeed */
ulint n, /* in: desired number of bytes */
char* file_name, /* in: file name where created */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
);
/******************************************************************
Use this macro instead of the corresponding function!
Macro for memory buffer freeing */
#define mem_free(PTR) mem_free_func((PTR), IB__FILE__, __LINE__)
#define mem_free(PTR) mem_free_func((PTR), __FILE__, __LINE__)
/*******************************************************************
NOTE: Use the corresponding macro instead of this function.
Frees a single buffer of storage from
@@ -257,7 +258,7 @@ void
mem_free_func(
/*==========*/
void* ptr, /* in, own: buffer to be freed */
char* file_name, /* in: file name where created */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
);
/*******************************************************************
@@ -266,10 +267,11 @@ UNIV_INLINE
void*
mem_realloc(
/*========*/
/* out, own: free storage, NULL if did not succeed */
/* out, own: free storage,
NULL if did not succeed */
void* buf, /* in: pointer to an old buffer */
ulint n, /* in: desired number of bytes */
char* file_name,/* in: file name where called */
const char* file_name, /* in: file name where called */
ulint line); /* in: line where called */
/**************************************************************************

View File

@@ -16,17 +16,17 @@ Creates a memory heap block where data can be allocated. */
mem_block_t*
mem_heap_create_block(
/*==================*/
/* out, own: memory heap block, NULL if did not
succeed */
mem_heap_t* heap,/* in: memory heap or NULL if first block should
be created */
/* out, own: memory heap block,
NULL if did not succeed */
mem_heap_t* heap, /* in: memory heap or NULL if first block
should be created */
ulint n, /* in: number of bytes needed for user data, or
if init_block is not NULL, its size in bytes */
void* init_block, /* in: init block in fast create, type must be
MEM_HEAP_DYNAMIC */
void* init_block, /* in: init block in fast create,
type must be MEM_HEAP_DYNAMIC */
ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or
MEM_HEAP_BUFFER */
char* file_name,/* in: file name where created */
const char* file_name,/* in: file name where created */
ulint line); /* in: line where created */
/**********************************************************************
Frees a block from a memory heap. */
@@ -394,9 +394,9 @@ mem_heap_create_func(
block is not unintentionally erased
(if allocated in the stack), before
the memory heap is explicitly freed. */
ulint type, /* in: MEM_HEAP_DYNAMIC, or MEM_HEAP_BUFFER
possibly ORed to MEM_HEAP_BTR_SEARCH */
char* file_name, /* in: file name where created */
ulint type, /* in: MEM_HEAP_DYNAMIC
or MEM_HEAP_BUFFER */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
)
{
@@ -440,10 +440,9 @@ void
mem_heap_free_func(
/*===============*/
mem_heap_t* heap, /* in, own: heap to be freed */
char* file_name __attribute__((unused)),
const char* file_name __attribute__((unused)),
/* in: file name where freed */
ulint line __attribute__((unused)))
/* in: line where freed */
{
mem_block_t* block;
mem_block_t* prev_block;
@@ -486,10 +485,10 @@ UNIV_INLINE
void*
mem_alloc_func(
/*===========*/
/* out, own: free storage, NULL if did not
succeed */
/* out, own: free storage, NULL
if did not succeed */
ulint n, /* in: desired number of bytes */
char* file_name, /* in: file name where created */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
)
{
@@ -524,7 +523,7 @@ void
mem_free_func(
/*==========*/
void* ptr, /* in, own: buffer to be freed */
char* file_name, /* in: file name where created */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
)
{
@@ -569,10 +568,11 @@ UNIV_INLINE
void*
mem_realloc(
/*========*/
/* out, own: free storage, NULL if did not succeed */
/* out, own: free storage,
NULL if did not succeed */
void* buf, /* in: pointer to an old buffer */
ulint n, /* in: desired number of bytes */
char* file_name,/* in: file name where called */
const char* file_name, /* in: file name where called */
ulint line) /* in: line where called */
{
mem_free(buf);

View File

@@ -198,11 +198,11 @@ mtr_read_dulint(
mtr_t* mtr); /* in: mini-transaction handle */
/*************************************************************************
This macro locks an rw-lock in s-mode. */
#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), IB__FILE__, __LINE__,\
#define mtr_s_lock(B, MTR) mtr_s_lock_func((B), __FILE__, __LINE__,\
(MTR))
/*************************************************************************
This macro locks an rw-lock in x-mode. */
#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), IB__FILE__, __LINE__,\
#define mtr_x_lock(B, MTR) mtr_x_lock_func((B), __FILE__, __LINE__,\
(MTR))
/*************************************************************************
NOTE! Use the macro above!
@@ -212,7 +212,7 @@ void
mtr_s_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr); /* in: mtr */
/*************************************************************************
@@ -223,7 +223,7 @@ void
mtr_x_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr); /* in: mtr */

View File

@@ -217,7 +217,7 @@ void
mtr_s_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr) /* in: mtr */
{
@@ -236,7 +236,7 @@ void
mtr_x_lock_func(
/*============*/
rw_lock_t* lock, /* in: rw-lock */
char* file, /* in: file name */
const char* file, /* in: file name */
ulint line, /* in: line number */
mtr_t* mtr) /* in: mtr */
{

View File

@@ -177,13 +177,15 @@ and '..' items at the start of the directory listing. */
os_file_dir_t
os_file_opendir(
/*============*/
/* out: directory stream, NULL if error */
char* dirname, /* in: directory name; it must not contain
a trailing '\' or '/' */
ibool error_is_fatal);/* in: TRUE if we should treat an error as a
fatal error; if we try to open symlinks then
we do not wish a fatal error if it happens
not to be a directory */
/* out: directory stream, NULL if
error */
const char* dirname, /* in: directory name; it must not
contain a trailing '\' or '/' */
ibool error_is_fatal);/* in: TRUE if we should treat an
error as a fatal error; if we try to
open symlinks then we do not wish a
fatal error if it happens not to be
a directory */
/***************************************************************************
Closes a directory stream. */
@@ -201,7 +203,7 @@ os_file_readdir_next_file(
/*======================*/
/* out: 0 if ok, -1 if error, 1 if at the end
of the directory */
char* dirname,/* in: directory name or path */
const char* dirname,/* in: directory name or path */
os_file_dir_t dir, /* in: directory stream */
os_file_stat_t* info); /* in/out: buffer where the info is returned */
/*********************************************************************
@@ -213,29 +215,32 @@ fail_if_exists arguments is true. */
ibool
os_file_create_directory(
/*=====================*/
/* out: TRUE if call succeeds, FALSE on
error */
char* pathname, /* in: directory name as null-terminated
string */
ibool fail_if_exists);/* in: if TRUE, pre-existing directory is
treated as an error. */
/* out: TRUE if call succeeds,
FALSE on error */
const char* pathname, /* in: directory name as
null-terminated string */
ibool fail_if_exists);/* in: if TRUE, pre-existing directory
is treated as an error. */
/********************************************************************
A simple function to open or create a file. */
os_file_t
os_file_create_simple(
/*==================*/
/* out, own: handle to the file, not defined if error,
error number can be retrieved with
/* out, own: handle to the file, not defined
if error, error number can be retrieved with
os_file_get_last_error */
char* name, /* in: name of the file or path as a null-terminated
string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
file is created (if exists, error), or
OS_FILE_CREATE_PATH if new file (if exists, error) and
subdirectories along its path are created (if needed)*/
ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
const char* name, /* in: name of the file or path as a
null-terminated string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is
opened (if does not exist, error), or
OS_FILE_CREATE if a new file is created
(if exists, error), or
OS_FILE_CREATE_PATH if new file
(if exists, error) and subdirectories along
its path are created (if needed)*/
ulint access_type,/* in: OS_FILE_READ_ONLY or
OS_FILE_READ_WRITE */
ibool* success);/* out: TRUE if succeed, FALSE if error */
/********************************************************************
A simple function to open or create a file. */
@@ -243,17 +248,19 @@ A simple function to open or create a file. */
os_file_t
os_file_create_simple_no_error_handling(
/*====================================*/
/* out, own: handle to the file, not defined if error,
error number can be retrieved with
/* out, own: handle to the file, not defined
if error, error number can be retrieved with
os_file_get_last_error */
char* name, /* in: name of the file or path as a null-terminated
string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
file is created (if exists, error) */
ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or
OS_FILE_READ_ALLOW_DELETE; the last option is used by
a backup program reading the file */
const char* name, /* in: name of the file or path as a
null-terminated string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file
is opened (if does not exist, error), or
OS_FILE_CREATE if a new file is created
(if exists, error) */
ulint access_type,/* in: OS_FILE_READ_ONLY,
OS_FILE_READ_WRITE, or
OS_FILE_READ_ALLOW_DELETE; the last option is
used by a backup program reading the file */
ibool* success);/* out: TRUE if succeed, FALSE if error */
/********************************************************************
Opens an existing file or creates a new. */
@@ -261,23 +268,26 @@ Opens an existing file or creates a new. */
os_file_t
os_file_create(
/*===========*/
/* out, own: handle to the file, not defined if error,
error number can be retrieved with
/* out, own: handle to the file, not defined
if error, error number can be retrieved with
os_file_get_last_error */
char* name, /* in: name of the file or path as a null-terminated
string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
file is created (if exists, error), OS_FILE_OVERWRITE
if a new file is created or an old overwritten;
OS_FILE_OPEN_RAW, if a raw device or disk partition
should be opened */
ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o
is desired, OS_FILE_NORMAL, if any normal file;
NOTE that it also depends on type, os_aio_.. and srv_..
variables whether we really use async i/o or
unbuffered i/o: look in the function source code for
the exact rules */
const char* name, /* in: name of the file or path as a
null-terminated string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file
is opened (if does not exist, error), or
OS_FILE_CREATE if a new file is created
(if exists, error),
OS_FILE_OVERWRITE if a new file is created
or an old overwritten;
OS_FILE_OPEN_RAW, if a raw device or disk
partition should be opened */
ulint purpose,/* in: OS_FILE_AIO, if asynchronous,
non-buffered i/o is desired,
OS_FILE_NORMAL, if any normal file;
NOTE that it also depends on type, os_aio_..
and srv_.. variables whether we really use
async i/o or unbuffered i/o: look in the
function source code for the exact rules */
ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */
ibool* success);/* out: TRUE if succeed, FALSE if error */
/***************************************************************************
@@ -287,7 +297,7 @@ ibool
os_file_delete(
/*===========*/
/* out: TRUE if success */
char* name); /* in: file path as a null-terminated string */
const char* name); /* in: file path as a null-terminated string */
/***************************************************************************
Deletes a file if it exists. The file has to be closed before calling this. */
@@ -296,7 +306,7 @@ ibool
os_file_delete_if_exists(
/*=====================*/
/* out: TRUE if success */
char* name); /* in: file path as a null-terminated string */
const char* name); /* in: file path as a null-terminated string */
/***************************************************************************
Renames a file (can also move it to another directory). It is safest that the
file is closed before calling this function. */
@@ -305,9 +315,9 @@ ibool
os_file_rename(
/*===========*/
/* out: TRUE if success */
char* oldpath, /* in: old file path as a null-terminated
string */
char* newpath); /* in: new file path */
const char* oldpath, /* in: old file path as a
null-terminated string */
const char* newpath); /* in: new file path */
/***************************************************************************
Closes a file handle. In case of error, error number can be retrieved with
os_file_get_last_error. */
@@ -351,7 +361,7 @@ ibool
os_file_set_size(
/*=============*/
/* out: TRUE if success */
char* name, /* in: name of the file or path as a
const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
ulint size, /* in: least significant 32 bits of file
@@ -426,10 +436,10 @@ os_file_write(
/*==========*/
/* out: TRUE if request was
successful, FALSE if fail */
char* name, /* in: name of the file or path as a
const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer from which to write */
const void* buf, /* in: buffer from which to write */
ulint offset, /* in: least significant 32 bits of file
offset where to write */
ulint offset_high,/* in: most significant 32 bits of
@@ -442,8 +452,8 @@ ibool
os_file_status(
/*===========*/
/* out: TRUE if call succeeded */
char * path, /* in: pathname of the file */
ibool * exists, /* out: TRUE if file exists */
const char* path, /* in: pathname of the file */
ibool* exists, /* out: TRUE if file exists */
os_file_type_t* type); /* out: type of the file (if it exists) */
/********************************************************************
The function os_file_dirname returns a directory component of a
@@ -478,7 +488,7 @@ os_file_dirname(
/*============*/
/* out, own: directory component of the
pathname */
char* path); /* in: pathname */
const char* path); /* in: pathname */
/********************************************************************
Creates all missing subdirectories along the given path. */
@@ -487,7 +497,7 @@ os_file_create_subdirs_if_needed(
/*=============================*/
/* out: TRUE if call succeeded
FALSE otherwise */
char* path); /* in: path name */
const char* path); /* in: path name */
/****************************************************************************
Initializes the asynchronous io system. Creates separate aio array for
non-ibuf read and write, a third aio array for the ibuf i/o, with just one
@@ -527,7 +537,7 @@ os_aio(
because i/os are not actually handled until
all have been posted: use with great
caution! */
char* name, /* in: name of the file or path as a
const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer where to read or from which

View File

@@ -88,7 +88,7 @@ os_event_t
os_event_create(
/*============*/
/* out: the event handle */
char* name); /* in: the name of the event, if NULL
const char* name); /* in: the name of the event, if NULL
the event is created without a name */
#ifdef __WIN__
/*************************************************************
@@ -99,7 +99,7 @@ os_event_t
os_event_create_auto(
/*=================*/
/* out: the event handle */
char* name); /* in: the name of the event, if NULL
const char* name); /* in: the name of the event, if NULL
the event is created without a name */
#endif
/**************************************************************
@@ -172,7 +172,7 @@ os_mutex_t
os_mutex_create(
/*============*/
/* out: the mutex handle */
char* name); /* in: the name of the mutex, if NULL
const char* name); /* in: the name of the mutex, if NULL
the mutex is created without a name */
/**************************************************************
Acquires ownership of a mutex semaphore. */

View File

@@ -75,7 +75,7 @@ que_t*
pars_sql(
/*=====*/
/* out, own: the query graph */
char* str); /* in: SQL string */
const char* str); /* in: SQL string */
/*****************************************************************
Retrieves characters to the lexical analyzer. */
@@ -92,7 +92,7 @@ Called by yyparse on error. */
void
yyerror(
/*====*/
char* s); /* in: error message string */
const char* s); /* in: error message string */
/*************************************************************************
Parses a variable declaration. */

View File

@@ -122,7 +122,7 @@ struct sym_node_struct{
SYM_IMPLICIT_VAR,
SYM_LIT, SYM_TABLE,
SYM_CURSOR, ... */
char* name; /* name of an id */
const char* name; /* name of an id */
ulint name_len; /* id name length */
dict_table_t* table; /* table definition
if a table id or a
@@ -150,7 +150,7 @@ struct sym_tab_struct{
que_t* query_graph;
/* query graph generated by the
parser */
char* sql_string;
const char* sql_string;
/* SQL string to parse */
int string_len;
/* SQL string length */

View File

@@ -318,12 +318,13 @@ row_table_add_foreign_constraints(
/*==============================*/
/* out: error code or DB_SUCCESS */
trx_t* trx, /* in: transaction */
char* sql_string, /* in: table create statement where
const char* sql_string, /* in: table create statement where
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
name before it: test.table2 */
char* name); /* in: table full name in the normalized form
table2 can be written also with the
database name before it: test.table2 */
const char* name); /* in: table full name in the
normalized form
database_name/table_name */
/*************************************************************************
The master thread in srv0srv.c calls this regularly to drop tables which
@@ -352,7 +353,7 @@ int
row_drop_table_for_mysql(
/*=====================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: table name */
const char* name, /* in: table name */
trx_t* trx, /* in: transaction handle */
ibool drop_db);/* in: TRUE=dropping whole database */
@@ -383,7 +384,7 @@ int
row_discard_tablespace_for_mysql(
/*=============================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: table name */
const char* name, /* in: table name */
trx_t* trx); /* in: transaction handle */
/*********************************************************************
Imports a tablespace. The space id in the .ibd file must match the space id
@@ -393,7 +394,7 @@ int
row_import_tablespace_for_mysql(
/*============================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: table name */
const char* name, /* in: table name */
trx_t* trx); /* in: transaction handle */
/*************************************************************************
Drops a database for MySQL. */
@@ -402,7 +403,7 @@ int
row_drop_database_for_mysql(
/*========================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: database name which ends to '/' */
const char* name, /* in: database name which ends to '/' */
trx_t* trx); /* in: transaction handle */
/*************************************************************************
Renames a table for MySQL. */
@@ -411,8 +412,8 @@ int
row_rename_table_for_mysql(
/*=======================*/
/* out: error code or DB_SUCCESS */
char* old_name, /* in: old table name */
char* new_name, /* in: new table name */
const char* old_name, /* in: old table name */
const char* new_name, /* in: new table name */
trx_t* trx); /* in: transaction handle */
/*************************************************************************
Checks a table for corruption. */

View File

@@ -144,11 +144,11 @@ consistent read result, or store it to the query cache. */
ibool
row_search_check_if_query_cache_permitted(
/*======================================*/
/* out: TRUE if storing or retrieving from
the query cache is permitted */
/* out: TRUE if storing or retrieving
from the query cache is permitted */
trx_t* trx, /* in: transaction object */
char* norm_name); /* in: concatenation of database name, '/'
char, table name */
const char* norm_name); /* in: concatenation of database name,
'/' char, table name */
/* A structure for caching column values for prefetched rows */

View File

@@ -51,7 +51,7 @@ sync_array_reserve_cell(
sync_array_t* arr, /* in: wait array */
void* object, /* in: pointer to the object to wait for */
ulint type, /* in: lock request type */
char* file, /* in: file where requested */
const char* file, /* in: file where requested */
ulint line, /* in: line where requested */
ulint* index); /* out: index of the reserved cell */
/**********************************************************************

View File

@@ -92,7 +92,7 @@ loop:
loop_count++;
ut_ad(loop_count < 15);
if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) {
if (mutex_enter_nowait(mutex, __FILE__, __LINE__) == 0) {
/* Succeeded! */
return(0);
@@ -105,7 +105,7 @@ loop:
/* Order is important here: FIRST reset event, then set waiters */
ip_mutex_set_waiters(ip_mutex, 1);
if (mutex_enter_nowait(mutex, IB__FILE__, __LINE__) == 0) {
if (mutex_enter_nowait(mutex, __FILE__, __LINE__) == 0) {
/* Succeeded! */
return(0);

View File

@@ -62,7 +62,7 @@ location (which must be appropriately aligned). The rw-lock is initialized
to the non-locked state. Explicit freeing of the rw-lock with rw_lock_free
is necessary only if the memory block containing it is freed. */
#define rw_lock_create(L) rw_lock_create_func((L), IB__FILE__, __LINE__)
#define rw_lock_create(L) rw_lock_create_func((L), __FILE__, __LINE__)
/*=====================*/
/**********************************************************************
Creates, or rather, initializes an rw-lock object in a specified memory
@@ -74,7 +74,7 @@ void
rw_lock_create_func(
/*================*/
rw_lock_t* lock, /* in: pointer to memory */
char* cfile_name, /* in: file name where created */
const char* cfile_name, /* in: file name where created */
ulint cline); /* in: file line where created */
/**********************************************************************
Calling this function is obligatory only if the memory buffer containing
@@ -100,19 +100,19 @@ NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */
#define rw_lock_s_lock(M) rw_lock_s_lock_func(\
(M), 0, IB__FILE__, __LINE__)
(M), 0, __FILE__, __LINE__)
/******************************************************************
NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */
#define rw_lock_s_lock_gen(M, P) rw_lock_s_lock_func(\
(M), (P), IB__FILE__, __LINE__)
(M), (P), __FILE__, __LINE__)
/******************************************************************
NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */
#define rw_lock_s_lock_nowait(M) rw_lock_s_lock_func_nowait(\
(M), IB__FILE__, __LINE__)
(M), __FILE__, __LINE__)
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function, except if
you supply the file name and line number. Lock an rw-lock in shared mode
@@ -127,7 +127,7 @@ rw_lock_s_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function, except if
@@ -139,7 +139,7 @@ rw_lock_s_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function! Lock an
@@ -151,7 +151,7 @@ rw_lock_x_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
Releases a shared mode lock. */
@@ -186,19 +186,19 @@ NOTE! The following macro should be used in rw x-locking, not the
corresponding function. */
#define rw_lock_x_lock(M) rw_lock_x_lock_func(\
(M), 0, IB__FILE__, __LINE__)
(M), 0, __FILE__, __LINE__)
/******************************************************************
NOTE! The following macro should be used in rw x-locking, not the
corresponding function. */
#define rw_lock_x_lock_gen(M, P) rw_lock_x_lock_func(\
(M), (P), IB__FILE__, __LINE__)
(M), (P), __FILE__, __LINE__)
/******************************************************************
NOTE! The following macros should be used in rw x-locking, not the
corresponding function. */
#define rw_lock_x_lock_nowait(M) rw_lock_x_lock_func_nowait(\
(M), IB__FILE__, __LINE__)
(M), __FILE__, __LINE__)
/**********************************************************************
NOTE! Use the corresponding macro, not directly this function! Lock an
rw-lock in exclusive mode for the current thread. If the rw-lock is locked
@@ -215,7 +215,7 @@ rw_lock_x_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
/**********************************************************************
Releases an exclusive mode lock. */
@@ -253,9 +253,9 @@ UNIV_INLINE
void
rw_lock_s_lock_direct(
/*==================*/
rw_lock_t* lock /* in: pointer to rw-lock */
,char* file_name, /* in: file name where lock requested */
ulint line /* in: line where requested */
rw_lock_t* lock, /* in: pointer to rw-lock */
const char* file_name, /* in: file name where requested */
ulint line /* in: line where lock requested */
);
/**********************************************************************
Low-level function which locks an rw-lock in x-mode when we know that it
@@ -265,9 +265,9 @@ UNIV_INLINE
void
rw_lock_x_lock_direct(
/*==================*/
rw_lock_t* lock /* in: pointer to rw-lock */
,char* file_name, /* in: file name where lock requested */
ulint line /* in: line where requested */
rw_lock_t* lock, /* in: pointer to rw-lock */
const char* file_name, /* in: file name where requested */
ulint line /* in: line where lock requested */
);
/**********************************************************************
This function is used in the insert buffer to move the ownership of an
@@ -451,10 +451,10 @@ struct rw_lock_struct {
#endif /* UNIV_SYNC_DEBUG */
ulint level; /* Level in the global latching
order; default SYNC_LEVEL_NONE */
char* cfile_name; /* File name where lock created */
const char* cfile_name;/* File name where lock created */
ulint cline; /* Line where created */
char* last_s_file_name;/* File name where last time s-locked */
char* last_x_file_name;/* File name where last time x-locked */
const char* last_s_file_name;/* File name where last s-locked */
const char* last_x_file_name;/* File name where last x-locked */
ulint last_s_line; /* Line number where last time s-locked */
ulint last_x_line; /* Line number where last time x-locked */
ulint magic_n;
@@ -471,7 +471,7 @@ struct rw_lock_debug_struct {
ulint pass; /* Pass value given in the lock operation */
ulint lock_type; /* Type of the lock: RW_LOCK_EX,
RW_LOCK_SHARED, RW_LOCK_WAIT_EX */
char* file_name; /* File name where the lock was obtained */
const char* file_name;/* File name where the lock was obtained */
ulint line; /* Line where the rw-lock was locked */
UT_LIST_NODE_T(rw_lock_debug_t) list;
/* Debug structs are linked in a two-way

View File

@@ -18,7 +18,7 @@ rw_lock_s_lock_spin(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
@@ -130,7 +130,7 @@ rw_lock_s_lock_low(
ulint pass __attribute__((unused)),
/* in: pass value; != 0, if the lock will be
passed to another thread to unlock */
char* file_name, /* in: file name where lock requested */
const char* file_name, /* in: file name where lock requested */
ulint line) /* in: line where requested */
{
#ifdef UNIV_SYNC_DEBUG
@@ -164,8 +164,8 @@ void
rw_lock_s_lock_direct(
/*==================*/
rw_lock_t* lock, /* in: pointer to rw-lock */
char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
const char* file_name, /* in: file name where requested */
ulint line) /* in: line where lock requested */
{
ut_ad(lock->writer == RW_LOCK_NOT_LOCKED);
ut_ad(rw_lock_get_reader_count(lock) == 0);
@@ -190,8 +190,8 @@ void
rw_lock_x_lock_direct(
/*==================*/
rw_lock_t* lock, /* in: pointer to rw-lock */
char* file_name, /* in: file name where lock requested */
ulint line) /* in: line where requested */
const char* file_name, /* in: file name where requested */
ulint line) /* in: line where lock requested */
{
ut_ad(rw_lock_validate(lock));
ut_ad(rw_lock_get_reader_count(lock) == 0);
@@ -223,7 +223,7 @@ rw_lock_s_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
char* file_name, /* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
/* NOTE: As we do not know the thread ids for threads which have
@@ -267,7 +267,7 @@ rw_lock_s_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ibool success = FALSE;
@@ -304,7 +304,7 @@ rw_lock_x_lock_func_nowait(
/*=======================*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
char* file_name, /* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ibool success = FALSE;

View File

@@ -36,7 +36,7 @@ in the reset state. Explicit freeing of the mutex with mutex_free is
necessary only if the memory block containing it is freed. */
#define mutex_create(M) mutex_create_func((M), IB__FILE__, __LINE__)
#define mutex_create(M) mutex_create_func((M), __FILE__, __LINE__)
/*===================*/
/**********************************************************************
Creates, or rather, initializes a mutex object in a specified memory
@@ -48,7 +48,7 @@ void
mutex_create_func(
/*==============*/
mutex_t* mutex, /* in: pointer to memory */
char* cfile_name, /* in: file name where created */
const char* cfile_name, /* in: file name where created */
ulint cline); /* in: file line where created */
/**********************************************************************
Calling this function is obligatory only if the memory buffer containing
@@ -64,7 +64,7 @@ mutex_free(
NOTE! The following macro should be used in mutex locking, not the
corresponding function. */
#define mutex_enter(M) mutex_enter_func((M), IB__FILE__, __LINE__)
#define mutex_enter(M) mutex_enter_func((M), __FILE__, __LINE__)
/**********************************************************************
A noninlined function that reserves a mutex. In ha_innodb.cc we have disabled
inlining of InnoDB functions, and no inlined functions should be called from
@@ -80,7 +80,7 @@ corresponding function. */
/* NOTE! currently same as mutex_enter! */
#define mutex_enter_fast(M) mutex_enter_func((M), IB__FILE__, __LINE__)
#define mutex_enter_fast(M) mutex_enter_func((M), __FILE__, __LINE__)
#define mutex_enter_fast_func mutex_enter_func;
/**********************************************************************
NOTE! Use the corresponding macro in the header file, not this function
@@ -92,7 +92,7 @@ void
mutex_enter_func(
/*=============*/
mutex_t* mutex, /* in: pointer to mutex */
char* file_name, /* in: file name where locked */
const char* file_name, /* in: file name where locked */
ulint line); /* in: line where locked */
/************************************************************************
Tries to lock the mutex for the current thread. If the lock is not acquired
@@ -103,7 +103,7 @@ mutex_enter_nowait(
/*===============*/
/* out: 0 if succeed, 1 if not */
mutex_t* mutex, /* in: pointer to mutex */
char* file_name, /* in: file name where mutex
const char* file_name, /* in: file name where mutex
requested */
ulint line); /* in: line where requested */
/**********************************************************************
@@ -470,7 +470,7 @@ struct mutex_struct {
#endif /* UNIV_SYNC_DEBUG */
ulint level; /* Level in the global latching
order; default SYNC_LEVEL_NONE */
char* cfile_name; /* File name where mutex created */
const char* cfile_name;/* File name where mutex created */
ulint cline; /* Line where created */
ulint magic_n;
};

View File

@@ -23,7 +23,7 @@ void
mutex_spin_wait(
/*============*/
mutex_t* mutex, /* in: pointer to mutex */
char* file_name,/* in: file name where mutex requested */
const char* file_name,/* in: file name where mutex requested */
ulint line); /* in: line where requested */
#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
@@ -242,7 +242,7 @@ void
mutex_enter_func(
/*=============*/
mutex_t* mutex, /* in: pointer to mutex */
char* file_name,/* in: file name where locked */
const char* file_name, /* in: file name where locked */
ulint line) /* in: line where locked */
{
ut_ad(mutex_validate(mutex));

View File

@@ -193,7 +193,7 @@ trx_rollback_to_savepoint_for_mysql(
DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
char* savepoint_name, /* in: savepoint name */
const char* savepoint_name, /* in: savepoint name */
ib_longlong* mysql_binlog_cache_pos);/* out: the MySQL binlog cache
position corresponding to this
savepoint; MySQL needs this
@@ -211,7 +211,7 @@ trx_savepoint_for_mysql(
/*====================*/
/* out: always DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
char* savepoint_name, /* in: savepoint name */
const char* savepoint_name, /* in: savepoint name */
ib_longlong binlog_cache_pos); /* in: MySQL binlog cache
position corresponding to this
connection at the time of the

View File

@@ -258,7 +258,7 @@ replication has proceeded. */
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
char* file_name,/* in: MySQL log file name */
const char* file_name,/* in: MySQL log file name */
ib_longlong offset, /* in: position in that log file */
ulint field, /* in: offset of the MySQL log info field in
the trx sys header */

View File

@@ -275,7 +275,9 @@ trx_commit_step(
que_thr_t* thr); /* in: query thread */
/**************************************************************************
Prints info about a transaction to the standard output. The caller must
own the kernel mutex. */
own the kernel mutex and must have called
innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or
InnoDB cannot meanwhile change the info printed here. */
void
trx_print(
@@ -313,7 +315,7 @@ struct trx_struct{
ulint magic_n;
/* All the next fields are protected by the kernel mutex, except the
undo logs which are protected by undo_mutex */
char* op_info; /* English text describing the
const char* op_info; /* English text describing the
current operation, or an empty
string */
ulint type; /* TRX_USER, TRX_PURGE */
@@ -356,7 +358,7 @@ struct trx_struct{
char** mysql_query_str;/* pointer to the field in mysqld_thd
which contains the pointer to the
current SQL query string */
char* mysql_log_file_name;
const char* mysql_log_file_name;
/* if MySQL binlog is used, this field
contains a pointer to the latest file
name; this is NULL if binlog is not
@@ -364,7 +366,7 @@ struct trx_struct{
ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
char* mysql_master_log_file_name;
const char* mysql_master_log_file_name;
/* if the database server is a MySQL
replication slave, we have here the
master binlog name up to which

View File

@@ -242,11 +242,6 @@ contains the sum of the following flag and the locally stored len. */
#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
/* The following definition of __FILE__ removes compiler warnings
associated with const char* / char* mismatches with __FILE__ */
#define IB__FILE__ ((char*)__FILE__)
#include <stdio.h>
#include "ut0dbg.h"
#include "ut0ut.h"

View File

@@ -27,7 +27,7 @@ extern const char* ut_dbg_msg_stop;
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\
os_thread_pf(os_thread_get_curr_id()), __FILE__,\
(ulint)__LINE__);\
fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\
fputs(ut_dbg_msg_trap, stderr);\
@@ -36,7 +36,7 @@ extern const char* ut_dbg_msg_stop;
}\
if (ut_dbg_stop_threads) {\
fprintf(stderr, ut_dbg_msg_stop,\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
os_thread_sleep(1000000000);\
}\
} while (0)
@@ -44,7 +44,7 @@ extern const char* ut_dbg_msg_stop;
#define ut_error do {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
os_thread_pf(os_thread_get_curr_id()), __FILE__, (ulint)__LINE__);\
fprintf(stderr, ut_dbg_msg_trap);\
ut_dbg_stop_threads = TRUE;\
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\

View File

@@ -93,7 +93,7 @@ ulint
ut_fold_string(
/*===========*/
/* out: folded value */
char* str); /* in: null-terminated string */
const char* str); /* in: null-terminated string */
/*****************************************************************
Folds a binary string. */
UNIV_INLINE
@@ -101,7 +101,7 @@ ulint
ut_fold_binary(
/*===========*/
/* out: folded value */
byte* str, /* in: string of bytes */
const byte* str, /* in: string of bytes */
ulint len); /* in: length */
/***************************************************************
Looks for a prime number slightly greater than the given argument.

View File

@@ -174,7 +174,7 @@ ulint
ut_fold_string(
/*===========*/
/* out: folded value */
char* str) /* in: null-terminated string */
const char* str) /* in: null-terminated string */
{
#ifdef UNIV_DEBUG
ulint i = 0;
@@ -204,7 +204,7 @@ ulint
ut_fold_binary(
/*===========*/
/* out: folded value */
byte* str, /* in: string of bytes */
const byte* str, /* in: string of bytes */
ulint len) /* in: length */
{
ulint i;

View File

@@ -17,21 +17,6 @@ Created 1/20/1994 Heikki Tuuri
typedef time_t ib_time_t;
/************************************************************
On the 64-bit Windows we substitute the format string
%l -> %I64
because we define ulint as unsigned __int64 and lint as __int64 on Windows,
and both the Microsoft and Intel C compilers require the format string
%I64 in that case instead of %l. */
int
ut_printf(
/*======*/
/* out: the number of characters written, or
negative in case of an error */
const char* format, /* in: format of prints */
...); /* in: arguments to be printed */
/************************************************************
On the 64-bit Windows we substitute the format string
%l -> %I64

View File

@@ -17,6 +17,32 @@ Created 5/7/1996 Heikki Tuuri
#include "dict0mem.h"
#include "trx0sys.h"
/* 2 function prototypes copied from ha_innodb.cc: */
/*****************************************************************
If you want to print a thd that is not associated with the current thread,
you must call this function before reserving the InnoDB kernel_mutex, to
protect MySQL from setting thd->query NULL. If you print a thd of the current
thread, we know that MySQL cannot modify thd->query, and it is not necessary
to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release
the kernel_mutex.
NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
function! */
void
innobase_mysql_prepare_print_arbitrary_thd(void);
/*============================================*/
/*****************************************************************
Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
function! */
void
innobase_mysql_end_print_arbitrary_thd(void);
/*========================================*/
/* Restricts the length of search we will do in the waits-for
graph of transactions */
#define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000
@@ -1629,7 +1655,8 @@ lock_rec_enqueue_waiting(
" InnoDB: Error: a record lock wait happens in a dictionary operation!\n"
"InnoDB: Table name ", stderr);
ut_print_name(stderr, index->table_name);
fputs(". Send a bug report to mysql@lists.mysql.com\n",
fputs(".\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
stderr);
}
@@ -3269,7 +3296,8 @@ lock_table_enqueue_waiting(
" InnoDB: Error: a table lock wait happens in a dictionary operation!\n"
"InnoDB: Table name ", stderr);
ut_print_name(stderr, table->name);
fputs(". Send a bug report to mysql@lists.mysql.com\n",
fputs(".\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
stderr);
}
@@ -3889,7 +3917,7 @@ lock_rec_print(
page = buf_page_get_gen(space, page_no, RW_NO_LATCH,
NULL, BUF_GET_IF_IN_POOL,
IB__FILE__, __LINE__, &mtr);
__FILE__, __LINE__, &mtr);
if (page) {
page = buf_page_get_nowait(space, page_no, RW_S_LATCH, &mtr);
@@ -3975,6 +4003,11 @@ lock_print_info(
ulint i;
mtr_t mtr;
/* We must protect the MySQL thd->query field with a MySQL mutex, and
because the MySQL mutex must be reserved before the kernel_mutex of
InnoDB, we call innobase_mysql_prepare_print_arbitrary_thd() here. */
innobase_mysql_prepare_print_arbitrary_thd();
lock_mutex_enter_kernel();
if (lock_deadlock_found) {
@@ -4038,6 +4071,7 @@ loop:
if (trx == NULL) {
lock_mutex_exit_kernel();
innobase_mysql_end_print_arbitrary_thd();
ut_ad(lock_validate());
@@ -4102,6 +4136,7 @@ loop:
if (load_page_first) {
lock_mutex_exit_kernel();
innobase_mysql_end_print_arbitrary_thd();
mtr_start(&mtr);
@@ -4111,6 +4146,7 @@ loop:
load_page_first = FALSE;
innobase_mysql_prepare_print_arbitrary_thd();
lock_mutex_enter_kernel();
goto loop;

View File

@@ -1080,7 +1080,7 @@ recv_recover_page(
success = buf_page_get_known_nowait(RW_X_LATCH, page,
BUF_KEEP_OLD,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
&mtr);
ut_a(success);
@@ -1664,7 +1664,7 @@ recv_compare_spaces(
frame = buf_page_get_gen(space1, page_no, RW_S_LATCH, NULL,
BUF_GET_IF_IN_POOL,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
&mtr);
if (frame) {
#ifdef UNIV_SYNC_DEBUG
@@ -1679,7 +1679,7 @@ recv_compare_spaces(
frame = buf_page_get_gen(space2, page_no, RW_S_LATCH, NULL,
BUF_GET_IF_IN_POOL,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
&mtr);
if (frame) {
#ifdef UNIV_SYNC_DEBUG

View File

@@ -92,10 +92,10 @@ with mem_free. */
void*
mem_alloc_func_noninline(
/*=====================*/
/* out, own: free storage, NULL if did not
succeed */
/* out, own: free storage,
NULL if did not succeed */
ulint n, /* in: desired number of bytes */
char* file_name, /* in: file name where created */
const char* file_name, /* in: file name where created */
ulint line /* in: line where created */
)
{
@@ -108,17 +108,17 @@ Creates a memory heap block where data can be allocated. */
mem_block_t*
mem_heap_create_block(
/*==================*/
/* out, own: memory heap block, NULL if did not
succeed */
mem_heap_t* heap,/* in: memory heap or NULL if first block should
be created */
/* out, own: memory heap block,
NULL if did not succeed */
mem_heap_t* heap, /* in: memory heap or NULL if first block
should be created */
ulint n, /* in: number of bytes needed for user data, or
if init_block is not NULL, its size in bytes */
void* init_block, /* in: init block in fast create, type must be
MEM_HEAP_DYNAMIC */
ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC, or
MEM_HEAP_BUFFER possibly ORed to MEM_HEAP_BTR_SEARCH */
char* file_name,/* in: file name where created */
void* init_block, /* in: init block in fast create,
type must be MEM_HEAP_DYNAMIC */
ulint type, /* in: type of heap: MEM_HEAP_DYNAMIC or
MEM_HEAP_BUFFER */
const char* file_name,/* in: file name where created */
ulint line) /* in: line where created */
{
mem_block_t* block;

View File

@@ -70,7 +70,7 @@ struct os_aio_slot_struct{
bytes */
ulint offset_high; /* 32 high bits of file offset */
os_file_t file; /* file where to read or write */
char* name; /* file name or path */
const char* name; /* file name or path */
ibool io_already_done;/* used only in simulated aio:
TRUE if the physical i/o already
made and only the slot message
@@ -387,15 +387,17 @@ os_file_lock(
/*=========*/
/* out: 0 on success */
int fd, /* in: file descriptor */
const char* name) /* in: file name */
const char* name, /* in: file name */
uint lock_type) /* in: lock_type */
{
struct flock lk;
lk.l_type = F_WRLCK;
lk.l_type = lock_type;
lk.l_whence = SEEK_SET;
lk.l_start = lk.l_len = 0;
if (fcntl(fd, F_SETLK, &lk) == -1) {
fprintf(stderr,
"InnoDB: Unable to lock %s", name);
"InnoDB: Unable to lock %s with lock %d, error: %d",
name, lock_type, errno);
perror (": fcntl");
close(fd);
return(-1);
@@ -413,7 +415,7 @@ os_file_handle_error_no_exit(
/* out: TRUE if we should retry the
operation */
os_file_t file, /* in: file pointer */
char* name, /* in: name of a file or NULL */
const char* name, /* in: name of a file or NULL */
const char* operation)/* in: operation */
{
ulint err;
@@ -491,13 +493,15 @@ and '..' items at the start of the directory listing. */
os_file_dir_t
os_file_opendir(
/*============*/
/* out: directory stream, NULL if error */
char* dirname, /* in: directory name; it must not contain
a trailing '\' or '/' */
ibool error_is_fatal) /* in: TRUE if we should treat an error as a
fatal error; if we try to open symlinks then
we do not wish a fatal error if it happens
not to be a directory */
/* out: directory stream, NULL if
error */
const char* dirname, /* in: directory name; it must not
contain a trailing '\' or '/' */
ibool error_is_fatal) /* in: TRUE if we should treat an
error as a fatal error; if we try to
open symlinks then we do not wish a
fatal error if it happens not to be
a directory */
{
os_file_dir_t dir;
#ifdef __WIN__
@@ -583,7 +587,7 @@ os_file_readdir_next_file(
/*======================*/
/* out: 0 if ok, -1 if error, 1 if at the end
of the directory */
char* dirname,/* in: directory name or path */
const char* dirname,/* in: directory name or path */
os_file_dir_t dir, /* in: directory stream */
os_file_stat_t* info) /* in/out: buffer where the info is returned */
{
@@ -702,12 +706,12 @@ fail_if_exists arguments is true. */
ibool
os_file_create_directory(
/*=====================*/
/* out: TRUE if call succeeds, FALSE on
error */
char* pathname, /* in: directory name as null-terminated
string */
ibool fail_if_exists) /* in: if TRUE, pre-existing directory is
treated as an error. */
/* out: TRUE if call succeeds,
FALSE on error */
const char* pathname, /* in: directory name as
null-terminated string */
ibool fail_if_exists) /* in: if TRUE, pre-existing directory
is treated as an error. */
{
#ifdef __WIN__
BOOL rcode;
@@ -744,17 +748,20 @@ A simple function to open or create a file. */
os_file_t
os_file_create_simple(
/*==================*/
/* out, own: handle to the file, not defined if error,
error number can be retrieved with
/* out, own: handle to the file, not defined
if error, error number can be retrieved with
os_file_get_last_error */
char* name, /* in: name of the file or path as a null-terminated
string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
file is created (if exists, error), or
OS_FILE_CREATE_PATH if new file (if exists, error) and
subdirectories along its path are created (if needed)*/
ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
const char* name, /* in: name of the file or path as a
null-terminated string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is
opened (if does not exist, error), or
OS_FILE_CREATE if a new file is created
(if exists, error), or
OS_FILE_CREATE_PATH if new file
(if exists, error) and subdirectories along
its path are created (if needed)*/
ulint access_type,/* in: OS_FILE_READ_ONLY or
OS_FILE_READ_WRITE */
ibool* success)/* out: TRUE if succeed, FALSE if error */
{
#ifdef __WIN__
@@ -862,7 +869,7 @@ try_again:
goto try_again;
}
#ifdef USE_FILE_LOCK
} else if (os_file_lock(file, name)) {
} else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -880,17 +887,19 @@ A simple function to open or create a file. */
os_file_t
os_file_create_simple_no_error_handling(
/*====================================*/
/* out, own: handle to the file, not defined if error,
error number can be retrieved with
/* out, own: handle to the file, not defined
if error, error number can be retrieved with
os_file_get_last_error */
char* name, /* in: name of the file or path as a null-terminated
string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
file is created (if exists, error) */
ulint access_type,/* in: OS_FILE_READ_ONLY, OS_FILE_READ_WRITE, or
OS_FILE_READ_ALLOW_DELETE; the last option is used by
a backup program reading the file */
const char* name, /* in: name of the file or path as a
null-terminated string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file
is opened (if does not exist, error), or
OS_FILE_CREATE if a new file is created
(if exists, error) */
ulint access_type,/* in: OS_FILE_READ_ONLY,
OS_FILE_READ_WRITE, or
OS_FILE_READ_ALLOW_DELETE; the last option is
used by a backup program reading the file */
ibool* success)/* out: TRUE if succeed, FALSE if error */
{
#ifdef __WIN__
@@ -971,7 +980,7 @@ os_file_create_simple_no_error_handling(
if (file == -1) {
*success = FALSE;
#ifdef USE_FILE_LOCK
} else if (os_file_lock(file, name)) {
} else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -989,23 +998,26 @@ Opens an existing file or creates a new. */
os_file_t
os_file_create(
/*===========*/
/* out, own: handle to the file, not defined if error,
error number can be retrieved with
/* out, own: handle to the file, not defined
if error, error number can be retrieved with
os_file_get_last_error */
char* name, /* in: name of the file or path as a null-terminated
string */
ulint create_mode, /* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
file is created (if exists, error), OS_FILE_OVERWRITE
if a new is created or an old overwritten,
OS_FILE_OPEN_RAW, if a raw device or disk partition
should be opened */
ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o
is desired, OS_FILE_NORMAL, if any normal file;
NOTE that it also depends on type, os_aio_.. and srv_..
variables whether we really use async i/o or
unbuffered i/o: look in the function source code for
the exact rules */
const char* name, /* in: name of the file or path as a
null-terminated string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file
is opened (if does not exist, error), or
OS_FILE_CREATE if a new file is created
(if exists, error),
OS_FILE_OVERWRITE if a new file is created
or an old overwritten;
OS_FILE_OPEN_RAW, if a raw device or disk
partition should be opened */
ulint purpose,/* in: OS_FILE_AIO, if asynchronous,
non-buffered i/o is desired,
OS_FILE_NORMAL, if any normal file;
NOTE that it also depends on type, os_aio_..
and srv_.. variables whether we really use
async i/o or unbuffered i/o: look in the
function source code for the exact rules */
ulint type, /* in: OS_DATA_FILE or OS_LOG_FILE */
ibool* success)/* out: TRUE if succeed, FALSE if error */
{
@@ -1182,7 +1194,7 @@ try_again:
goto try_again;
}
#ifdef USE_FILE_LOCK
} else if (os_file_lock(file, name)) {
} else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -1201,7 +1213,7 @@ ibool
os_file_delete_if_exists(
/*=====================*/
/* out: TRUE if success */
char* name) /* in: file path as a null-terminated string */
const char* name) /* in: file path as a null-terminated string */
{
#ifdef __WIN__
BOOL ret;
@@ -1262,7 +1274,7 @@ ibool
os_file_delete(
/*===========*/
/* out: TRUE if success */
char* name) /* in: file path as a null-terminated string */
const char* name) /* in: file path as a null-terminated string */
{
#ifdef __WIN__
BOOL ret;
@@ -1325,9 +1337,9 @@ ibool
os_file_rename(
/*===========*/
/* out: TRUE if success */
char* oldpath, /* in: old file path as a null-terminated
const char* oldpath,/* in: old file path as a null-terminated
string */
char* newpath) /* in: new file path */
const char* newpath)/* in: new file path */
{
#ifdef __WIN__
BOOL ret;
@@ -1338,7 +1350,7 @@ os_file_rename(
return(TRUE);
}
os_file_handle_error(NULL, oldpath, "delete");
os_file_handle_error(NULL, oldpath, "rename");
return(FALSE);
#else
@@ -1383,6 +1395,9 @@ os_file_close(
#else
int ret;
#ifdef USE_FILE_LOCK
(void) os_file_lock(file, "unknown", F_UNLCK);
#endif
ret = close(file);
if (ret == -1) {
@@ -1419,6 +1434,9 @@ os_file_close_no_error_handling(
#else
int ret;
#ifdef USE_FILE_LOCK
(void) os_file_lock(file, "unknown", F_UNLCK);
#endif
ret = close(file);
if (ret == -1) {
@@ -1508,7 +1526,7 @@ ibool
os_file_set_size(
/*=============*/
/* out: TRUE if success */
char* name, /* in: name of the file or path as a
const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
ulint size, /* in: least significant 32 bits of file
@@ -1769,7 +1787,7 @@ os_file_pwrite(
/*===========*/
/* out: number of bytes written, -1 if error */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer from where to write */
const void* buf, /* in: buffer from where to write */
ulint n, /* in: number of bytes to write */
ulint offset, /* in: least significant 32 bits of file
offset where to write */
@@ -2049,10 +2067,10 @@ os_file_write(
/*==========*/
/* out: TRUE if request was
successful, FALSE if fail */
char* name, /* in: name of the file or path as a
const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer from which to write */
const void* buf, /* in: buffer from which to write */
ulint offset, /* in: least significant 32 bits of file
offset where to write */
ulint offset_high, /* in: most significant 32 bits of
@@ -2206,7 +2224,7 @@ ibool
os_file_status(
/*===========*/
/* out: TRUE if call succeeded */
char* path, /* in: pathname of the file */
const char* path, /* in: pathname of the file */
ibool* exists, /* out: TRUE if file exists */
os_file_type_t* type) /* out: type of the file (if it exists) */
{
@@ -2311,7 +2329,7 @@ os_file_dirname(
/*============*/
/* out, own: directory component of the
pathname */
char* path) /* in: pathname */
const char* path) /* in: pathname */
{
char* dir;
int i, length, last_slash;
@@ -2348,7 +2366,7 @@ os_file_create_subdirs_if_needed(
/*=============================*/
/* out: TRUE if call succeeded
FALSE otherwise */
char* path) /* in: path name */
const char* path) /* in: path name */
{
char* subdir;
static char rootdir[2] = { OS_FILE_PATH_SEPARATOR, 0 };
@@ -2745,7 +2763,7 @@ os_aio_array_reserve_slot(
void* message2,/* in: message to be passed along with
the aio operation */
os_file_t file, /* in: file handle */
char* name, /* in: name of the file or path as a
const char* name, /* in: name of the file or path as a
null-terminated string */
void* buf, /* in: buffer where to read or from which
to write */
@@ -2992,7 +3010,7 @@ os_aio(
because i/os are not actually handled until
all have been posted: use with great
caution! */
char* name, /* in: name of the file or path as a
const char* name, /* in: name of the file or path as a
null-terminated string */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer where to read or from which
@@ -3535,6 +3553,7 @@ consecutive_loop:
if (n_consecutive == 1) {
/* We can use the buffer of the i/o request */
combined_buf = slot->buf;
combined_buf2 = NULL;
} else {
combined_buf2 = ut_malloc(total_len + UNIV_PAGE_SIZE);
@@ -3630,7 +3649,7 @@ consecutive_loop:
}
}
if (n_consecutive > 1) {
if (combined_buf2) {
ut_free(combined_buf2);
}

View File

@@ -110,7 +110,7 @@ os_event_t
os_event_create(
/*============*/
/* out: the event handle */
char* name) /* in: the name of the event, if NULL
const char* name) /* in: the name of the event, if NULL
the event is created without a name */
{
#ifdef __WIN__
@@ -167,7 +167,7 @@ os_event_t
os_event_create_auto(
/*=================*/
/* out: the event handle */
char* name) /* in: the name of the event, if NULL
const char* name) /* in: the name of the event, if NULL
the event is created without a name */
{
os_event_t event;
@@ -431,7 +431,7 @@ os_mutex_t
os_mutex_create(
/*============*/
/* out: the mutex handle */
char* name) /* in: the name of the mutex, if NULL
const char* name) /* in: the name of the mutex, if NULL
the mutex is created without a name */
{
#ifdef __WIN__

View File

@@ -1713,7 +1713,8 @@ Called by yyparse on error. */
void
yyerror(
/*====*/
char* s __attribute__((unused))) /* in: error message string */
const char* s __attribute__((unused)))
/* in: error message string */
{
ut_ad(s);
@@ -1729,7 +1730,7 @@ que_t*
pars_sql(
/*=====*/
/* out, own: the query graph */
char* str) /* in: SQL string */
const char* str) /* in: SQL string */
{
sym_node_t* sym_node;
mem_heap_t* heap;

View File

@@ -217,13 +217,10 @@ sym_tab_add_id(
node->common.type = QUE_NODE_SYMBOL;
node->name = mem_heap_alloc(sym_tab->heap, len + 1);
node->resolved = FALSE;
node->indirection = NULL;
ut_memcpy(node->name, name, len);
node->name[len] = '\0';
node->name = mem_heap_strdupl(sym_tab->heap, name, len + 1);
node->name_len = len;
UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node);

View File

@@ -803,8 +803,7 @@ row_ins_foreign_check_on_constraint(
"InnoDB: clustered record ", stderr);
rec_print(stderr, clust_rec);
fputs("\n"
"InnoDB: Make a detailed bug report and send it\n"
"InnoDB: to mysql@lists.mysql.com\n", stderr);
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
err = DB_SUCCESS;

View File

@@ -714,7 +714,7 @@ run_again:
trx_start_if_not_started(trx);
err = lock_table(0, prebuilt->table, prebuilt->select_lock_type, thr);
err = lock_table(0, prebuilt->table, LOCK_AUTO_INC, thr);
trx->error_state = err;
@@ -1688,12 +1688,13 @@ row_table_add_foreign_constraints(
/*==============================*/
/* out: error code or DB_SUCCESS */
trx_t* trx, /* in: transaction */
char* sql_string, /* in: table create statement where
const char* sql_string, /* in: table create statement where
foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
name before it: test.table2 */
char* name) /* in: table full name in the normalized form
table2 can be written also with the
database name before it: test.table2 */
const char* name) /* in: table full name in the
normalized form
database_name/table_name */
{
ulint err;
@@ -1941,7 +1942,7 @@ int
row_discard_tablespace_for_mysql(
/*=============================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: table name */
const char* name, /* in: table name */
trx_t* trx) /* in: transaction handle */
{
dulint new_id;
@@ -2072,7 +2073,7 @@ int
row_import_tablespace_for_mysql(
/*============================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: table name */
const char* name, /* in: table name */
trx_t* trx) /* in: transaction handle */
{
dict_table_t* table;
@@ -2178,7 +2179,7 @@ int
row_drop_table_for_mysql(
/*=====================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: table name */
const char* name, /* in: table name */
trx_t* trx, /* in: transaction handle */
ibool drop_db)/* in: TRUE=dropping whole database */
{
@@ -2520,16 +2521,17 @@ int
row_drop_database_for_mysql(
/*========================*/
/* out: error code or DB_SUCCESS */
char* name, /* in: database name which ends to '/' */
const char* name, /* in: database name which ends to '/' */
trx_t* trx) /* in: transaction handle */
{
dict_table_t* table;
char* table_name;
int err = DB_SUCCESS;
ulint namelen = strlen(name);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_a(name != NULL);
ut_a(name[strlen(name) - 1] == '/');
ut_a(name[namelen - 1] == '/');
trx->op_info = (char *) "dropping database";
@@ -2538,7 +2540,7 @@ loop:
row_mysql_lock_data_dictionary(trx);
while ((table_name = dict_get_first_table_name_in_db(name))) {
ut_a(strcmp(table_name, name) == 0);
ut_a(memcmp(table_name, name, namelen) == 0);
table = dict_table_get_low(table_name);
@@ -2611,8 +2613,8 @@ int
row_rename_table_for_mysql(
/*=======================*/
/* out: error code or DB_SUCCESS */
char* old_name, /* in: old table name */
char* new_name, /* in: new table name */
const char* old_name, /* in: old table name */
const char* new_name, /* in: new table name */
trx_t* trx) /* in: transaction handle */
{
dict_table_t* table;

View File

@@ -2410,8 +2410,7 @@ row_sel_get_clust_rec_for_mysql(
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
"InnoDB: Make a detailed bug report and send it\n"
"InnoDB: to mysql@lists.mysql.com\n", stderr);
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
}
clust_rec = NULL;
@@ -3586,11 +3585,11 @@ consistent read result, or store it to the query cache. */
ibool
row_search_check_if_query_cache_permitted(
/*======================================*/
/* out: TRUE if storing or retrieving from
the query cache is permitted */
/* out: TRUE if storing or retrieving
from the query cache is permitted */
trx_t* trx, /* in: transaction object */
char* norm_name) /* in: concatenation of database name, '/'
char, table name */
const char* norm_name) /* in: concatenation of database name,
'/' char, table name */
{
dict_table_t* table;
ibool ret = FALSE;

View File

@@ -441,8 +441,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
putc('\n', stderr);
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
"InnoDB: Make a detailed bug report and send it\n"
"InnoDB: to mysql@lists.mysql.com\n", stderr);
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
} else {
btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur);

View File

@@ -1236,8 +1236,7 @@ row_upd_sec_index_entry(
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
"InnoDB: Make a detailed bug report and send it\n"
"InnoDB: to mysql@lists.mysql.com\n", stderr);
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
} else {
/* Delete mark the old index record; it can already be
delete marked if we return after a lock wait in

View File

@@ -53,7 +53,7 @@ struct sync_cell_struct {
rw_lock_t* old_wait_rw_lock;/* the latest wait rw-lock in cell */
ulint request_type; /* lock type requested on the
object */
char* file; /* in debug version file where
const char* file; /* in debug version file where
requested */
ulint line; /* in debug version line where
requested */
@@ -329,7 +329,7 @@ sync_array_reserve_cell(
sync_array_t* arr, /* in: wait array */
void* object, /* in: pointer to the object to wait for */
ulint type, /* in: lock request type */
char* file, /* in: file where requested */
const char* file, /* in: file where requested */
ulint line, /* in: line where requested */
ulint* index) /* out: index of the reserved cell */
{

View File

@@ -89,7 +89,7 @@ void
rw_lock_create_func(
/*================*/
rw_lock_t* lock, /* in: pointer to memory */
char* cfile_name, /* in: file name where created */
const char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */
{
/* If this is the very first time a synchronization
@@ -213,7 +213,7 @@ rw_lock_s_lock_spin(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock
will be passed to another thread to unlock */
char* file_name, /* in: file name where lock requested */
const char* file_name, /* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ulint index; /* index of the reserved wait cell */
@@ -324,7 +324,7 @@ rw_lock_x_lock_low(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
#ifdef UNIV_SYNC_DEBUG
@@ -429,7 +429,7 @@ rw_lock_x_lock_func(
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass, /* in: pass value; != 0, if the lock will
be passed to another thread to unlock */
char* file_name,/* in: file name where lock requested */
const char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
ulint index; /* index of the reserved wait cell */
@@ -551,7 +551,7 @@ rw_lock_debug_mutex_enter(void)
{
loop:
if (0 == mutex_enter_nowait(&rw_lock_debug_mutex,
IB__FILE__, __LINE__)) {
__FILE__, __LINE__)) {
return;
}
@@ -560,7 +560,7 @@ loop:
rw_lock_debug_waiters = TRUE;
if (0 == mutex_enter_nowait(&rw_lock_debug_mutex,
IB__FILE__, __LINE__)) {
__FILE__, __LINE__)) {
return;
}

View File

@@ -201,7 +201,7 @@ void
mutex_create_func(
/*==============*/
mutex_t* mutex, /* in: pointer to memory */
char* cfile_name, /* in: file name where created */
const char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */
{
#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
@@ -294,7 +294,7 @@ mutex_enter_nowait(
/*===============*/
/* out: 0 if succeed, 1 if not */
mutex_t* mutex, /* in: pointer to mutex */
char* file_name __attribute__((unused)),
const char* file_name __attribute__((unused)),
/* in: file name where mutex
requested */
ulint line __attribute__((unused)))
@@ -358,7 +358,8 @@ void
mutex_spin_wait(
/*============*/
mutex_t* mutex, /* in: pointer to mutex */
char* file_name, /* in: file name where mutex requested */
const char* file_name, /* in: file name where
mutex requested */
ulint line) /* in: line where requested */
{
ulint index; /* index of the reserved wait cell */

View File

@@ -823,17 +823,16 @@ trx_undo_update_rec_get_update(
if (field_no >= dict_index_get_n_fields(index)) {
fprintf(stderr,
"InnoDB: Error: trying to access"
" update undo rec field %lu in ", (ulong) field_no);
"InnoDB: Error: trying to access update undo rec field %lu in ", (ulong) field_no);
dict_index_name_print(stderr, index);
fprintf(stderr, "\n"
"InnoDB: but index has only %lu fields\n"
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n"
"InnoDB: Run also CHECK TABLE ",
"InnoDB: but index has only %lu fields\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: Run also CHECK TABLE ",
(ulong) dict_index_get_n_fields(index));
ut_print_name(stderr, index->table_name);
fprintf(stderr, "\n"
"InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
"InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
(ulong) n_fields, (ulong) i, ptr);
return(NULL);
}
@@ -1067,7 +1066,7 @@ trx_undo_report_row_operation(
undo_page = buf_page_get_gen(undo->space, page_no,
RW_X_LATCH, undo->guess_page,
BUF_GET,
IB__FILE__, __LINE__,
__FILE__, __LINE__,
&mtr);
#ifdef UNIV_SYNC_DEBUG
@@ -1271,8 +1270,7 @@ trx_undo_prev_version_build(
" update undo rec for non-clustered ", stderr);
dict_index_name_print(stderr, index);
fputs("\n"
"InnoDB: Send a detailed bug report to"
" mysql@lists.mysql.com\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: index record ", stderr);
rec_print(stderr, index_rec);
fputs("\n"
@@ -1320,11 +1318,9 @@ trx_undo_prev_version_build(
" update undo rec for table ", stderr);
ut_print_name(stderr, index->table_name);
fputs("\n"
"InnoDB: but the table id in the"
" undo record is wrong\n"
"InnoDB: Send a detailed bug report to "
"mysql@lists.mysql.com\n"
"InnoDB: Run also CHECK TABLE ", stderr);
"InnoDB: but the table id in the undo record is wrong\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: Run also CHECK TABLE ", stderr);
ut_print_name(stderr, index->table_name);
putc('\n', stderr);
}

View File

@@ -200,7 +200,7 @@ trx_rollback_to_savepoint_for_mysql(
DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
char* savepoint_name, /* in: savepoint name */
const char* savepoint_name, /* in: savepoint name */
ib_longlong* mysql_binlog_cache_pos) /* out: the MySQL binlog cache
position corresponding to this
savepoint; MySQL needs this
@@ -265,7 +265,7 @@ trx_savepoint_for_mysql(
/*====================*/
/* out: always DB_SUCCESS */
trx_t* trx, /* in: transaction handle */
char* savepoint_name, /* in: savepoint name */
const char* savepoint_name, /* in: savepoint name */
ib_longlong binlog_cache_pos) /* in: MySQL binlog cache
position corresponding to this
connection at the time of the

View File

@@ -569,7 +569,7 @@ replication has proceeded. */
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
char* file_name,/* in: MySQL log file name */
const char* file_name,/* in: MySQL log file name */
ib_longlong offset, /* in: position in that log file */
ulint field, /* in: offset of the MySQL log info field in
the trx sys header */

View File

@@ -1564,7 +1564,9 @@ trx_mark_sql_stat_end(
/**************************************************************************
Prints info about a transaction to the standard output. The caller must
own the kernel mutex. */
own the kernel mutex and must have called
innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or
InnoDB cannot meanwhile change the info printed here. */
void
trx_print(

View File

@@ -23,7 +23,7 @@ const char* ut_dbg_msg_assert_fail =
"InnoDB: Assertion failure in thread %lu in file %s line %lu\n";
const char* ut_dbg_msg_trap =
"InnoDB: We intentionally generate a memory trap.\n"
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n"
"InnoDB: Submit a detailed bug report to http://bugs.mysql.com.\n"
"InnoDB: If you get repeated assertion failures or crashes, even\n"
"InnoDB: immediately after the mysqld startup, there may be\n"
"InnoDB: corruption in the InnoDB tablespace. See section 6.1 of\n"

View File

@@ -36,79 +36,6 @@ because we define ulint as unsigned __int64 and lint as __int64 on Windows,
and both the Microsoft and Intel C compilers require the format string
%I64 in that case instead of %l. */
int
ut_printf(
/*======*/
/* out: the number of characters written, or
negative in case of an error */
const char* format, /* in: format of prints */
...) /* in: arguments to be printed */
{
va_list args;
ulint len;
char* format_end;
char* newformat;
char* ptr;
char* newptr;
int ret;
char format_buf_in_stack[500];
len = strlen(format);
if (len > 250) {
newformat = malloc(2 * len);
} else {
newformat = format_buf_in_stack;
}
format_end = (char*)format + len;
ptr = (char*)format;
newptr = newformat;
#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64))
/* Replace %l with %I64 if it is not preceded with '\' */
while (ptr < format_end) {
if (*ptr == '%' && *(ptr + 1) == 'l'
&& (ptr == format || *(ptr - 1) != '\\')) {
memcpy(newptr, "%I64", 4);
ptr += 2;
newptr += 4;
} else {
*newptr = *ptr;
ptr++;
newptr++;
}
}
*newptr = '\0';
ut_a(newptr < newformat + 2 * len);
#else
strcpy(newformat, format);
#endif
va_start(args, format);
ret = vprintf((const char*)newformat, args);
va_end(args);
if (newformat != format_buf_in_stack) {
free(newformat);
}
return(ret);
}
/************************************************************
On the 64-bit Windows we substitute the format string
%l -> %I64
because we define ulint as unsigned __int64 and lint as __int64 on Windows,
and both the Microsoft and Intel C compilers require the format string
%I64 in that case instead of %l. */
int
ut_sprintf(
/*=======*/

View File

@@ -3729,28 +3729,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
mysql= mysql->last_used_con;
if (stmt->update_max_length && !stmt->bind_result_done)
{
/*
We must initalize the bind structure to be able to calculate
max_length
*/
MYSQL_BIND *bind, *end;
MYSQL_FIELD *field;
bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count);
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields;
bind < end ;
bind++, field++)
{
bind->buffer_type= field->type;
bind->buffer_length=1;
}
mysql_stmt_bind_result(stmt, stmt->bind);
stmt->bind_result_done= 0; /* No normal bind done */
}
while ((pkt_len= net_safe_read(mysql)) != packet_error)
{
cp= net->read_pos;
@@ -3768,8 +3746,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
memcpy((char *) cur->data, (char *) cp+1, pkt_len-1);
cur->length= pkt_len; /* To allow us to do sanity checks */
result->rows++;
if (stmt->update_max_length)
stmt_update_metadata(stmt, cur);
}
else
{
@@ -3814,6 +3790,29 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
result->rows= 0;
stmt->data_cursor= NULL;
}
if (stmt->update_max_length && !stmt->bind_result_done)
{
/*
We must initalize the bind structure to be able to calculate
max_length
*/
MYSQL_BIND *bind, *end;
MYSQL_FIELD *field;
bzero((char*) stmt->bind, sizeof(*stmt->bind)* stmt->field_count);
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields;
bind < end ;
bind++, field++)
{
bind->buffer_type= field->type;
bind->buffer_length=1;
}
mysql_stmt_bind_result(stmt, stmt->bind);
stmt->bind_result_done= 0; /* No normal bind done */
}
if ((*mysql->methods->read_binary_rows)(stmt))
{
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
@@ -3822,6 +3821,13 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
if (stmt->update_max_length)
{
MYSQL_ROWS *cur= result->data;
for(; cur; cur=cur->next)
stmt_update_metadata(stmt, cur);
}
stmt->data_cursor= result->data;
mysql->affected_rows= stmt->affected_rows= result->rows;
stmt->read_row_func= stmt_read_row_buffered;

View File

@@ -26,6 +26,7 @@ mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
my_readline.h sql_string.h completion_hash.h
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD)
client_test_LINK = $(CXXLINK)
client_test_SOURCES = client_test.c
clean:

View File

@@ -197,6 +197,8 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
DBUG_RETURN(1);
}
stmt->affected_rows= stmt->mysql->affected_rows;
stmt->insert_id= stmt->mysql->insert_id;
DBUG_RETURN(0);
}
@@ -605,13 +607,14 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
if (!(res=item->val_str(&tmp)))
{
client_field->def= strdup_root(field_alloc, "");
client_field->def_length= 0;
client_field->def= strmake_root(field_alloc, "",0);
}
else
{
client_field->def= strdup_root(field_alloc, res->ptr());
client_field->def_length= res->length();
client_field->def= strmake_root(field_alloc, res->ptr(),
client_field->def_length);
}
}
else

View File

@@ -90,8 +90,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
/* Skip rows inserted by current inserted */
for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ;
!r &&
(subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra)) > 0 &&
!r && info->lastpos >= info->state->data_file_length ;
info->lastpos >= info->state->data_file_length ;
r= _mi_search_next(info, keyinfo, info->lastkey,
info->lastkey_length, SEARCH_BIGGER, key_root))
;

View File

@@ -311,7 +311,7 @@ static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block,
DBUG_RETURN(1); /* Wrong delete link */
}
}
return 0;
DBUG_RETURN(0);
}
/* Delete datarecord from database */

View File

@@ -30,15 +30,27 @@ static uint _mi_keynr(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page,
uchar *keypos,uint *ret_max_key);
/* If start_key = 0 assume read from start */
/* If end_key = 0 assume read to end */
/* Returns HA_POS_ERROR on error */
/*
Estimate how many records there is in a given range
ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key,
uint start_key_len,
enum ha_rkey_function start_search_flag,
const byte *end_key, uint end_key_len,
enum ha_rkey_function end_search_flag)
SYNOPSIS
mi_records_in_range()
info MyISAM handler
inx Index to use
min_key Min key. Is = 0 if no min range
max_key Max key. Is = 0 if no max range
NOTES
We should ONLY return 0 if there is no rows in range
RETURN
HA_POS_ERROR error (or we can't estimate number of rows)
number Estimated number of rows
*/
ha_rows mi_records_in_range(MI_INFO *info, int inx, key_range *min_key,
key_range *max_key)
{
ha_rows start_pos,end_pos,res;
DBUG_ENTER("mi_records_in_range");
@@ -56,25 +68,29 @@ ha_rows mi_records_in_range(MI_INFO *info, int inx, const byte *start_key,
case HA_KEY_ALG_RTREE:
{
uchar * key_buff;
if (start_key_len == 0)
start_key_len=USE_WHOLE_KEY;
key_buff=info->lastkey+info->s->base.max_key_length;
start_key_len= _mi_pack_key(info,inx,key_buff,(uchar*) start_key,
start_key_len, (HA_KEYSEG**) 0);
res=rtree_estimate(info, inx, key_buff, start_key_len, myisam_read_vec[start_search_flag]);
res=res?res:1;
uint start_key_len;
key_buff= info->lastkey+info->s->base.max_key_length;
start_key_len= _mi_pack_key(info,inx, key_buff,
(uchar*) min_key->key, min_key->length,
(HA_KEYSEG**) 0);
res= rtree_estimate(info, inx, key_buff, start_key_len,
myisam_read_vec[min_key->flag]);
res= res ? res : 1; /* Don't return 0 */
break;
}
case HA_KEY_ALG_BTREE:
default:
start_pos= (start_key ?
_mi_record_pos(info,start_key,start_key_len,start_search_flag) :
start_pos= (min_key ?
_mi_record_pos(info, min_key->key, min_key->length,
min_key->flag) :
(ha_rows) 0);
end_pos= (end_key ?
_mi_record_pos(info,end_key,end_key_len,end_search_flag) :
end_pos= (max_key ?
_mi_record_pos(info, max_key->key, max_key->length,
max_key->flag) :
info->state->records+ (ha_rows) 1);
res=end_pos < start_pos ? (ha_rows) 0 :
(end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos);
res= (end_pos < start_pos ? (ha_rows) 0 :
(end_pos == start_pos ? (ha_rows) 1 : end_pos-start_pos));
if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR)
res=HA_POS_ERROR;
}

View File

@@ -606,13 +606,20 @@ int main(int argc, char *argv[])
mi_status(file,&info,HA_STATUS_VARIABLE);
for (i=0 ; i < info.keys ; i++)
{
key_range min_key, max_key;
if (mi_rfirst(file,read_record,(int) i) ||
mi_rlast(file,read_record2,(int) i))
goto err;
copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key);
copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2);
range_records=mi_records_in_range(file,(int) i,key,0,HA_READ_KEY_EXACT,
key2,0,HA_READ_AFTER_KEY);
min_key.key= key;
min_key.length= USE_WHOLE_KEY;
min_key.flag= HA_READ_KEY_EXACT;
max_key.key= key2;
max_key.length= USE_WHOLE_KEY;
max_key.flag= HA_READ_AFTER_KEY;
range_records= mi_records_in_range(file,(int) i, &min_key, &max_key);
if (range_records < info.records*8/10 ||
range_records > info.records*12/10)
{
@@ -634,12 +641,19 @@ int main(int argc, char *argv[])
for (k=rnd(1000)+1 ; k>0 && key1[k] == 0 ; k--) ;
if (j != 0 && k != 0)
{
key_range min_key, max_key;
if (j > k)
swap(int,j,k);
sprintf(key,"%6d",j);
sprintf(key2,"%6d",k);
range_records=mi_records_in_range(file,0,key,0,HA_READ_AFTER_KEY,
key2,0,HA_READ_BEFORE_KEY);
min_key.key= key;
min_key.length= USE_WHOLE_KEY;
min_key.flag= HA_READ_AFTER_KEY;
max_key.key= key2;
max_key.length= USE_WHOLE_KEY;
max_key.flag= HA_READ_BEFORE_KEY;
range_records= mi_records_in_range(file, 0, &min_key, &max_key);
records=0;
for (j++ ; j < k ; j++)
records+=key1[j];

View File

@@ -39,8 +39,7 @@ int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
}
int run_test(const char *filename)
static int run_test(const char *filename)
{
MI_INFO *file;
MI_UNIQUEDEF uniquedef;
@@ -48,6 +47,7 @@ int run_test(const char *filename)
MI_COLUMNDEF recinfo[20];
MI_KEYDEF keyinfo[20];
HA_KEYSEG keyseg[20];
key_range range;
int silent=0;
int opt_unique=0;
@@ -66,15 +66,12 @@ int run_test(const char *filename)
int upd= 10;
ha_rows hrows;
/* Define a column for NULLs and DEL markers*/
recinfo[0].type=FIELD_NORMAL;
recinfo[0].length=1; /* For NULL bits */
rec_length=1;
/* Define 2*ndims columns for coordinates*/
for (i=1; i<=2*ndims ;i++){
@@ -83,7 +80,6 @@ int run_test(const char *filename)
rec_length+=key_length;
}
/* Define a key with 2*ndims segments */
keyinfo[0].seg=keyseg;
@@ -101,8 +97,7 @@ int run_test(const char *filename)
keyinfo[0].seg[i].language=default_charset_info->number;
}
if(!silent)
if (!silent)
printf("- Creating isam-file\n");
bzero((char*) &create_info,sizeof(create_info));
@@ -115,16 +110,12 @@ int run_test(const char *filename)
recinfo,uniques,&uniquedef,&create_info,create_flag))
goto err;
if(!silent)
if (!silent)
printf("- Open isam-file\n");
if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED)))
goto err;
if (!silent)
printf("- Writing key:s\n");
@@ -144,11 +135,9 @@ int run_test(const char *filename)
}
}
if((error=read_with_pos(file,silent)))
if ((error=read_with_pos(file,silent)))
goto err;
if (!silent)
printf("- Reading rows with key\n");
@@ -160,12 +149,12 @@ int run_test(const char *filename)
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rkey(file,read_record,0,record+1,0,HA_READ_MBR_EQUAL);
if(error && error!=HA_ERR_KEY_NOT_FOUND)
if (error && error!=HA_ERR_KEY_NOT_FOUND)
{
printf(" mi_rkey: %3d errno: %3d\n",error,my_errno);
goto err;
}
if(error == HA_ERR_KEY_NOT_FOUND)
if (error == HA_ERR_KEY_NOT_FOUND)
{
print_record(record,mi_position(file)," NOT FOUND\n");
continue;
@@ -173,10 +162,6 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file),"\n");
}
if (!silent)
printf("- Deleting rows\n");
for (i=0; i < nrecords/4; i++)
@@ -184,7 +169,7 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if(error)
if (error)
{
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
@@ -192,14 +177,13 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file),"\n");
error=mi_delete(file,read_record);
if(error)
if (error)
{
printf("pos: %2d mi_delete: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
if (!silent)
printf("- Updating rows with position\n");
for (i=0; i < (nrecords - nrecords/4) ; i++)
@@ -207,9 +191,9 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if(error)
if (error)
{
if(error==HA_ERR_RECORD_DELETED)
if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
@@ -219,19 +203,16 @@ int run_test(const char *filename)
printf("\t-> ");
print_record(record,mi_position(file),"\n");
error=mi_update(file,read_record,record);
if(error)
if (error)
{
printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
if((error=read_with_pos(file,silent)))
if ((error=read_with_pos(file,silent)))
goto err;
if (!silent)
printf("- Test mi_rkey then a sequence of mi_rnext_same\n");
@@ -246,25 +227,20 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file)," mi_rkey\n");
row_count=1;
do {
if((error=mi_rnext_same(file,read_record)))
for (;;)
{
if(error==HA_ERR_END_OF_FILE)
if ((error=mi_rnext_same(file,read_record)))
{
if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
}
print_record(read_record,mi_position(file)," mi_rnext_same\n");
row_count++;
}while(1);
}
printf(" %d rows\n",row_count);
if (!silent)
printf("- Test mi_rfirst then a sequence of mi_rnext\n");
@@ -277,10 +253,11 @@ int run_test(const char *filename)
row_count=1;
print_record(read_record,mi_position(file)," mi_frirst\n");
for(i=0;i<nrecords;i++) {
if((error=mi_rnext(file,read_record,0)))
for (i=0;i<nrecords;i++)
{
if(error==HA_ERR_END_OF_FILE)
if ((error=mi_rnext(file,read_record,0)))
{
if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
@@ -290,15 +267,17 @@ int run_test(const char *filename)
}
printf(" %d rows\n",row_count);
if (!silent)
printf("- Test mi_records_in_range()\n");
create_record1(record, nrecords*4/5);
print_record(record,0,"\n");
hrows=mi_records_in_range(file,0,record+1,0,HA_READ_MBR_INTERSECT,record+1,0,0);
printf(" %ld rows\n", (long) hrows);
range.key= record+1;
range.length= 1000; /* Big enough */
range.flag= HA_READ_MBR_INTERSECT;
hrows= mi_records_in_range(file,0, &range, (key_range*) 0);
printf(" %ld rows\n", (long) hrows);
if (mi_close(file)) goto err;
my_end(MY_CHECK_ERROR);
@@ -325,11 +304,11 @@ static int read_with_pos (MI_INFO * file,int silent)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if(error)
if (error)
{
if(error==HA_ERR_END_OF_FILE)
if (error==HA_ERR_END_OF_FILE)
break;
if(error==HA_ERR_RECORD_DELETED)
if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
return error;

View File

@@ -32,10 +32,10 @@ static void print_key(const char *key,const char * tail);
static int run_test(const char *filename);
static int read_with_pos(MI_INFO * file, int silent);
static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points, uchar *wkb);
static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points,
uchar *wkb);
static void rtree_PrintWKB(uchar *wkb, uint n_dims);
static char blob_key[MAX_REC_LENGTH];
@@ -46,7 +46,6 @@ int main(int argc __attribute__((unused)),char *argv[])
}
int run_test(const char *filename)
{
MI_INFO *file;
@@ -55,7 +54,7 @@ int run_test(const char *filename)
MI_COLUMNDEF recinfo[20];
MI_KEYDEF keyinfo[20];
HA_KEYSEG keyseg[20];
key_range min_range, max_range;
int silent=0;
int create_flag=0;
int null_fields=0;
@@ -100,7 +99,7 @@ int run_test(const char *filename)
keyinfo[0].seg[0].bit_start=4; /* Long BLOB */
if(!silent)
if (!silent)
printf("- Creating isam-file\n");
bzero((char*) &create_info,sizeof(create_info));
@@ -113,17 +112,12 @@ int run_test(const char *filename)
recinfo,uniques,&uniquedef,&create_info,create_flag))
goto err;
if(!silent)
if (!silent)
printf("- Open isam-file\n");
if (!(file=mi_open(filename,2,HA_OPEN_ABORT_IF_LOCKED)))
goto err;
if (!silent)
printf("- Writing key:s\n");
@@ -143,11 +137,9 @@ int run_test(const char *filename)
}
}
if((error=read_with_pos(file,silent)))
if ((error=read_with_pos(file,silent)))
goto err;
if (!silent)
printf("- Deleting rows with position\n");
for (i=0; i < nrecords/4; i++)
@@ -155,23 +147,20 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if(error)
if (error)
{
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
print_record(read_record,mi_position(file),"\n");
error=mi_delete(file,read_record);
if(error)
if (error)
{
printf("pos: %2d mi_delete: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
if (!silent)
printf("- Updating rows with position\n");
for (i=0; i < nrecords/2 ; i++)
@@ -179,9 +168,9 @@ int run_test(const char *filename)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if(error)
if (error)
{
if(error==HA_ERR_RECORD_DELETED)
if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
goto err;
@@ -191,20 +180,16 @@ int run_test(const char *filename)
printf("\t-> ");
print_record(record,mi_position(file),"\n");
error=mi_update(file,read_record,record);
if(error)
if (error)
{
printf("pos: %2d mi_update: %3d errno: %3d\n",i,error,my_errno);
goto err;
}
}
if((error=read_with_pos(file,silent)))
if ((error=read_with_pos(file,silent)))
goto err;
if (!silent)
printf("- Test mi_rkey then a sequence of mi_rnext_same\n");
@@ -219,25 +204,20 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file)," mi_rkey\n");
row_count=1;
do {
if((error=mi_rnext_same(file,read_record)))
for (;;)
{
if(error==HA_ERR_END_OF_FILE)
if ((error=mi_rnext_same(file,read_record)))
{
if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
}
print_record(read_record,mi_position(file)," mi_rnext_same\n");
row_count++;
}while(1);
}
printf(" %d rows\n",row_count);
if (!silent)
printf("- Test mi_rfirst then a sequence of mi_rnext\n");
@@ -251,9 +231,9 @@ int run_test(const char *filename)
print_record(read_record,mi_position(file)," mi_frirst\n");
for(i=0;i<nrecords;i++) {
if((error=mi_rnext(file,read_record,0)))
if ((error=mi_rnext(file,read_record,0)))
{
if(error==HA_ERR_END_OF_FILE)
if (error==HA_ERR_END_OF_FILE)
break;
printf("mi_next: %3d errno: %3d\n",error,my_errno);
goto err;
@@ -263,22 +243,22 @@ int run_test(const char *filename)
}
printf(" %d rows\n",row_count);
if (!silent)
printf("- Test mi_records_in_range()\n");
create_key(key, nrecords*upd);
print_key(key," INTERSECT\n");
hrows=mi_records_in_range(file,0,key,0,HA_READ_MBR_INTERSECT,record+1,0,
HA_READ_KEY_EXACT);
min_range.key= key;
min_range.length= 1000; /* Big enough */
min_range.flag= HA_READ_MBR_INTERSECT;
max_range.key= record+1;
max_range.length= 1000; /* Big enough */
max_range.flag= HA_READ_KEY_EXACT;
hrows= mi_records_in_range(file,0, &min_range, &max_range);
printf(" %ld rows\n", (long) hrows);
if (mi_close(file)) goto err;
my_end(MY_CHECK_ERROR);
return 0;
err:
@@ -287,7 +267,6 @@ err:
}
static int read_with_pos (MI_INFO * file,int silent)
{
int error;
@@ -302,11 +281,11 @@ static int read_with_pos (MI_INFO * file,int silent)
my_errno=0;
bzero((char*) read_record,MAX_REC_LENGTH);
error=mi_rrnd(file,read_record,i == 0 ? 0L : HA_OFFSET_ERROR);
if(error)
if (error)
{
if(error==HA_ERR_END_OF_FILE)
if (error==HA_ERR_END_OF_FILE)
break;
if(error==HA_ERR_RECORD_DELETED)
if (error==HA_ERR_RECORD_DELETED)
continue;
printf("pos: %2d mi_rrnd: %3d errno: %3d\n",i,error,my_errno);
return error;
@@ -351,7 +330,7 @@ static void print_record(char * record, my_off_t offs,const char * tail)
pos+=4;
printf(" len=%d ",len);
memcpy_fixed(&ptr,pos,sizeof(char*));
if(ptr)
if (ptr)
rtree_PrintWKB((uchar*) ptr,SPDIMS);
else
printf("<NULL> ");
@@ -360,7 +339,6 @@ static void print_record(char * record, my_off_t offs,const char * tail)
}
#ifdef NOT_USED
static void create_point(char *record,uint rownr)
{
@@ -447,7 +425,6 @@ static void print_key(const char *key,const char * tail)
}
#ifdef NOT_USED
static int rtree_CreatePointWKB(double *ords, uint n_dims, uchar *wkb)
@@ -489,6 +466,7 @@ static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points,
return 9 + n_points * n_dims * 8;
}
static void rtree_PrintWKB(uchar *wkb, uint n_dims)
{
uint wkb_type;

View File

@@ -16,20 +16,15 @@
#include "myrg_def.h"
ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, const byte *start_key,
uint start_key_len,
enum ha_rkey_function start_search_flag,
const byte *end_key, uint end_key_len,
enum ha_rkey_function end_search_flag)
ha_rows myrg_records_in_range(MYRG_INFO *info, int inx,
key_range *min_key, key_range *max_key)
{
ha_rows records=0, res;
MYRG_TABLE *table;
for (table=info->open_tables ; table != info->end_table ; table++)
{
res=mi_records_in_range(table->table, inx,
start_key, start_key_len, start_search_flag,
end_key, end_key_len, end_search_flag);
res= mi_records_in_range(table->table, inx, min_key, max_key);
if (res == HA_POS_ERROR)
return HA_POS_ERROR;
if (records > HA_POS_ERROR - res)

View File

@@ -142,6 +142,8 @@ a b
MySQL has now support for full-text search
select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
a b
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
a b
select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE);
a b
select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);

View File

@@ -301,3 +301,12 @@ a c grp
2 4 4
1 2 5
drop table t1,t2;
CREATE TABLE t1 ( a int );
CREATE TABLE t2 ( a int );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a)
1,2
2,4
DROP TABLE t1, t2;

View File

@@ -467,7 +467,7 @@ ERROR 23000: Duplicate entry 'test2' for key 2
select * from t1;
id ggid email passwd
1 this will work
4 test2 this will work
3 test2 this will work
select * from t1 where id=1;
id ggid email passwd
1 this will work
@@ -1538,6 +1538,60 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL auto_increment,
`id2` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `id` (`id`,`id2`),
CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL auto_increment,
`id2` int(11) NOT NULL default '0',
KEY `t1_id_fk` (`id`),
CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t2 add index id_test (id), add index id_test2 (id,id2);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL auto_increment,
`id2` int(11) NOT NULL default '0',
KEY `id_test` (`id`),
KEY `id_test2` (`id`,`id2`),
CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
ERROR HY000: Can't create table './test/t2.frm' (errno: 150)
drop table t1;
create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) NOT NULL auto_increment,
`b` int(11) default NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `b_2` (`b`),
KEY `b` (`b`),
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) NOT NULL auto_increment,
`b` int(11) default NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `b` (`b`),
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`),
CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2, t1;

View File

@@ -85,6 +85,15 @@ i
1
3
drop table t1;
create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null);
insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c');
select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc;
Building Name Building Number
Alpha 001
Beta 200c
Gamma 123
Gamma Ext 123a
drop table t1;
create table t1 (id int not null,col1 int not null,col2 int not null,index(col1));
insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4);
select * from t1 order by col1,col2;

View File

@@ -4,9 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (n int);
reset master;
stop slave;

View File

@@ -10,4 +10,4 @@ reset slave;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 326 None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 # None 0 No #

View File

@@ -70,6 +70,21 @@ select min(a) from t1;
min(a)
-0.010
drop table t1;
create table t1 (c1 double, c2 varchar(20));
insert t1 values (121,"16");
select c1 + c1 * (c2 / 100) as col from t1;
col
140.36
create table t2 select c1 + c1 * (c2 / 100) as col from t1;
select * from t2;
col
140.36
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`col` double default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
create table t1 (a float);
insert into t1 values (1);
select max(a),min(a),avg(a) from t1;

View File

@@ -63,6 +63,7 @@ select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOL
select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);

View File

@@ -179,3 +179,13 @@ select group_concat(c order by (select mid(group_concat(c order by a),1,5) from
select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
drop table t1,t2;
#
# group_concat of expression with GROUP BY and external GROUP BY
#
CREATE TABLE t1 ( a int );
CREATE TABLE t2 ( a int );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
DROP TABLE t1, t2;

View File

@@ -1082,8 +1082,28 @@ create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),cons
show create table t2;
drop table t2;
create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
show create table t2;
drop table t2;
create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
show create table t2;
alter table t2 add index id_test (id), add index id_test2 (id,id2);
show create table t2;
drop table t2;
# Test error handling
--error 1005
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
drop table t1;
# bug#3749
create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
show create table t2;
drop table t2;
create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
show create table t2;
drop table t2, t1;

View File

@@ -79,6 +79,16 @@ select distinct i from t1 order by 1-i;
select distinct i from t1 order by mod(i,2),i;
drop table t1;
#
# bug#3681
#
create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null);
insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c');
select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc;
drop table t1;
#
# Order by on first index part
#

View File

@@ -12,7 +12,7 @@ show slave status;
change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT
--replace_column 1 # 33 #
show slave status;
--replace_result $MASTER_MYPORT MASTER_PORT

View File

@@ -14,7 +14,7 @@ connection slave;
sync_with_master;
# The port number is different when doing the release build with
# Do-compile, hence we have to replace the port number here accordingly
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
# check that the table has been ignored, because otherwise the test is nonsense

View File

@@ -89,11 +89,11 @@ connection slave;
start slave;
sync_with_master;
show binary logs;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
show binlog events in 'slave-bin.000001' from 4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
show binlog events in 'slave-bin.000002' from 4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;

View File

@@ -4,7 +4,7 @@
source include/master-slave.inc;
show master status;
sync_slave_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
stop slave;
@@ -14,19 +14,19 @@ sleep 5;
stop slave;
change master to master_log_pos=73;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
start slave;
sleep 5;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
stop slave;
change master to master_log_pos=173;
start slave;
sleep 2;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
connection master;

View File

@@ -28,7 +28,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
stop slave;
@@ -37,7 +37,7 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
stop slave;
@@ -46,7 +46,7 @@ set global max_relay_log_size=0;
select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
@@ -57,7 +57,7 @@ reset slave;
# test of relay log rotation when the slave is stopped
# (to make sure it does not crash).
flush logs;
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
@@ -73,7 +73,7 @@ create table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
# one more rotation, to be sure Relay_Log_Space is correctly updated
@@ -83,7 +83,7 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;

View File

@@ -31,14 +31,14 @@ system chmod 600 var/slave-data/master.info;
# init_strvar_from_file() in init_master_info()).
--error 1201
start slave;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
# CHANGE MASTER will fail because it first parses master.info before changing
# it (so when master.info is bad, people have to use RESET SLAVE first).
--error 1201
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
reset slave;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
connection master;
reset master;
@@ -54,7 +54,7 @@ insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
sync_slave_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
select * from t1;
@@ -107,7 +107,7 @@ purge master logs before now();
show binary logs;
insert into t2 values (65);
sync_slave_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
select * from t2;
@@ -139,7 +139,7 @@ connection slave;
sync_with_master;
select * from t4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 33 #
show slave status;
# because of concurrent insert, the table may not be up to date

Some files were not shown because too many files have changed in this diff Show More