mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into mysql.com:/Users/mikron/patch_cluster
This commit is contained in:
commit
c8f36e8255
199 changed files with 2151 additions and 1608 deletions
|
@ -122,6 +122,7 @@ paul@ice.local
|
|||
paul@ice.snake.net
|
||||
paul@kite-hub.kitebird.com
|
||||
paul@teton.kitebird.com
|
||||
pekka@mysql.com
|
||||
pem@mysql.com
|
||||
peter@linux.local
|
||||
peter@mysql.com
|
||||
|
|
|
@ -2404,6 +2404,10 @@ static int
|
|||
com_shell(String *buffer, char *line __attribute__((unused)))
|
||||
{
|
||||
char *shell_cmd;
|
||||
|
||||
/* Skip space from line begin */
|
||||
while (isspace(*line))
|
||||
line++;
|
||||
if (!(shell_cmd = strchr(line, ' ')))
|
||||
{
|
||||
put_info("Usage: \\! shell-command", INFO_ERROR);
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
/************************************************************************
|
||||
|
|
|
@ -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) {
|
||||
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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. */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
/**********************************************************************
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;\
|
||||
|
|
|
@ -18,15 +18,15 @@ extern ulint ut_total_allocated_memory;
|
|||
|
||||
UNIV_INLINE
|
||||
void*
|
||||
ut_memcpy(void* dest, void* sour, ulint n);
|
||||
ut_memcpy(void* dest, const void* sour, ulint n);
|
||||
|
||||
UNIV_INLINE
|
||||
void*
|
||||
ut_memmove(void* dest, void* sour, ulint n);
|
||||
ut_memmove(void* dest, const void* sour, ulint n);
|
||||
|
||||
UNIV_INLINE
|
||||
int
|
||||
ut_memcmp(void* str1, void* str2, ulint n);
|
||||
ut_memcmp(const void* str1, const void* str2, ulint n);
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -75,7 +75,7 @@ ut_free_all_mem(void);
|
|||
|
||||
UNIV_INLINE
|
||||
char*
|
||||
ut_strcpy(char* dest, char* sour);
|
||||
ut_strcpy(char* dest, const char* sour);
|
||||
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
|
@ -83,7 +83,7 @@ ut_strlen(const char* str);
|
|||
|
||||
UNIV_INLINE
|
||||
int
|
||||
ut_strcmp(void* str1, void* str2);
|
||||
ut_strcmp(const void* str1, const void* str2);
|
||||
|
||||
/**************************************************************************
|
||||
Determine the length of a string when it is quoted with ut_strcpyq(). */
|
||||
|
@ -118,17 +118,6 @@ ut_memcpyq(
|
|||
const char* src, /* in: string to be quoted */
|
||||
ulint len); /* in: length of src */
|
||||
|
||||
/**************************************************************************
|
||||
Catenates two strings into newly allocated memory. The memory must be freed
|
||||
using mem_free. */
|
||||
|
||||
char*
|
||||
ut_str_catenate(
|
||||
/*============*/
|
||||
/* out, own: catenated null-terminated string */
|
||||
char* str1, /* in: null-terminated string */
|
||||
char* str2); /* in: null-terminated string */
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "ut0mem.ic"
|
||||
#endif
|
||||
|
|
|
@ -8,28 +8,28 @@ Created 5/30/1994 Heikki Tuuri
|
|||
|
||||
UNIV_INLINE
|
||||
void*
|
||||
ut_memcpy(void* dest, void* sour, ulint n)
|
||||
ut_memcpy(void* dest, const void* sour, ulint n)
|
||||
{
|
||||
return(memcpy(dest, sour, n));
|
||||
}
|
||||
|
||||
UNIV_INLINE
|
||||
void*
|
||||
ut_memmove(void* dest, void* sour, ulint n)
|
||||
ut_memmove(void* dest, const void* sour, ulint n)
|
||||
{
|
||||
return(memmove(dest, sour, n));
|
||||
}
|
||||
|
||||
UNIV_INLINE
|
||||
int
|
||||
ut_memcmp(void* str1, void* str2, ulint n)
|
||||
ut_memcmp(const void* str1, const void* str2, ulint n)
|
||||
{
|
||||
return(memcmp(str1, str2, n));
|
||||
}
|
||||
|
||||
UNIV_INLINE
|
||||
char*
|
||||
ut_strcpy(char* dest, char* sour)
|
||||
ut_strcpy(char* dest, const char* sour)
|
||||
{
|
||||
return(strcpy(dest, sour));
|
||||
}
|
||||
|
@ -43,9 +43,9 @@ ut_strlen(const char* str)
|
|||
|
||||
UNIV_INLINE
|
||||
int
|
||||
ut_strcmp(void* str1, void* str2)
|
||||
ut_strcmp(const void* str1, const void* str2)
|
||||
{
|
||||
return(strcmp((char*)str1, (char*)str2));
|
||||
return(strcmp((const char*)str1, (const char*)str2));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
@ -369,7 +369,16 @@ os_file_handle_error(
|
|||
return(FALSE);
|
||||
}
|
||||
|
||||
#if !defined(__WIN__) && !defined(UNIV_HOTBACKUP)
|
||||
#undef USE_FILE_LOCK
|
||||
#define USE_FILE_LOCK
|
||||
#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__)
|
||||
/* InnoDB Hot Backup does not lock the data files.
|
||||
* On Windows, mandatory locking is used.
|
||||
* On FreeBSD with LinuxThreads, advisory locking does not work properly.
|
||||
*/
|
||||
# undef USE_FILE_LOCK
|
||||
#endif
|
||||
#ifdef USE_FILE_LOCK
|
||||
/********************************************************************
|
||||
Obtain an exclusive lock on a file. */
|
||||
static
|
||||
|
@ -378,22 +387,24 @@ 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);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* !defined(__WIN__) && !defined(UNIV_HOTBACKUP) */
|
||||
#endif /* USE_FILE_LOCK */
|
||||
|
||||
/********************************************************************
|
||||
Does error handling when a file operation fails. */
|
||||
|
@ -404,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;
|
||||
|
@ -482,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__
|
||||
|
@ -574,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 */
|
||||
{
|
||||
|
@ -693,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;
|
||||
|
@ -735,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__
|
||||
|
@ -852,8 +868,8 @@ try_again:
|
|||
if (retry) {
|
||||
goto try_again;
|
||||
}
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
} else if (os_file_lock(file, name)) {
|
||||
#ifdef USE_FILE_LOCK
|
||||
} else if (os_file_lock(file, name, F_WRLCK)) {
|
||||
*success = FALSE;
|
||||
file = -1;
|
||||
#endif
|
||||
|
@ -871,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__
|
||||
|
@ -961,8 +979,8 @@ os_file_create_simple_no_error_handling(
|
|||
|
||||
if (file == -1) {
|
||||
*success = FALSE;
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
} else if (os_file_lock(file, name)) {
|
||||
#ifdef USE_FILE_LOCK
|
||||
} else if (os_file_lock(file, name, F_WRLCK)) {
|
||||
*success = FALSE;
|
||||
file = -1;
|
||||
#endif
|
||||
|
@ -980,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 */
|
||||
{
|
||||
|
@ -1172,8 +1193,8 @@ try_again:
|
|||
if (retry) {
|
||||
goto try_again;
|
||||
}
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
} else if (os_file_lock(file, name)) {
|
||||
#ifdef USE_FILE_LOCK
|
||||
} else if (os_file_lock(file, name, F_WRLCK)) {
|
||||
*success = FALSE;
|
||||
file = -1;
|
||||
#endif
|
||||
|
@ -1192,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;
|
||||
|
@ -1253,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;
|
||||
|
@ -1316,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;
|
||||
|
@ -1329,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
|
||||
|
@ -1374,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) {
|
||||
|
@ -1410,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) {
|
||||
|
@ -1499,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
|
||||
|
@ -1760,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 */
|
||||
|
@ -2040,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
|
||||
|
@ -2197,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) */
|
||||
{
|
||||
|
@ -2302,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;
|
||||
|
@ -2339,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 };
|
||||
|
@ -2736,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 */
|
||||
|
@ -2983,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
|
||||
|
@ -3526,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);
|
||||
|
||||
|
@ -3621,7 +3649,7 @@ consecutive_loop:
|
|||
}
|
||||
}
|
||||
|
||||
if (n_consecutive > 1) {
|
||||
if (combined_buf2) {
|
||||
ut_free(combined_buf2);
|
||||
}
|
||||
|
||||
|
|
|
@ -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__
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -273,29 +273,3 @@ ut_memcpyq(
|
|||
|
||||
return(dest);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Catenates two strings into newly allocated memory. The memory must be freed
|
||||
using mem_free. */
|
||||
|
||||
char*
|
||||
ut_str_catenate(
|
||||
/*============*/
|
||||
/* out, own: catenated null-terminated string */
|
||||
char* str1, /* in: null-terminated string */
|
||||
char* str2) /* in: null-terminated string */
|
||||
{
|
||||
ulint len1;
|
||||
ulint len2;
|
||||
char* str;
|
||||
|
||||
len1 = ut_strlen(str1);
|
||||
len2 = ut_strlen(str2);
|
||||
|
||||
str = mem_alloc(len1 + len2 + 1);
|
||||
|
||||
ut_memcpy(str, str1, len1);
|
||||
ut_memcpy(str + len1, str2, len2 + 1);
|
||||
|
||||
return(str);
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
/*=======*/
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -39,7 +39,6 @@ int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
|
|||
}
|
||||
|
||||
|
||||
|
||||
int run_test(const char *filename)
|
||||
{
|
||||
MI_INFO *file;
|
||||
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -142,7 +142,7 @@ explain extended select last_insert_id();
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority no_cache last_insert_id() AS `last_insert_id()`
|
||||
Note 1003 select sql_no_cache last_insert_id() AS `last_insert_id()`
|
||||
insert into t1 set i = 254;
|
||||
ERROR 23000: Duplicate entry '254' for key 1
|
||||
select last_insert_id();
|
||||
|
|
|
@ -7,5 +7,5 @@ explain extended select count(distinct n) from t1;
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL n 4 NULL 200 Using index
|
||||
Warnings:
|
||||
Note 1003 select high_priority count(distinct test.t1.n) AS `count(distinct n)` from test.t1
|
||||
Note 1003 select count(distinct test.t1.n) AS `count(distinct n)` from test.t1
|
||||
drop table t1;
|
||||
|
|
|
@ -27,7 +27,7 @@ explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" E
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END`
|
||||
Note 1003 select (case 1 when 1 then _latin1'one' when 2 then _latin1'two' else _latin1'more' end) AS `CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END`
|
||||
select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END;
|
||||
CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END
|
||||
two
|
||||
|
@ -66,7 +66,7 @@ explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase,
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select high_priority (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end)
|
||||
Note 1003 select (case test.t1.a when 1 then 2 when 2 then 3 else 0 end) AS `fcase`,count(0) AS `count(*)` from test.t1 group by (case test.t1.a when 1 then 2 when 2 then 3 else 0 end)
|
||||
select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase;
|
||||
fcase count(*)
|
||||
nothing 2
|
||||
|
@ -141,7 +141,7 @@ COALESCE('a' COLLATE latin1_bin,'b');
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')`
|
||||
Note 1003 select coalesce(1) AS `COALESCE(1)`,coalesce(1.0) AS `COALESCE(1.0)`,coalesce(_latin1'a') AS `COALESCE('a')`,coalesce(1,1.0) AS `COALESCE(1,1.0)`,coalesce(1,_latin1'1') AS `COALESCE(1,'1')`,coalesce(1.1,_latin1'1') AS `COALESCE(1.1,'1')`,coalesce((_latin1'a' collate _latin1'latin1_bin'),_latin1'b') AS `COALESCE('a' COLLATE latin1_bin,'b')`
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
|
|
@ -20,7 +20,7 @@ explain extended select ~5, cast(~5 as signed);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)`
|
||||
Note 1003 select ~(5) AS `~5`,cast(~(5) as signed) AS `cast(~5 as signed)`
|
||||
select cast(5 as unsigned) -6.0;
|
||||
cast(5 as unsigned) -6.0
|
||||
-1.0
|
||||
|
|
|
@ -519,7 +519,7 @@ explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'`
|
||||
Note 1003 select charset(_latin1'a') AS `charset('a')`,collation(_latin1'a') AS `collation('a')`,coercibility(_latin1'a') AS `coercibility('a')`,(_latin1'a' = _latin1'A') AS `'a'='A'`
|
||||
SET CHARACTER SET koi8r;
|
||||
SHOW VARIABLES LIKE 'collation_client';
|
||||
Variable_name Value
|
||||
|
|
|
@ -331,7 +331,7 @@ explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM",
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")`
|
||||
Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")`
|
||||
create table t1 (d date);
|
||||
insert into t1 values ('2004-07-14'),('2005-07-14');
|
||||
select date_format(d,"%d") from t1 order by 1;
|
||||
|
|
|
@ -44,3 +44,12 @@ explain select count(*) from t1;
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||
drop table t1;
|
||||
set names koi8r;
|
||||
create table ÔÁÂ (ËÏÌ0 int, ËÏÌ1 int, key ÉÎÄ0 (ËÏÌ0), key ÉÎÄ01 (ËÏÌ0,ËÏÌ1));
|
||||
insert into ÔÁÂ (ËÏÌ0) values (1);
|
||||
insert into ÔÁÂ (ËÏÌ0) values (2);
|
||||
explain select ËÏÌ0 from ÔÁÂ where ËÏÌ0=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE ÔÁÂ ref ÉÎÄ0,ÉÎÄ01 ÉÎÄ0 5 const 1 Using where; Using index
|
||||
drop table ÔÁÂ;
|
||||
set names latin1;
|
||||
|
|
|
@ -17,7 +17,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext a a 0 1 Using where
|
||||
Warnings:
|
||||
Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections'))
|
||||
Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'collections'))
|
||||
select * from t1 where MATCH(a,b) AGAINST ("indexes");
|
||||
a b
|
||||
Full-text indexes are called collections
|
||||
|
@ -78,7 +78,7 @@ explain extended select * from t1 where MATCH(a,b) AGAINST("support -collections
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext a a 0 1 Using where
|
||||
Warnings:
|
||||
Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode))
|
||||
Note 1003 select test.t1.a AS `a`,test.t1.b AS `b` from test.t1 where (match test.t1.a,test.t1.b against (_latin1'support -collections' in boolean mode))
|
||||
select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE);
|
||||
a b
|
||||
MySQL has now support for full-text search
|
||||
|
@ -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);
|
||||
|
|
|
@ -11,7 +11,7 @@ explain extended select uncompress(compress(@test_compress_string));
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
|
||||
Note 1003 select sql_no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
|
||||
select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
|
||||
uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)
|
||||
1
|
||||
|
@ -19,7 +19,7 @@ explain extended select uncompressed_length(compress(@test_compress_string))=len
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
|
||||
Note 1003 select sql_no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
|
||||
select uncompressed_length(compress(@test_compress_string));
|
||||
uncompressed_length(compress(@test_compress_string))
|
||||
117
|
||||
|
|
|
@ -91,4 +91,4 @@ explain extended select password('idkfa '), old_password('idkfa');
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')`
|
||||
Note 1003 select password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')`
|
||||
|
|
|
@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
||||
Warnings:
|
||||
Note 1003 select high_priority default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1
|
||||
Note 1003 select default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) AS `default(rel)` from test.t1
|
||||
select * from t1 where str <> default(str);
|
||||
str strnull intg rel
|
||||
0 0
|
||||
|
|
|
@ -138,4 +138,4 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
|
||||
Note 1003 select des_decrypt(des_encrypt(_latin1'hello',4),_latin1'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt(_latin1'hello',_latin1'hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
|
||||
|
|
|
@ -18,7 +18,7 @@ explain extended select grp,group_concat(c) from t1 group by grp;
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
|
||||
Warnings:
|
||||
Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
|
||||
Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
|
||||
select grp,group_concat(a,c) from t1 group by grp;
|
||||
grp group_concat(a,c)
|
||||
1 1a
|
||||
|
@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
|
||||
Warnings:
|
||||
Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
|
||||
Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
|
||||
select grp,group_concat(c order by c separator ",") from t1 group by grp;
|
||||
grp group_concat(c order by c separator ",")
|
||||
1 a
|
||||
|
@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
|
||||
Warnings:
|
||||
Note 1003 select high_priority test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
|
||||
Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
|
||||
select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp;
|
||||
grp group_concat(distinct c order by c desc separator ",")
|
||||
1 a
|
||||
|
@ -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;
|
||||
|
|
|
@ -265,7 +265,7 @@ explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort
|
||||
Warnings:
|
||||
Note 1003 select high_priority big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a
|
||||
Note 1003 select sql_big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a
|
||||
drop table t1;
|
||||
create table t1 (col int);
|
||||
insert into t1 values (-1), (-2), (-3);
|
||||
|
|
|
@ -43,7 +43,7 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select high_priority if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY'))
|
||||
Note 1003 select if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY'))
|
||||
select nullif(u=0, 'test') from t1;
|
||||
nullif(u=0, 'test')
|
||||
NULL
|
||||
|
@ -57,7 +57,7 @@ explain extended select nullif(u=0, 'test') from t1;
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7
|
||||
Warnings:
|
||||
Note 1003 select high_priority nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1
|
||||
Note 1003 select nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1
|
||||
drop table t1;
|
||||
select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
|
||||
NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test")
|
||||
|
|
|
@ -146,7 +146,7 @@ explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
Warnings:
|
||||
Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin')))
|
||||
Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin')))
|
||||
drop table t1;
|
||||
select '1.0' in (1,2);
|
||||
'1.0' in (1,2)
|
||||
|
|
|
@ -5,7 +5,7 @@ explain extended select floor(5.5),floor(-5.5);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)`
|
||||
Note 1003 select floor(5.5) AS `floor(5.5)`,floor(-(5.5)) AS `floor(-5.5)`
|
||||
select ceiling(5.5),ceiling(-5.5);
|
||||
ceiling(5.5) ceiling(-5.5)
|
||||
6 -5
|
||||
|
@ -13,7 +13,7 @@ explain extended select ceiling(5.5),ceiling(-5.5);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)`
|
||||
Note 1003 select ceiling(5.5) AS `ceiling(5.5)`,ceiling(-(5.5)) AS `ceiling(-5.5)`
|
||||
select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1);
|
||||
truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2) truncate(-52.64,1) truncate(-52.64,-1)
|
||||
52.6 52.64 50 0 -52.6 -50
|
||||
|
@ -21,7 +21,7 @@ explain extended select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),t
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)`
|
||||
Note 1003 select truncate(52.64,1) AS `truncate(52.64,1)`,truncate(52.64,2) AS `truncate(52.64,2)`,truncate(52.64,-(1)) AS `truncate(52.64,-1)`,truncate(52.64,-(2)) AS `truncate(52.64,-2)`,truncate(-(52.64),1) AS `truncate(-52.64,1)`,truncate(-(52.64),-(1)) AS `truncate(-52.64,-1)`
|
||||
select round(5.5),round(-5.5);
|
||||
round(5.5) round(-5.5)
|
||||
6 -6
|
||||
|
@ -29,7 +29,7 @@ explain extended select round(5.5),round(-5.5);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)`
|
||||
Note 1003 select round(5.5,0) AS `round(5.5)`,round(-(5.5),0) AS `round(-5.5)`
|
||||
select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2);
|
||||
round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2)
|
||||
5.6 5.64 10 0
|
||||
|
@ -40,7 +40,7 @@ explain extended select abs(-10), sign(-5), sign(5), sign(0);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
|
||||
Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
|
||||
select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
|
||||
log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2)
|
||||
10.000000 10.000000 NULL NULL NULL 2.000000 NULL NULL
|
||||
|
@ -48,7 +48,7 @@ explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
|
||||
Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
|
||||
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
|
||||
ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL)
|
||||
10.000000 10.000000 NULL NULL NULL
|
||||
|
@ -56,7 +56,7 @@ explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
|
||||
Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
|
||||
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
|
||||
log2(8) log2(15) log2(-2) log2(0) log2(NULL)
|
||||
3.000000 3.906891 NULL NULL NULL
|
||||
|
@ -64,7 +64,7 @@ explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
|
||||
Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
|
||||
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
|
||||
log10(100) log10(18) log10(-4) log10(0) log10(NULL)
|
||||
2.000000 1.255273 NULL NULL NULL
|
||||
|
@ -72,7 +72,7 @@ explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)`
|
||||
Note 1003 select log10(100) AS `log10(100)`,log10(18) AS `log10(18)`,log10(-(4)) AS `log10(-4)`,log10(0) AS `log10(0)`,log10(NULL) AS `log10(NULL)`
|
||||
select pow(10,log10(10)),power(2,4);
|
||||
pow(10,log10(10)) power(2,4)
|
||||
10.000000 16.000000
|
||||
|
@ -80,7 +80,7 @@ explain extended select pow(10,log10(10)),power(2,4);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)`
|
||||
Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)`
|
||||
set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
||||
select rand(999999),rand();
|
||||
rand(999999) rand()
|
||||
|
@ -89,7 +89,7 @@ explain extended select rand(999999),rand();
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()`
|
||||
Note 1003 select sql_no_cache rand(999999) AS `rand(999999)`,rand() AS `rand()`
|
||||
select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1);
|
||||
pi() sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1)
|
||||
3.141593 1.000000 0.000000 0.000000 0.64209262 1.570796 1.570796 0.785398
|
||||
|
@ -97,7 +97,7 @@ explain extended select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)`
|
||||
Note 1003 select pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,cos((pi() / 2)) AS `cos(pi()/2)`,abs(tan(pi())) AS `abs(tan(pi()))`,(1 / tan(1)) AS `cot(1)`,asin(1) AS `asin(1)`,acos(0) AS `acos(0)`,atan(1) AS `atan(1)`
|
||||
select degrees(pi()),radians(360);
|
||||
degrees(pi()) radians(360)
|
||||
180 6.2831853071796
|
||||
|
@ -123,4 +123,4 @@ explain extended select degrees(pi()),radians(360);
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)`
|
||||
Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)`
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue